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 2f35956eb8
commit 10c070825f
1 changed files with 17 additions and 0 deletions

View File

@ -374,6 +374,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);
}
@ -610,6 +611,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;
@ -652,6 +654,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;
@ -806,6 +809,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;
}
@ -922,6 +929,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
return bloomType;
}
public int getBlockSize() {
return blockSize;
}
public boolean isOneCon() {
return oneCon;
}
@ -1828,6 +1839,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(" replicas Enable region replica testing. Defaults: 1.");
System.err.println(" splitPolicy Specify a custom RegionSplitPolicy for the table.");
@ -2016,6 +2028,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()));