You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2016/12/04 22:35:39 UTC

hbase git commit: HBASE-17116 [PerformanceEvaluation] Add option to configure block size (Yi Liang)

Repository: hbase
Updated Branches:
  refs/heads/0.98 6ea27ebed -> 5e58f2575


HBASE-17116 [PerformanceEvaluation] Add option to configure block size (Yi Liang)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5e58f257
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5e58f257
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5e58f257

Branch: refs/heads/0.98
Commit: 5e58f25759b521d23e44fd6c02b448f2e198a0d7
Parents: 6ea27eb
Author: Jerry He <je...@apache.org>
Authored: Sun Nov 27 19:04:32 2016 -0800
Committer: Andrew Purtell <ap...@apache.org>
Committed: Sun Dec 4 14:35:56 2016 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hbase/PerformanceEvaluation.java | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5e58f257/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 2b462c9..eb0e32f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -367,6 +367,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
     family.setDataBlockEncoding(opts.blockEncoding);
     family.setCompressionType(opts.compression);
     family.setBloomFilterType(opts.bloomType);
+    family.setBlocksize(opts.blockSize);
     if (opts.inMemoryCF) {
       family.setInMemory(true);
     }
@@ -599,6 +600,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
     String splitPolicy = null;
     Compression.Algorithm compression = Compression.Algorithm.NONE;
     BloomType bloomType = BloomType.ROW;
+    int blockSize = HConstants.DEFAULT_BLOCKSIZE;
     DataBlockEncoding blockEncoding = DataBlockEncoding.NONE;
     boolean valueRandom = false;
     boolean valueZipf = false;
@@ -640,6 +642,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.blockEncoding = that.blockEncoding;
       this.filterAll = that.filterAll;
       this.bloomType = that.bloomType;
+      this.blockSize = that.blockSize;
       this.valueRandom = that.valueRandom;
       this.valueZipf = that.valueZipf;
       this.valueSize = that.valueSize;
@@ -786,6 +789,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.bloomType = bloomType;
     }
 
+    public void setBlockSize(int blockSize) {
+      this.blockSize = blockSize;
+    }
+
     public void setBlockEncoding(DataBlockEncoding blockEncoding) {
       this.blockEncoding = blockEncoding;
     }
@@ -902,6 +909,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
       return bloomType;
     }
 
+    public int getBlockSize() {
+      return blockSize;
+    }
+
     public boolean isOneCon() {
       return oneCon;
     }
@@ -1789,6 +1800,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
         "Default: opts.perClientRunRows / 10 = " + DEFAULT_OPTS.getPerClientRunRows()/10);
     System.err.println(" multiGet        Batch gets together into groups of N. Only supported " +
         "by randomRead. Default: disabled");
+    System.err.println(" blockSize       Blocksize to use when writing out hfiles. ");
     System.err.println(" addColumns      Adds columns to scans/gets explicitly. Default: true");
     System.err.println(" splitPolicy     Specify a custom RegionSplitPolicy for the table.");
     System.err.println(" randomSleep     Do a random sleep before each get between 0 and entered value. Defaults: 0");
@@ -1970,6 +1982,11 @@ public class PerformanceEvaluation extends Configured implements Tool {
         continue;
       }
 
+      final String blockSize = "--blockSize=";
+      if(cmd.startsWith(blockSize) ) {
+        opts.blockSize = Integer.parseInt(cmd.substring(blockSize.length()));
+      }
+
       final String valueSize = "--valueSize=";
       if (cmd.startsWith(valueSize)) {
         opts.valueSize = Integer.parseInt(cmd.substring(valueSize.length()));