[
https://issues.apache.org/jira/browse/PHOENIX-4475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992407#comment-16992407
]
Nitesh Maheshwari commented on PHOENIX-4475:
--------------------------------------------
Hi [~tdsilva]
It looks like PhoenixRuntime.getTable(Connection, String) does honor the
UPDATE_CACHE_FREQUENCY property when the table is not found in the connection's
metadata cache - based on the catch block below where it calls
updateCache(schemaName, tableName):
{code:java}
try {
table = pconn.getTable(new PTableKey(pconn.getTenantId(), name));
} catch (TableNotFoundException e) {
String schemaName = SchemaUtil.getSchemaNameFromFullName(name);
String tableName = SchemaUtil.getTableNameFromFullName(name);
MetaDataMutationResult result =
new MetaDataClient(pconn).updateCache(schemaName,
tableName);
if (result.getMutationCode() != MutationCode.TABLE_ALREADY_EXISTS) {
throw e;
}
table = result.getTable();
}
return table;
{code}
Did you want to address something else with this jira? I am probably missing
something but what is the 'difference' in behavior you are indicating here?
[~ckulkarni] FYI.
> Change PhoenixRuntime.getTable to fetch the latest metadata of the table
> being looked up
> ----------------------------------------------------------------------------------------
>
> Key: PHOENIX-4475
> URL: https://issues.apache.org/jira/browse/PHOENIX-4475
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Thomas D'Silva
> Priority: Major
>
> Returns the table if it is found in the connection metadata cache. If the
> metadata of this
> table has changed since it was put in the cache these changes will not
> necessarily be
> reflected in the returned table. If the table is not found, makes a call to
> the server to
> fetch the latest metadata of the table.
> This is different than how a table is resolved when it is referenced from a
> query (a call is made to the server to fetch the latest metadata of the table
> depending on the UPDATE_CACHE_FREQUENCY property)
> We could change PhoenixRuntime.getTable to make this behavior the same at the
> cost of an extra RPC.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)