You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Todd Gruben <tg...@gmail.com> on 2014/03/27 20:01:38 UTC

Result of postIncrement

 I am trying to get the value of the column I just incremented
and I can't seem to find it..

Here is a snippet of what I am trying...

for(Cell cell:result.rawCells()) {
                                byte[] result_key =
CellUtil.cloneQualifier(cell);
                                byte[] value = CellUtil.cloneValue(cell);


Bytes.toString(result_key); ///this is the correct key
 Bytes.toString(value));//value should be 1, nothing here
value // prints out B@19740a2a in the log

Anyone have any ideas?

-Todd

Re: Result of postIncrement

Posted by Todd Gruben <tg...@gmail.com>.
Haven't tried that, I'll give it a go.

I running version 0.96.1.1-cdh5.0.0-beta-2.


cheers,


On Thu, Mar 27, 2014 at 2:23 PM, Ted Yu <yu...@gmail.com> wrote:

> In the for loop, have you tried using this method from KeyValueUtil ?
>
>   public static KeyValue ensureKeyValue(final Cell cell) {
>
> Which hbase version are you using ?
>
>
> Cheers
>
>
> On Thu, Mar 27, 2014 at 12:01 PM, Todd Gruben <tg...@gmail.com> wrote:
>
> >  I am trying to get the value of the column I just incremented
> > and I can't seem to find it..
> >
> > Here is a snippet of what I am trying...
> >
> > for(Cell cell:result.rawCells()) {
> >                                 byte[] result_key =
> > CellUtil.cloneQualifier(cell);
> >                                 byte[] value = CellUtil.cloneValue(cell);
> >
> >
> > Bytes.toString(result_key); ///this is the correct key
> >  Bytes.toString(value));//value should be 1, nothing here
> > value // prints out B@19740a2a in the log
> >
> > Anyone have any ideas?
> >
> > -Todd
> >
>

Re: Result of postIncrement

Posted by Ted Yu <yu...@gmail.com>.
In the for loop, have you tried using this method from KeyValueUtil ?

  public static KeyValue ensureKeyValue(final Cell cell) {

Which hbase version are you using ?


Cheers


On Thu, Mar 27, 2014 at 12:01 PM, Todd Gruben <tg...@gmail.com> wrote:

>  I am trying to get the value of the column I just incremented
> and I can't seem to find it..
>
> Here is a snippet of what I am trying...
>
> for(Cell cell:result.rawCells()) {
>                                 byte[] result_key =
> CellUtil.cloneQualifier(cell);
>                                 byte[] value = CellUtil.cloneValue(cell);
>
>
> Bytes.toString(result_key); ///this is the correct key
>  Bytes.toString(value));//value should be 1, nothing here
> value // prints out B@19740a2a in the log
>
> Anyone have any ideas?
>
> -Todd
>