[
https://issues.apache.org/jira/browse/PHOENIX-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Taylor updated PHOENIX-1620:
----------------------------------
Attachment: 1620.patch
WIP patch. Will add more testing.
> 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
> Attachments: 1620.patch
>
>
> 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)