hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1452514 - in /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver: ./ compactions/
Date Mon, 04 Mar 2013 20:56:02 GMT
Author: sershe
Date: Mon Mar  4 20:56:02 2013
New Revision: 1452514

URL: http://svn.apache.org/r1452514
Log:
HBASE-7964 requestCompaction priority argument is not used (except for user compaction check)

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreEngine.java
    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/Store.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileManager.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionConfiguration.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionPolicy.java
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactionPolicy.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreEngine.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreEngine.java?rev=1452514&r1=1452513&r2=1452514&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreEngine.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreEngine.java
Mon Mar  4 20:56:02 2013
@@ -46,7 +46,7 @@ public class DefaultStoreEngine extends 
 
   @Override
   protected void createComponents() {
-    storeFileManager = new DefaultStoreFileManager(this.comparator);
+    storeFileManager = new DefaultStoreFileManager(this.comparator, this.conf);
 
     // TODO: compactor and policy may be separately pluggable, but must derive from default
ones.
     compactor = new DefaultCompactor(this.conf, this.store);

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=1452514&r1=1452513&r2=1452514&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  4 20:56:02 2013
@@ -28,6 +28,7 @@ import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.KVComparator;
 
@@ -43,6 +44,7 @@ class DefaultStoreFileManager implements
   static final Log LOG = LogFactory.getLog(DefaultStoreFileManager.class);
 
   private final KVComparator kvComparator;
+  private final Configuration conf;
 
   /**
    * List of store files inside this store. This is an immutable list that
@@ -50,8 +52,9 @@ class DefaultStoreFileManager implements
    */
   private volatile ImmutableList<StoreFile> storefiles = null;
 
-  public DefaultStoreFileManager(KVComparator kvComparator) {
+  public DefaultStoreFileManager(KVComparator kvComparator, Configuration conf) {
     this.kvComparator = kvComparator;
+    this.conf = conf;
   }
 
   @Override
@@ -124,9 +127,17 @@ class DefaultStoreFileManager implements
     return getStorefiles();
   }
 
+  @Override
+  public int getStoreCompactionPriority() {
+    int blockingFileCount = conf.getInt(
+        "hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
+    return blockingFileCount - storefiles.size();
+  }
+
   private void sortAndSetStoreFiles(List<StoreFile> storeFiles) {
     Collections.sort(storeFiles, StoreFile.Comparators.SEQ_ID);
     storefiles = ImmutableList.copyOf(storeFiles);
   }
+
 }
 

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=1452514&r1=1452513&r2=1452514&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  4 20:56:02 2013
@@ -1324,7 +1324,9 @@ public class HStore implements Store {
         this.forceMajor = this.forceMajor && !isMajor;
 
         // Set common request properties.
-        compaction.getRequest().setPriority(getCompactPriority(priority));
+        // Set priority, either override value supplied by caller or from store.
+        compaction.getRequest().setPriority(
+            (priority != Store.NO_PRIORITY) ? priority : getCompactPriority());
         compaction.getRequest().setIsMajor(isMajor);
         compaction.getRequest().setDescription(
             region.getRegionNameAsString(), getColumnFamilyName());
@@ -1755,18 +1757,9 @@ public class HStore implements Store {
     return this.memstore.heapSize();
   }
 
-  public int getCompactPriority() {
-    return getCompactPriority(Store.NO_PRIORITY);
-  }
-
   @Override
-  public int getCompactPriority(int priority) {
-    // If this is a user-requested compaction, leave this at the user priority
-    if (priority != Store.PRIORITY_USER) {
-      priority = this.compactionPolicy.getSystemCompactionPriority(
-        this.storeFileManager.getStorefiles());
-    }
-    return priority;
+  public int getCompactPriority() {
+    return this.storeFileManager.getStoreCompactionPriority();
   }
 
   @Override

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=1452514&r1=1452513&r2=1452514&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  4 20:56:02 2013
@@ -182,13 +182,6 @@ public interface Store extends HeapSize,
 
   public int getCompactPriority();
 
-  /**
-   * @param priority priority to check against. When priority is {@link Store#PRIORITY_USER},
-   *          {@link Store#PRIORITY_USER} is returned.
-   * @return The priority that this store has in the compaction queue.
-   */
-  public int getCompactPriority(int priority);
-
   public StoreFlusher getStoreFlusher(long cacheFlushId);
 
   // Split oriented methods

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileManager.java?rev=1452514&r1=1452513&r2=1452514&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileManager.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileManager.java
Mon Mar  4 20:56:02 2013
@@ -119,4 +119,9 @@ public interface StoreFileManager {
    * @throws IOException
    */
   public abstract byte[] getSplitPoint() throws IOException;
+
+  /**
+   * @return The store compaction priority.
+   */
+  public abstract int getStoreCompactionPriority();
 }

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionConfiguration.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionConfiguration.java?rev=1452514&r1=1452513&r2=1452514&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionConfiguration.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionConfiguration.java
Mon Mar  4 20:56:02 2013
@@ -62,7 +62,6 @@ public class CompactionConfiguration {
   boolean shouldDeleteExpired;
   long majorCompactionPeriod;
   float majorCompactionJitter;
-  int blockingStoreFileCount;
 
   CompactionConfiguration(Configuration conf, StoreConfigInformation storeConfigInfo) {
     this.conf = conf;
@@ -82,8 +81,6 @@ public class CompactionConfiguration {
     shouldDeleteExpired = conf.getBoolean("hbase.store.delete.expired.storefile", true);
     majorCompactionPeriod = conf.getLong(HConstants.MAJOR_COMPACTION_PERIOD, 1000*60*60*24);
     majorCompactionJitter = conf.getFloat("hbase.hregion.majorcompaction.jitter", 0.20F);
-    blockingStoreFileCount =
-        conf.getInt("hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
 
     LOG.info("Compaction configuration " + this.toString());
   }
@@ -106,13 +103,6 @@ public class CompactionConfiguration {
   }
 
   /**
-   * @return store file count that will cause the memstore of this store to be blocked.
-   */
-  int getBlockingStorefileCount() {
-    return this.blockingStoreFileCount;
-  }
-
-  /**
    * @return lower bound below which compaction is selected without ratio test
    */
   long getMinCompactSize() {

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionPolicy.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionPolicy.java?rev=1452514&r1=1452513&r2=1452514&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionPolicy.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionPolicy.java
Mon Mar  4 20:56:02 2013
@@ -43,16 +43,6 @@ public abstract class CompactionPolicy {
   }
 
   /**
-   * @param storeFiles Store files in the store.
-   * @return The system compaction priority of the store, based on storeFiles.
-   *         The priority range is as such - the smaller values are higher priority;
-   *         1 is user priority; only very important, blocking compactions should use
-   *         values lower than that. With default settings, depending on the number of
-   *         store files, the non-blocking priority will be in 2-6 range.
-   */
-  public abstract int getSystemCompactionPriority(final Collection<StoreFile> storeFiles);
-
-  /**
    * @param filesToCompact Files to compact. Can be null.
    * @return True if we should run a major compaction.
    */

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactionPolicy.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactionPolicy.java?rev=1452514&r1=1452513&r2=1452514&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactionPolicy.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactionPolicy.java
Mon Mar  4 20:56:02 2013
@@ -57,7 +57,6 @@ public class DefaultCompactionPolicy ext
     super(conf, storeConfigInfo);
   }
 
-
   private ArrayList<StoreFile> getCurrentEligibleFiles(
       ArrayList<StoreFile> candidateFiles, final List<StoreFile> filesCompacting)
{
     // candidates = all storefiles not already in compaction queue
@@ -77,11 +76,6 @@ public class DefaultCompactionPolicy ext
     return getCurrentEligibleFiles(new ArrayList<StoreFile>(candidates), filesCompacting);
   }
 
-  @Override
-  public int getSystemCompactionPriority(final Collection<StoreFile> storeFiles) {
-    return this.comConf.getBlockingStorefileCount() - storeFiles.size();
-  }
-
   /**
    * @param candidateFiles candidate files, ordered from oldest to newest
    * @return subset copy of candidate list that meets compaction criteria



Mime
View raw message