Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> KeyValue.getLength() question

Copy link to this message
Re: KeyValue.getLength() question
myKV.getLength() is alway <= myKV.getBuffer().length.

The buffer here is typically an HFile block. We use that buffer and pass it up the chain without making any further copy of the KV.
-- Lars

----- Original Message -----
From: Kim Chew <[EMAIL PROTECTED]>
Sent: Wednesday, September 25, 2013 12:06 AM
Subject: KeyValue.getLength() question


I have a "strange" situation that I can't wrap my head around it. Say, for
example, I have an KeyValue instance, shouldn't

    myKV.getLength() == myKV.getBuffer().length ?

Given that, "getLength()" returns "Length of bytes this KeyValue occupies
in getBuffer()<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html#getBuffer%28%29>
In my case the value returned by "myKV.getBuffer().length" is greater than
"myKV.getLength()". What possibly went wrong?