hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akash Ashok <thehellma...@gmail.com>
Subject Re: heapSize() implementation of KeyValue
Date Mon, 01 Aug 2011 05:21:57 GMT
Three integers are pasted in but "private int length" is already taken care
of by

 //Size of int length
>    ClassSize.align(length) +

So only 2 more integers are left right ?

On Mon, Aug 1, 2011 at 10:37 AM, Ryan Rawson <ryanobjc@gmail.com> wrote:

> Each array is really a pointer to an array (hence the references),
> then we are taking account of the overhead of the 'bytes' array
> itself.
>
> And I see 3 integers pasted in, so things are looking good to me....
>
> On Sun, Jul 31, 2011 at 10:01 PM, Akash Ashok <thehellmaker@gmail.com>
> wrote:
> > Hi,
> >     I was going thru the heapSize() method in the class KeyValue and i
> > couldn't seem to understand a few things which are in bold below
> >
> >
> >  private byte [] bytes = null;
> >  private int offset = 0;
> >  private int length = 0;
> >  private int keyLength = 0;
> >
> >  // the row cached
> >  private byte [] rowCache = null;
> >
> >  // default value is 0, aka DNC
> >  private long memstoreTS = 0;
> >  * @return Timestamp
> >  */
> >  private long timestampCache = -1;
> >
> >
> >  public long heapSize() {
> >    return ClassSize.align(
> >    // Fixed Object size
> >    ClassSize.OBJECT +
> >
> > *    // Why this ?????
> >    (2 * ClassSize.REFERENCE) +*
> >
> >    // bytes Array
> >    ClassSize.align(ClassSize.ARRAY) +
> >
> >    //Size of int length
> >    ClassSize.align(length) +
> >
> > *    // Why this ?? There are only 2 ints leaving length which are int (
> > offset, length)
> >    (3 * Bytes.SIZEOF_INT) +
> > *
> >    // rowCache byte array
> >        ClassSize.align(ClassSize.ARRAY) +
> >
> >    // Accounts for the longs memstoreTS and timestampCache
> >    (2 * Bytes.SIZEOF_LONG));
> >  }
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message