hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1460823 - in /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver: DefaultStoreFileManager.java HStore.java MemStoreFlusher.java Store.java
Date Mon, 25 Mar 2013 18:34:44 GMT
Author: sershe
Date: Mon Mar 25 18:34:43 2013
New Revision: 1460823

URL: http://svn.apache.org/r1460823
Log:
HBASE-8161 setting blocking file count on table level doesn't work

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java?rev=1460823&r1=1460822&r2=1460823&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java
Mon Mar 25 18:34:43 2013
@@ -130,7 +130,7 @@ class DefaultStoreFileManager implements
   @Override
   public int getStoreCompactionPriority() {
     int blockingFileCount = conf.getInt(
-        "hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
+        HStore.BLOCKING_STOREFILES_KEY, HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
     return blockingFileCount - storefiles.size();
   }
 

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java?rev=1460823&r1=1460822&r2=1460823&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
Mon Mar 25 18:34:43 2013
@@ -105,6 +105,7 @@ import com.google.common.collect.Lists;
  */
 @InterfaceAudience.Private
 public class HStore implements Store {
+  public static final String BLOCKING_STOREFILES_KEY = "hbase.hstore.blockingStoreFiles";
   public static final int DEFAULT_BLOCKING_STOREFILE_COUNT = 7;
 
   static final Log LOG = LogFactory.getLog(HStore.class);
@@ -151,6 +152,8 @@ public class HStore implements Store {
   private static int flush_retries_number;
   private static int pauseTime;
 
+  private long blockingFileCount;
+
   /**
    * Constructor
    * @param region
@@ -202,6 +205,9 @@ public class HStore implements Store {
 
     this.verifyBulkLoads = conf.getBoolean("hbase.hstore.bulkload.verify", false);
 
+    this.blockingFileCount =
+        conf.getInt(BLOCKING_STOREFILES_KEY, DEFAULT_BLOCKING_STOREFILE_COUNT);
+
     if (HStore.closeCheckInterval == 0) {
       HStore.closeCheckInterval = conf.getInt(
           "hbase.hstore.close.check.interval", 10*1000*1000 /* 10 MB */);
@@ -1786,7 +1792,7 @@ public class HStore implements Store {
   }
 
   public static final long FIXED_OVERHEAD =
-      ClassSize.align((17 * ClassSize.REFERENCE) + (4 * Bytes.SIZEOF_LONG)
+      ClassSize.align((17 * ClassSize.REFERENCE) + (5 * Bytes.SIZEOF_LONG)
               + (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN);
 
   public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD
@@ -1816,4 +1822,9 @@ public class HStore implements Store {
   void setScanInfo(ScanInfo scanInfo) {
     this.scanInfo = scanInfo;
   }
+
+  @Override
+  public boolean hasTooManyStoreFiles() {
+    return getStorefilesCount() > this.blockingFileCount;
+  }
 }

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java?rev=1460823&r1=1460822&r2=1460823&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Mon Mar 25 18:34:43 2013
@@ -85,7 +85,6 @@ class MemStoreFlusher implements FlushRe
     "hbase.regionserver.global.memstore.upperLimit";
   private static final String LOWER_KEY =
     "hbase.regionserver.global.memstore.lowerLimit";
-  private int blockingStoreFileCount;
   private long blockingWaitTime;
   private final Counter updatesBlockedMsHighWater = new Counter();
 
@@ -111,8 +110,6 @@ class MemStoreFlusher implements FlushRe
         "because supplied " + LOWER_KEY + " was > " + UPPER_KEY);
     }
     this.globalMemStoreLimitLowMark = lower;
-    this.blockingStoreFileCount =
-      conf.getInt("hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
     this.blockingWaitTime = conf.getInt("hbase.hstore.blockingWaitTime",
       90000);
     int handlerCount = conf.getInt("hbase.hstore.flusher.count", 1);
@@ -480,8 +477,8 @@ class MemStoreFlusher implements FlushRe
   }
 
   private boolean isTooManyStoreFiles(HRegion region) {
-    for (Store hstore : region.stores.values()) {
-      if (hstore.getStorefilesCount() > this.blockingStoreFileCount) {
+    for (Store store : region.stores.values()) {
+      if (store.hasTooManyStoreFiles()) {
         return true;
       }
     }

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1460823&r1=1460822&r2=1460823&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Mon Mar 25 18:34:43 2013
@@ -315,4 +315,9 @@ public interface Store extends HeapSize,
    * @param o Observer no longer interested in changes in set of Readers.
    */
   public void deleteChangedReaderObserver(ChangedReadersObserver o);
-}
+
+  /**
+   * @return Whether this store has too many store files.
+   */
+  public boolean hasTooManyStoreFiles();
+}
\ No newline at end of file



Mime
View raw message