You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jg...@apache.org on 2011/10/12 21:10:24 UTC

svn commit: r1182532 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/Store.java src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java

Author: jgray
Date: Wed Oct 12 19:10:23 2011
New Revision: 1182532

URL: http://svn.apache.org/viewvc?rev=1182532&view=rev
Log:
HBASE-4582  Store.java cleanup (failing TestHeapSize and has warnings) (jgray)

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1182532&r1=1182531&r2=1182532&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Wed Oct 12 19:10:23 2011
@@ -333,6 +333,7 @@ Release 0.92.0 - Unreleased
                clients and regionservers (Lars H)
    HBASE-4555  TestShell seems passed, but actually errors seen in test
                output file (Mingjie Lai)
+   HBASE-4582  Store.java cleanup (failing TestHeapSize and has warnings)
 
   TESTS
    HBASE-4492  TestRollingRestart fails intermittently

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1182532&r1=1182531&r2=1182532&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Wed Oct 12 19:10:23 2011
@@ -59,7 +59,6 @@ import org.apache.hadoop.util.StringUtil
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
 /**
@@ -133,7 +132,6 @@ public class Store implements HeapSize {
     new CopyOnWriteArraySet<ChangedReadersObserver>();
 
   private final int blocksize;
-  private final boolean blockcache;
   /** Compression algorithm for flush files and minor compaction */
   private final Compression.Algorithm compression;
   /** Compression algorithm for major compaction */
@@ -166,7 +164,6 @@ public class Store implements HeapSize {
     this.region = region;
     this.family = family;
     this.conf = conf;
-    this.blockcache = family.isBlockCacheEnabled();
     this.blocksize = family.getBlocksize();
     this.compression = family.getCompression();
     // avoid overriding compression setting for major compactions if the user
@@ -1348,7 +1345,7 @@ public class Store implements HeapSize {
       this.memstore.getRowKeyAtOrBefore(state);
       // Check if match, if we got a candidate on the asked for 'kv' row.
       // Process each store file. Run through from newest to oldest.
-      for (StoreFile sf : Iterables.reverse(storefiles)) {
+      for (StoreFile sf : Lists.reverse(storefiles)) {
         // Update the candidate keys from the current map file
         rowAtOrBeforeFromStoreFile(sf, state);
       }
@@ -1387,7 +1384,7 @@ public class Store implements HeapSize {
       firstOnRow = new KeyValue(lastKV.getRow(), HConstants.LATEST_TIMESTAMP);
     }
     // Get a scanner that caches blocks and that uses pread.
-    HFileScanner scanner = r.getScanner(true, true);
+    HFileScanner scanner = r.getHFileReader().getScanner(true, true);
     // Seek scanner.  If can't seek it, return.
     if (!seekToScanner(scanner, firstOnRow, firstKV)) return;
     // If we found candidate on firstOnRow, just return. THIS WILL NEVER HAPPEN!
@@ -1473,7 +1470,7 @@ public class Store implements HeapSize {
           return false;
         }
       }
-      
+
       return true;
     } finally {
       this.lock.readLock().unlock();
@@ -1508,7 +1505,7 @@ public class Store implements HeapSize {
           LOG.warn("Storefile " + sf + " Reader is null");
           continue;
         }
-        
+
         long size = r.length();
         if (size > maxSize) {
           // This is the largest one so far
@@ -1793,7 +1790,7 @@ public class Store implements HeapSize {
   public static final long FIXED_OVERHEAD = ClassSize.align(
       ClassSize.OBJECT + (17 * ClassSize.REFERENCE) +
       (7 * Bytes.SIZEOF_LONG) + (1 * Bytes.SIZEOF_DOUBLE) +
-      (6 * Bytes.SIZEOF_INT) + (2 * Bytes.SIZEOF_BOOLEAN));
+      (7 * Bytes.SIZEOF_INT) + (1 * Bytes.SIZEOF_BOOLEAN));
 
   public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
       ClassSize.OBJECT + ClassSize.REENTRANT_LOCK +

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1182532&r1=1182531&r2=1182532&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java Wed Oct 12 19:10:23 2011
@@ -46,7 +46,6 @@ import org.apache.hadoop.hbase.KeyValue.
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.HalfStoreFileReader;
 import org.apache.hadoop.hbase.io.Reference;
-import org.apache.hadoop.hbase.io.hfile.BlockCache;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 import org.apache.hadoop.hbase.io.hfile.Compression;
 import org.apache.hadoop.hbase.io.hfile.HFile;
@@ -121,9 +120,6 @@ public class StoreFile {
   // Need to make it 8k for testing.
   public static final int DEFAULT_BLOCKSIZE_SMALL = 8 * 1024;
 
-
-  private static BlockCache hfileBlockCache = null;
-
   private final FileSystem fs;
 
   // This file's path.
@@ -173,7 +169,6 @@ public class StoreFile {
 
   // Used making file ids.
   private final static Random rand = new Random();
-  private final Configuration conf;
 
   /**
    * Bloom filter type specified in column family configuration. Does not
@@ -206,7 +201,6 @@ public class StoreFile {
             final CacheConfig cacheConf,
             final BloomType cfBloomType)
       throws IOException {
-    this.conf = conf;
     this.fs = fs;
     this.path = p;
     this.cacheConf = cacheConf;