hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerry...@apache.org
Subject hbase git commit: HBASE-17116 [PerformanceEvaluation] Add option to configure block size (Yi Liang)
Date Mon, 28 Nov 2016 03:07:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 8204337b5 -> 4771c217c


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/4771c217
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4771c217
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4771c217

Branch: refs/heads/master
Commit: 4771c217cdcfa9daf9854635b2aa8c7ccc71cd0d
Parents: 8204337
Author: Jerry He <jerryjch@apache.org>
Authored: Sun Nov 27 19:04:32 2016 -0800
Committer: Jerry He <jerryjch@apache.org>
Committed: Sun Nov 27 19:04:32 2016 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/PerformanceEvaluation.java      | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4771c217/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 53c126d..d50bf6b 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
@@ -371,6 +371,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);
     }
@@ -625,6 +626,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;
@@ -670,6 +672,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;
@@ -834,6 +837,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;
     }
@@ -950,6 +957,10 @@ public class PerformanceEvaluation extends Configured implements Tool
{
       return bloomType;
     }
 
+    public int getBlockSize() {
+      return blockSize;
+    }
+
     public boolean isOneCon() {
       return oneCon;
     }
@@ -1881,8 +1892,9 @@ public class PerformanceEvaluation extends Configured implements Tool
{
     System.err.println(" inmemory        Tries to keep the HFiles of the CF " +
       "inmemory as far as possible. Not guaranteed that reads are always served " +
       "from memory.  Default: false");
-    System.err.println(" bloomFilter      Bloom filter type, one of "
+    System.err.println(" bloomFilter     Bloom filter type, one of "
         + Arrays.toString(BloomType.values()));
+    System.err.println(" blockSize       Blocksize to use when writing out hfiles. ");
     System.err.println(" inmemoryCompaction  Makes the column family to do inmemory flushes/compactions.
"
         + "Uses the CompactingMemstore");
     System.err.println(" addColumns      Adds columns to scans/gets explicitly. Default:
true");
@@ -2084,6 +2096,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()));


Mime
View raw message