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

This commit is contained in:
Jerry He 2016-11-27 19:04:32 -08:00
parent 8204337b5d
commit 4771c217cd
1 changed files with 18 additions and 1 deletions

View File

@ -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;
}
@ -1883,6 +1894,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
"from memory. Default: false");
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()));