You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2022/06/11 13:39:24 UTC

[hbase] branch branch-2.4 updated: HBASE-26923 PerformanceEvaluation support encryption option (#4489)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 824b7295e8e HBASE-26923 PerformanceEvaluation support encryption option (#4489)
824b7295e8e is described below

commit 824b7295e8e2493fc368755d16a919fc6ef0edce
Author: wenwj0 <36...@users.noreply.github.com>
AuthorDate: Sat Jun 11 20:10:25 2022 +0800

    HBASE-26923 PerformanceEvaluation support encryption option (#4489)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit b7065c1cf5297074e79e5c58b3ee1ba5fd1a7f55)
    
    Conflicts:
            hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
---
 .../org/apache/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 aed38bfdde2..af2ff6b6e13 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
@@ -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()));