You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by johnson hong <ho...@goodhope.net> on 2010/01/06 05:01:55 UTC

The row counts of Htable is becoming small after a reduce operation(delete and put)

Hi,all.
I tried to modify the rowkey in a reduce,the operation looks like as
follows:

 void reduce(ImmutableBytesWritable oldKey, Iterable<Text> values,Context
context) {
      
            context.write(oldKey, new Delete(oldKey.get());
            context.write(oldKey, new Put(newKey));     //newkey may be
equals the oldkey
  }

after this operation,i found the row counts is less than before,could it be
that the put action is not granteed to be excuted after delete action ?
-- 
View this message in context: http://old.nabble.com/The-row-counts-of-Htable-is-becoming-small-after-a-reduce-operation%28delete-and-put%29-tp27026768p27026768.html
Sent from the HBase User mailing list archive at Nabble.com.


Re: The row counts of Htable is becoming small after a reduce operation(delete and put)

Posted by 洪锦城 <ho...@goodhope.net>.
> void reduce(ImmutableBytesWritable oldKey, Iterable<Text> values,Context
> context) {
>
>  context.write(oldKey, new Delete(oldKey.get());
>  context.write(oldKey, new Put(newKey));
>}
>



Thank you,I got it now.The default value of timestamp for both Delete and
Put is set to Long.MAX_VALUE.So the newKey maybe delete after put.

Re: The row counts of Htable is becoming small after a reduce operation(delete and put)

Posted by Jean-Daniel Cryans <jd...@apache.org>.
If this seems awkward or new to you, I highly suggest you read the
Bigtable paper: http://labs.google.com/papers/bigtable-osdi06.pdf

J-D

On Tue, Jan 5, 2010 at 10:29 PM, Jean-Daniel Cryans <jd...@apache.org> wrote:
> put.setTimestamp, same for delete.
>
> J-D
>
> On Tue, Jan 5, 2010 at 10:14 PM, 洪锦城 <ho...@goodhope.net> wrote:
>> 2010/1/6 Jean-Daniel Cryans <jd...@apache.org>
>>
>>> You either have to review your processing, manage your own
>>> timestamps in something like nanos.
>>>
>>> How to manage timestamps ?
>>
>

Re: The row counts of Htable is becoming small after a reduce operation(delete and put)

Posted by Jean-Daniel Cryans <jd...@apache.org>.
put.setTimestamp, same for delete.

J-D

On Tue, Jan 5, 2010 at 10:14 PM, 洪锦城 <ho...@goodhope.net> wrote:
> 2010/1/6 Jean-Daniel Cryans <jd...@apache.org>
>
>> You either have to review your processing, manage your own
>> timestamps in something like nanos.
>>
>> How to manage timestamps ?
>

Re: The row counts of Htable is becoming small after a reduce operation(delete and put)

Posted by 洪锦城 <ho...@goodhope.net>.
2010/1/6 Jean-Daniel Cryans <jd...@apache.org>

> You either have to review your processing, manage your own
> timestamps in something like nanos.
>
> How to manage timestamps ?

Re: The row counts of Htable is becoming small after a reduce operation(delete and put)

Posted by Jean-Daniel Cryans <jd...@apache.org>.
If the put is done very near the delete so that both have the same
timestamp (even more likely on a single node setup), then the delete
wins. You either have to review your processing, manage your own
timestamps in something like nanos or build a new row key.

J-D

On Tue, Jan 5, 2010 at 8:01 PM, johnson hong <ho...@goodhope.net> wrote:
>
> Hi,all.
> I tried to modify the rowkey in a reduce,the operation looks like as
> follows:
>
>  void reduce(ImmutableBytesWritable oldKey, Iterable<Text> values,Context
> context) {
>
>            context.write(oldKey, new Delete(oldKey.get());
>            context.write(oldKey, new Put(newKey));     //newkey may be
> equals the oldkey
>  }
>
> after this operation,i found the row counts is less than before,could it be
> that the put action is not granteed to be excuted after delete action ?
> --
> View this message in context: http://old.nabble.com/The-row-counts-of-Htable-is-becoming-small-after-a-reduce-operation%28delete-and-put%29-tp27026768p27026768.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>