hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1182530 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/Store.java src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
Date Wed, 12 Oct 2011 19:08:51 GMT
Author: jgray
Date: Wed Oct 12 19:08:50 2011
New Revision: 1182530

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

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1182530&r1=1182529&r2=1182530&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Oct 12 19:08:50 2011
@@ -352,6 +352,7 @@ Release 0.92.0 - Unreleased
                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-4450  test for number of blocks read: to serve as baseline for expected

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1182530&r1=1182529&r2=1182530&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Wed Oct 12 19:08:50
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/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1182530&r1=1182529&r2=1182530&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java Wed Oct
12 19:08:50 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;



Mime
View raw message