hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akash Ashok <thehellma...@gmail.com>
Subject heapSize() implementation of KeyValue
Date Mon, 01 Aug 2011 05:01:55 GMT
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