hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1480006 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Date Tue, 07 May 2013 18:32:06 GMT
Author: liyin
Date: Tue May  7 18:32:06 2013
New Revision: 1480006

URL: http://svn.apache.org/r1480006
Log:
[HBASE-8491] Fixing the TestHeapSizes.

Author: manukranthk

Summary: Accounting for the extra references added. Did an absolute count of non static variables
and updated accordingly.

Test Plan: Unit Tests

Reviewers: liyintang

Reviewed By: liyintang

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D799334

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1480006&r1=1480005&r2=1480006&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Tue
May  7 18:32:06 2013
@@ -155,6 +155,27 @@ public class Store extends SchemaConfigu
   private Class<KeyValueAggregator> aggregatorClass = null;
   private CompactionHook compactHook = null;
 
+  // This should account for the Store's non static variables. So, when there
+  // is an addition to the member variables to Store, this value should be
+  // adjusted accordingly.
+  public static final long FIXED_OVERHEAD =
+      ClassSize.align(SchemaConfigured.SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE +
+          + (20 * ClassSize.REFERENCE) + (6 * Bytes.SIZEOF_LONG)
+          + (4 * Bytes.SIZEOF_INT) + 2 * Bytes.SIZEOF_BOOLEAN);
+
+  public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
+      ClassSize.OBJECT + ClassSize.REENTRANT_LOCK +
+      ClassSize.CONCURRENT_SKIPLISTMAP +
+      ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY + ClassSize.OBJECT);
+
+  /*
+   * Set to
+   * true  : for using pread
+   * false : for using seek+read
+   */
+  public static boolean isPread = true;
+
+
   /**
    * Constructor
    * @param basedir qualified path under which the region directory lives;
@@ -1886,23 +1907,6 @@ public class Store extends SchemaConfigu
     return this.cacheConf;
   }
 
-  public static final long FIXED_OVERHEAD =
-      ClassSize.align(SchemaConfigured.SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE +
-          + (19 * ClassSize.REFERENCE) + (6 * Bytes.SIZEOF_LONG)
-          + (4 * Bytes.SIZEOF_INT) + 2 * Bytes.SIZEOF_BOOLEAN);
-
-  public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
-      ClassSize.OBJECT + ClassSize.REENTRANT_LOCK +
-      ClassSize.CONCURRENT_SKIPLISTMAP +
-      ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY + ClassSize.OBJECT);
-
-  /*
-   * Set to
-   * true  : for using pread
-   * false : for using seek+read
-   */
-  public static boolean isPread = true;
-
   @Override
   public long heapSize() {
     return DEEP_OVERHEAD + this.memstore.heapSize();



Mime
View raw message