hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14255) Simplify Cell creation post 1.0
Date Mon, 14 Nov 2016 03:15:58 GMT

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

Anoop Sam John commented on HBASE-14255:
----------------------------------------

In CellUtil, which is public, we have diff versions of createCell APIs.
bq.public static Cell createCell(final byte [] row, final byte [] family, final byte [] qualifier)

Here we don't have value to be passed.  We should be having an overloaded API which takes
value byte[] also..  Seems that is what Lars looking for.
Should be a simple API. I can give a quick patch.  Or u r working on it in some other way
[~saint.ack@gmail.com]?


> Simplify Cell creation post 1.0
> -------------------------------
>
>                 Key: HBASE-14255
>                 URL: https://issues.apache.org/jira/browse/HBASE-14255
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>    Affects Versions: 1.0.0, 2.0.0
>            Reporter: Lars George
>            Priority: Critical
>             Fix For: 2.0.0
>
>
> After the switch to the new Cell based client API, and making KeyValue private (but especially
as soon as DBB backed Cells land) it is rather difficult to create a {{Cell}} instance. I
am using this now:
> {code}
>  @Override
>   public void postGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
>     Get get, List<Cell> results) throws IOException {
>     Put put = new Put(get.getRow());
>     put.addColumn(get.getRow(), FIXED_COLUMN, Bytes.toBytes(counter.get()));
>     CellScanner scanner = put.cellScanner();
>     scanner.advance();
>     Cell cell = scanner.current();
>     LOG.debug("Adding fake cell: " + cell);
>     results.add(cell);
>   }
> {code}
> That is, I have to create a {{Put}} instance to add a cell and then retrieve its instance.
The {{KeyValue}} methods are private now and should not be used. Create a CellBuilder helper?



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

Mime
View raw message