Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/12#discussion_r17618928
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
---
@@ -667,12 +688,101 @@ private PTable getTable(RegionScanner scanner, long
clientTimeStamp, long tableT
} else {
addColumnToTable(results, colName, famName, colKeyValues,
columns, saltBucketNum != null);
}
+ }
+ byte[] tenIdBytes = ByteUtil.EMPTY_BYTE_ARRAY;
+ if (tenantId != null) {
+ tenIdBytes = tenantId.getBytes();
}
-
+ byte[] schNameInBytes = ByteUtil.EMPTY_BYTE_ARRAY;
+ if (schemaName != null) {
+ schNameInBytes = Bytes.toBytes(schemaName.getString());
+ }
+ byte[] tableKey = SchemaUtil.getTableKey(tenIdBytes,
schNameInBytes , PhoenixDatabaseMetaData.SYSTEM_STATS_NAME_BYTES);
+ ImmutableBytesPtr key = new ImmutableBytesPtr(tableKey);
+ Cache<ImmutableBytesPtr, PTable> metaDataCache =
+ GlobalCache.getInstance(this.env).getMetaDataCache();
+ PTable statsPTable = metaDataCache.getIfPresent(key);
+ PTableStats stats = updateStatsInternal(tableNameBytes, columns,
statsPTable);
--- End diff --
You have to make sure that tableNameBytes is the physical table name which
you can get from the physicalTables local variable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---