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

James Taylor commented on PHOENIX-2520:
---------------------------------------

Thanks for the patch, [~yhxx511]. I borrowed your idea for a NEVER and ALWAYS 
option for the new UPDATE_CACHE_FREQQUENCY property. You also have the ability 
to specify a time in milliseconds after which we'll do the RPC to check whether 
the metadata is in sync. You can specify this in both CREATE TABLE and ALTER 
TABLE. When altering the property, the client side cache will be flushed for 
the cluster connection on the JVM, but other JVMs will not see it until their 
cache expires based on the previous value.

> Create DDL property for metadata update frequency
> -------------------------------------------------
>
>                 Key: PHOENIX-2520
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2520
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: James Taylor
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2520.patch, PHOENIX-2520_v2.patch, 
> PHOENIX-2520_wip.patch, preferMetaCache.patch
>
>
> On the client-side, Phoenix pings the server when a query is compiled to 
> confirm that the client has the most up-to-date metadata for the table being 
> queried. For some tables that are known to not change, this RPC is wasteful. 
> We can allow a property such as {{UPDATE_METADATA_CACHE_FREQUENCY_MS}} to be 
> specified a time to wait before checking with the server to see if the 
> metadata has changed. This could be specified in the CREATE TABLE call and 
> stored in the SYSTEM.CATALOG table header row. By default the value could be 
> 0 which would keep the current behavior. Tables that never change could use 
> Long.MAX_VALUE. Potentially we could allow 'ALWAYS' and 'NEVER' values for 
> convenience.
> Proposed implementation:
> - add {{public long getAge()}} method to {{PTableRef}}.
> - when setting lastAccessTime, also store System.currentMillis() to new 
> {{setAccessTime}} private member variable
> - the getAge() would return {{System.currentMillis() - setAccessTime}}
> - code in MetaDataClient would prevent call to server if age < 
> {{UPDATE_METADATA_CACHE_FREQUENCY_MS}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to