HBASE-26923 PerformanceEvaluation support encryption option (#4489)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit b7065c1cf5)

Conflicts:
	hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
This commit is contained in:
wenwj0 2022-06-11 20:10:25 +08:00 committed by Duo Zhang
parent c8f3c384ae
commit 824b7295e8
1 changed files with 18 additions and 0 deletions

View File

@ -408,6 +408,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
HColumnDescriptor familyDesc = new HColumnDescriptor(familyName);
familyDesc.setDataBlockEncoding(opts.blockEncoding);
familyDesc.setCompressionType(opts.compression);
familyDesc.setEncryptionType(opts.encryption);
familyDesc.setBloomFilterType(opts.bloomType);
familyDesc.setBlocksize(opts.blockSize);
if (opts.inMemoryCF) {
@ -696,6 +697,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
int replicas = HTableDescriptor.DEFAULT_REGION_REPLICATION;
String splitPolicy = null;
Compression.Algorithm compression = Compression.Algorithm.NONE;
String encryption = null;
BloomType bloomType = BloomType.ROW;
int blockSize = HConstants.DEFAULT_BLOCKSIZE;
DataBlockEncoding blockEncoding = DataBlockEncoding.NONE;
@ -751,6 +753,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
this.replicas = that.replicas;
this.splitPolicy = that.splitPolicy;
this.compression = that.compression;
this.encryption = that.encryption;
this.blockEncoding = that.blockEncoding;
this.filterAll = that.filterAll;
this.bloomType = that.bloomType;
@ -940,6 +943,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
this.compression = compression;
}
public void setEncryption(String encryption) {
this.encryption = encryption;
}
public void setBloomType(BloomType bloomType) {
this.bloomType = bloomType;
}
@ -1052,6 +1059,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
return compression;
}
public String getEncryption() {
return encryption;
}
public DataBlockEncoding getBlockEncoding() {
return blockEncoding;
}
@ -2616,6 +2627,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
+ " use size to specify the end range and --rows"
+ " specifies the number of rows within that range. " + "Default: 1.0.");
System.err.println(" compress Compression type to use (GZ, LZO, ...). Default: 'NONE'");
System.err.println(" encryption Encryption type to use (AES, ...). Default: 'NONE'");
System.err.println(
" flushCommits Used to determine if the test should flush the table. " + "Default: false");
System.err.println(" valueZipf Set if we should vary value size between 0 and "
@ -2741,6 +2753,12 @@ public class PerformanceEvaluation extends Configured implements Tool {
continue;
}
final String encryption = "--encryption=";
if (cmd.startsWith(encryption)) {
opts.encryption = cmd.substring(encryption.length());
continue;
}
final String traceRate = "--traceRate=";
if (cmd.startsWith(traceRate)) {
opts.traceRate = Double.parseDouble(cmd.substring(traceRate.length()));