hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1463204 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver: MemStoreFlusher.java Store.java
Date Mon, 01 Apr 2013 16:53:57 GMT
Author: tedyu
Date: Mon Apr  1 16:53:57 2013
New Revision: 1463204

URL: http://svn.apache.org/r1463204
Log:
HBASE-8174 Backport HBASE-8161(setting blocking file count on table level doesn't work) to
0.94 (clockfly)


Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java?rev=1463204&r1=1463203&r2=1463204&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Mon Apr  1 16:53:57 2013
@@ -82,7 +82,7 @@ class MemStoreFlusher extends HasThread 
     "hbase.regionserver.global.memstore.upperLimit";
   private static final String LOWER_KEY =
     "hbase.regionserver.global.memstore.lowerLimit";
-  private long blockingStoreFilesNumber;
+  
   private long blockingWaitTime;
   private final Counter updatesBlockedMsHighWater = new Counter();
 
@@ -106,12 +106,7 @@ class MemStoreFlusher extends HasThread 
         "because supplied " + LOWER_KEY + " was > " + UPPER_KEY);
     }
     this.globalMemStoreLimitLowMark = lower;
-    this.blockingStoreFilesNumber =
-      conf.getInt("hbase.hstore.blockingStoreFiles", 7);
-    if (this.blockingStoreFilesNumber == -1) {
-      this.blockingStoreFilesNumber = 1 +
-        conf.getInt("hbase.hstore.compactionThreshold", 3);
-    }
+    
     this.blockingWaitTime = conf.getInt("hbase.hstore.blockingWaitTime",
       90000);
     LOG.info("globalMemStoreLimit=" +
@@ -444,7 +439,7 @@ class MemStoreFlusher extends HasThread 
 
   private boolean isTooManyStoreFiles(HRegion region) {
     for (Store hstore: region.stores.values()) {
-      if (hstore.getStorefilesCount() > this.blockingStoreFilesNumber) {
+      if (hstore.hasTooManyStoreFiles()) {
         return true;
       }
     }

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1463204&r1=1463203&r2=1463204&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Mon
Apr  1 16:53:57 2013
@@ -109,6 +109,9 @@ import com.google.common.collect.Lists;
  */
 public class Store extends SchemaConfigured implements HeapSize {
   static final Log LOG = LogFactory.getLog(Store.class);
+  
+  public static final String BLOCKING_STOREFILES_KEY = "hbase.hstore.blockingStoreFiles";
+  public static final int DEFAULT_BLOCKING_STOREFILE_COUNT = 7;
 
   protected final MemStore memstore;
   // This stores directory in the filesystem.
@@ -134,6 +137,8 @@ public class Store extends SchemaConfigu
   private final Object flushLock = new Object();
   final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
   private final boolean verifyBulkLoads;
+  
+  private long blockingFileCount;
 
   /* The default priority for user-specified compaction requests.
    * The user gets top priority unless we have blocking compactions. (Pri <= 0)
@@ -237,7 +242,10 @@ public class Store extends SchemaConfigu
       = conf.getLong("hbase.hstore.compaction.max.size", Long.MAX_VALUE);
 
     this.verifyBulkLoads = conf.getBoolean("hbase.hstore.bulkload.verify", false);
-
+    
+    this.blockingFileCount =
+                conf.getInt(BLOCKING_STOREFILES_KEY, DEFAULT_BLOCKING_STOREFILE_COUNT);
+    
     if (Store.closeCheckInterval == 0) {
       Store.closeCheckInterval = conf.getInt(
           "hbase.hstore.close.check.interval", 10*1000*1000 /* 10 MB */);
@@ -2271,7 +2279,7 @@ public class Store extends SchemaConfigu
 
   public static final long FIXED_OVERHEAD =
       ClassSize.align(SchemaConfigured.SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE +
-          + (17 * ClassSize.REFERENCE) + (6 * Bytes.SIZEOF_LONG)
+          + (17 * ClassSize.REFERENCE) + (7 * Bytes.SIZEOF_LONG)
           + (5 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN);
 
   public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD
@@ -2292,6 +2300,10 @@ public class Store extends SchemaConfigu
   public ScanInfo getScanInfo() {
     return scanInfo;
   }
+  
+  public boolean hasTooManyStoreFiles() {
+    return getStorefilesCount() > this.blockingFileCount;
+  }
 
   /**
    * Immutable information for scans over a store.



Mime
View raw message