@@ -415,6 +415,7 @@ protected static TableDescriptor getTableDescriptor(TestOptions opts) {
415415        ColumnFamilyDescriptorBuilder .newBuilder (familyName );
416416      cfBuilder .setDataBlockEncoding (opts .blockEncoding );
417417      cfBuilder .setCompressionType (opts .compression );
418+       cfBuilder .setEncryptionType (opts .encryption );
418419      cfBuilder .setBloomFilterType (opts .bloomType );
419420      cfBuilder .setBlocksize (opts .blockSize );
420421      if  (opts .inMemoryCF ) {
@@ -707,6 +708,7 @@ static class TestOptions {
707708    int  replicas  = TableDescriptorBuilder .DEFAULT_REGION_REPLICATION ;
708709    String  splitPolicy  = null ;
709710    Compression .Algorithm  compression  = Compression .Algorithm .NONE ;
711+     String  encryption  = null ;
710712    BloomType  bloomType  = BloomType .ROW ;
711713    int  blockSize  = HConstants .DEFAULT_BLOCKSIZE ;
712714    DataBlockEncoding  blockEncoding  = DataBlockEncoding .NONE ;
@@ -762,6 +764,7 @@ public TestOptions(TestOptions that) {
762764      this .replicas  = that .replicas ;
763765      this .splitPolicy  = that .splitPolicy ;
764766      this .compression  = that .compression ;
767+       this .encryption  = that .encryption ;
765768      this .blockEncoding  = that .blockEncoding ;
766769      this .filterAll  = that .filterAll ;
767770      this .bloomType  = that .bloomType ;
@@ -951,6 +954,10 @@ public void setCompression(Compression.Algorithm compression) {
951954      this .compression  = compression ;
952955    }
953956
957+     public  void  setEncryption (String  encryption ) {
958+       this .encryption  = encryption ;
959+     }
960+ 
954961    public  void  setBloomType (BloomType  bloomType ) {
955962      this .bloomType  = bloomType ;
956963    }
@@ -1063,6 +1070,10 @@ public Compression.Algorithm getCompression() {
10631070      return  compression ;
10641071    }
10651072
1073+     public  String  getEncryption () {
1074+       return  encryption ;
1075+     }
1076+ 
10661077    public  DataBlockEncoding  getBlockEncoding () {
10671078      return  blockEncoding ;
10681079    }
@@ -2617,6 +2628,7 @@ protected static void printUsage(final String shortName, final String message) {
26172628        + " use size to specify the end range and --rows" 
26182629        + " specifies the number of rows within that range. "  + "Default: 1.0." );
26192630    System .err .println (" compress        Compression type to use (GZ, LZO, ...). Default: 'NONE'" );
2631+     System .err .println (" encryption      Encryption type to use (AES, ...). Default: 'NONE'" );
26202632    System .err .println (
26212633      " flushCommits    Used to determine if the test should flush the table. "  + "Default: false" );
26222634    System .err .println (" valueZipf       Set if we should vary value size between 0 and " 
@@ -2742,6 +2754,12 @@ static TestOptions parseOpts(Queue<String> args) {
27422754        continue ;
27432755      }
27442756
2757+       final  String  encryption  = "--encryption=" ;
2758+       if  (cmd .startsWith (encryption )) {
2759+         opts .encryption  = cmd .substring (encryption .length ());
2760+         continue ;
2761+       }
2762+ 
27452763      final  String  traceRate  = "--traceRate=" ;
27462764      if  (cmd .startsWith (traceRate )) {
27472765        opts .traceRate  = Double .parseDouble (cmd .substring (traceRate .length ()));
0 commit comments