From 3e4fdf018c8fe77c580e862eca9d5178fe642ce3 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 5 Apr 2022 15:45:39 +0800 Subject: [PATCH] add encryption option --- .../hadoop/hbase/PerformanceEvaluation.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java index 0a24cbe1ed..a9cddc55be 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java @@ -428,6 +428,7 @@ public class PerformanceEvaluation extends Configured implements Tool { ColumnFamilyDescriptorBuilder.newBuilder(familyName); cfBuilder.setDataBlockEncoding(opts.blockEncoding); cfBuilder.setCompressionType(opts.compression); + cfBuilder.setEncryptionType(opts.encryption); cfBuilder.setBloomFilterType(opts.bloomType); cfBuilder.setBlocksize(opts.blockSize); if (opts.inMemoryCF) { @@ -727,6 +728,7 @@ public class PerformanceEvaluation extends Configured implements Tool { int replicas = TableDescriptorBuilder.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; @@ -782,6 +784,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; @@ -971,6 +974,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; } @@ -1083,6 +1090,10 @@ public class PerformanceEvaluation extends Configured implements Tool { return compression; } + public String getEncryption() { + return encryption; + } + public DataBlockEncoding getBlockEncoding() { return blockEncoding; } @@ -2641,6 +2652,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 " + @@ -2762,6 +2774,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())); -- 2.26.2.windows.1