James Taylor created PHOENIX-1620:
-------------------------------------
Summary: Add API for getting tenant ID from an HBase row of a
Phoenix table
Key: PHOENIX-1620
URL: https://issues.apache.org/jira/browse/PHOENIX-1620
Project: Phoenix
Issue Type: Bug
Reporter: James Taylor
Provide a means for HBase-level tools to get the tenant ID from an HBase row of
any Phoenix table by adding the following method to PhoenixRuntime:
public static Expression getTenantIdExpression(PhoenixConnection conn,
String fullTableName);
Then you'd call this once to get back an Expression which could be used again
and again to get the tenantId from a List<Cell>, like this:
Tuple tuple = new MultiKeyValueTuple();
ImmutableBytesWritable ptr = new ImmutableBytesWritable();
Expression expression = PhoenixRuntime.getTenantIdExpression(conn,
fullTableName);
while (more rows) {
List<Cell> cells = get cells from row
tuple.setKeyValues(cells);
expression.evaluate(tuple, ptr);
// At this point ptr would point to the tenant ID with its offset and
length
}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)