[ 
https://issues.apache.org/jira/browse/PHOENIX-7165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17802084#comment-17802084
 ] 

ASF GitHub Bot commented on PHOENIX-7165:
-----------------------------------------

kadirozde commented on PR #1777:
URL: https://github.com/apache/phoenix/pull/1777#issuecomment-1875071311

   > > > Also, I wonder if we should make this functionalitiy available from 
the Connection object as a new method.
   > > 
   > > 
   > > Ideally yes we should. We tried that before while working on 
[PHOENIX-6761](https://issues.apache.org/jira/browse/PHOENIX-6761). However, 
there are tests that expect TableNotFoundException from 
PhoenixConnection#getTable. So, we gave up on that.
   > 
   > What is your opinion on renaming the current getTable to something like 
getCachedTable or getTableFromCache, and adding a fixed getTable to handles 
tables not in the cache ? That would not break the tests (and current code that 
relies on the bahviour), and would make the method names better match the 
behaviour ?
   
   I will look into unifying get table and related methods and possibly remove 
them from PhoenixRuntime to simply the code.




> Compilers should use PhoenixRuntime#getTable
> --------------------------------------------
>
>                 Key: PHOENIX-7165
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7165
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Kadir Ozdemir
>            Assignee: Kadir Ozdemir
>            Priority: Major
>
> PhoenixConnection#getTable gets a PTable from the PTable cache per JVM. If 
> the table is not in the cache then it trows TableNotFoundException.
> PhoenixRuntime#getTable calls first PhoenixConnection#getTable and if the 
> table is not in the cache, it retrieves table from the server.
> Since a user table can be evicted from the cache any time, Phoenix compilers 
> should not use PhoenixConnection#getTable, instead they should use 
> PhoenixRuntime#getTable. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to