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:44 UTC

[hbase] branch branch-2 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
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 57d31224f63898cc91e30504f1fb03f2b3e89bf7
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 fe1a89ad0f0..beef9308ca6 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
@@ -406,6 +406,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) {
@@ -698,6 +699,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;
@@ -753,6 +755,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;
@@ -942,6 +945,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;
     }
@@ -1054,6 +1061,10 @@ public class PerformanceEvaluation extends Configured implements Tool {
       return compression;
     }
 
+    public String getEncryption() {
+      return encryption;
+    }
+
     public DataBlockEncoding getBlockEncoding() {
       return blockEncoding;
     }
@@ -2609,6 +2620,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 "
@@ -2734,6 +2746,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()));