From 2806d60cab96f90048e508c1aa79580044266a6f Mon Sep 17 00:00:00 2001 From: Ryan Rawson Date: Wed, 22 Sep 2010 23:49:49 +0000 Subject: [PATCH] HBASE-3003 ClassSize constants dont use 'final' git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1000275 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../apache/hadoop/hbase/util/ClassSize.java | 43 ++++++++++--------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d6790aa559f..b27b8de9efb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -535,6 +535,7 @@ Release 0.21.0 - Unreleased HBASE-3023 NPE processing server crash in MetaReader. getServerUserRegions HBASE-3024 NPE processing server crash in MetaEditor.addDaughter HBASE-3026 Fixup of "missing" daughters on split is too aggressive + HBASE-3003 ClassSize constants dont use 'final' IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable diff --git a/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java b/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java index e11a844c1b9..c7d94e2aa0c 100755 --- a/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java +++ b/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java @@ -39,64 +39,64 @@ public class ClassSize { private static int nrOfRefsPerObj = 2; /** Array overhead */ - public static int ARRAY = 0; + public static final int ARRAY; /** Overhead for ArrayList(0) */ - public static int ARRAYLIST = 0; + public static final int ARRAYLIST; /** Overhead for ByteBuffer */ - public static int BYTE_BUFFER = 0; + public static final int BYTE_BUFFER; /** Overhead for an Integer */ - public static int INTEGER = 0; + public static final int INTEGER; /** Overhead for entry in map */ - public static int MAP_ENTRY = 0; + public static final int MAP_ENTRY; /** Object overhead is minimum 2 * reference size (8 bytes on 64-bit) */ - public static int OBJECT = 0; + public static final int OBJECT; /** Reference size is 8 bytes on 64-bit, 4 bytes on 32-bit */ - public static int REFERENCE = 0; + public static final int REFERENCE; /** String overhead */ - public static int STRING = 0; + public static final int STRING; /** Overhead for TreeMap */ - public static int TREEMAP = 0; + public static final int TREEMAP; /** Overhead for ConcurrentHashMap */ - public static int CONCURRENT_HASHMAP = 0; + public static final int CONCURRENT_HASHMAP; /** Overhead for ConcurrentHashMap.Entry */ - public static int CONCURRENT_HASHMAP_ENTRY = 0; + public static final int CONCURRENT_HASHMAP_ENTRY; /** Overhead for ConcurrentHashMap.Segment */ - public static int CONCURRENT_HASHMAP_SEGMENT = 0; + public static final int CONCURRENT_HASHMAP_SEGMENT; /** Overhead for ConcurrentSkipListMap */ - public static int CONCURRENT_SKIPLISTMAP = 0; + public static final int CONCURRENT_SKIPLISTMAP; /** Overhead for ConcurrentSkipListMap Entry */ - public static int CONCURRENT_SKIPLISTMAP_ENTRY = 0; + public static final int CONCURRENT_SKIPLISTMAP_ENTRY; /** Overhead for ReentrantReadWriteLock */ - public static int REENTRANT_LOCK = 0; + public static final int REENTRANT_LOCK; /** Overhead for AtomicLong */ - public static int ATOMIC_LONG = 0; + public static final int ATOMIC_LONG; /** Overhead for AtomicInteger */ - public static int ATOMIC_INTEGER = 0; + public static final int ATOMIC_INTEGER; /** Overhead for AtomicBoolean */ - public static int ATOMIC_BOOLEAN = 0; + public static final int ATOMIC_BOOLEAN; /** Overhead for CopyOnWriteArraySet */ - public static int COPYONWRITE_ARRAYSET = 0; + public static final int COPYONWRITE_ARRAYSET; /** Overhead for CopyOnWriteArrayList */ - public static int COPYONWRITE_ARRAYLIST = 0; + public static final int COPYONWRITE_ARRAYLIST; private static final String THIRTY_TWO = "32"; @@ -110,9 +110,10 @@ public class ClassSize { String arcModel = sysProps.getProperty("sun.arch.data.model"); //Default value is set to 8, covering the case when arcModel is unknown - REFERENCE = 8; if (arcModel.equals(THIRTY_TWO)) { REFERENCE = 4; + } else { + REFERENCE = 8; } OBJECT = 2 * REFERENCE;