hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-18832 Fixed LTT, removed references to deprecated HColumnDescriptor
Date Mon, 18 Sep 2017 20:10:20 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 a66f9dcda -> 00d9e3847


HBASE-18832 Fixed LTT, removed references to deprecated HColumnDescriptor

Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/00d9e384
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/00d9e384
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/00d9e384

Branch: refs/heads/branch-2
Commit: 00d9e38479890bb58d2aafd9b373458e0650e4f4
Parents: a66f9dc
Author: Umesh Agashe <uagashe@cloudera.com>
Authored: Mon Sep 18 11:12:10 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Mon Sep 18 13:10:07 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/util/LoadTestTool.java  | 40 ++++++++++----------
 1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/00d9e384/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
index 0cbcb5f..56dc5c7 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
-import java.util.Random;
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.crypto.spec.SecretKeySpec;
@@ -36,9 +35,10 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
@@ -258,46 +258,46 @@ public class LoadTestTool extends AbstractHBaseTool {
       byte[][] columnFamilies) throws IOException {
     try (Connection conn = ConnectionFactory.createConnection(conf);
         Admin admin = conn.getAdmin()) {
-      TableDescriptor tableDesc = admin.getTableDescriptor(tableName);
+      TableDescriptor tableDesc = admin.getDescriptor(tableName);
       LOG.info("Disabling table " + tableName);
       admin.disableTable(tableName);
       for (byte[] cf : columnFamilies) {
-        HColumnDescriptor columnDesc = (HColumnDescriptor) tableDesc.getColumnFamily(cf);
+        ColumnFamilyDescriptor columnDesc = tableDesc.getColumnFamily(cf);
         boolean isNewCf = columnDesc == null;
-        if (isNewCf) {
-          columnDesc = new HColumnDescriptor(cf);
-        }
+        ColumnFamilyDescriptorBuilder columnDescBuilder = isNewCf ?
+            ColumnFamilyDescriptorBuilder.newBuilder(cf) :
+            ColumnFamilyDescriptorBuilder.newBuilder(columnDesc);
         if (bloomType != null) {
-          columnDesc.setBloomFilterType(bloomType);
+          columnDescBuilder.setBloomFilterType(bloomType);
         }
         if (compressAlgo != null) {
-          columnDesc.setCompressionType(compressAlgo);
+          columnDescBuilder.setCompressionType(compressAlgo);
         }
         if (dataBlockEncodingAlgo != null) {
-          columnDesc.setDataBlockEncoding(dataBlockEncodingAlgo);
+          columnDescBuilder.setDataBlockEncoding(dataBlockEncodingAlgo);
         }
         if (inMemoryCF) {
-          columnDesc.setInMemory(inMemoryCF);
+          columnDescBuilder.setInMemory(inMemoryCF);
         }
         if (cipher != null) {
           byte[] keyBytes = new byte[cipher.getKeyLength()];
           new SecureRandom().nextBytes(keyBytes);
-          columnDesc.setEncryptionType(cipher.getName());
-          columnDesc.setEncryptionKey(
+          columnDescBuilder.setEncryptionType(cipher.getName());
+          columnDescBuilder.setEncryptionKey(
               EncryptionUtil.wrapKey(conf,
                   User.getCurrent().getShortName(),
                   new SecretKeySpec(keyBytes,
                       cipher.getName())));
         }
         if (mobThreshold >= 0) {
-          columnDesc.setMobEnabled(true);
-          columnDesc.setMobThreshold(mobThreshold);
+          columnDescBuilder.setMobEnabled(true);
+          columnDescBuilder.setMobThreshold(mobThreshold);
         }
 
         if (isNewCf) {
-          admin.addColumnFamily(tableName, columnDesc);
+          admin.addColumnFamily(tableName, columnDescBuilder.build());
         } else {
-          admin.modifyColumnFamily(tableName, columnDesc);
+          admin.modifyColumnFamily(tableName, columnDescBuilder.build());
         }
       }
       LOG.info("Enabling table " + tableName);
@@ -346,7 +346,7 @@ public class LoadTestTool extends AbstractHBaseTool {
         + "already exists");
 
     addOptWithArg(NUM_TABLES,
-      "A positive integer number. When a number n is speicfied, load test "
+      "A positive integer number. When a number n is specified, load test "
           + "tool  will load n table parallely. -tn parameter value becomes "
           + "table name prefix. Each table name is in format <tn>_1...<tn>_n");
 
@@ -705,7 +705,7 @@ public class LoadTestTool extends AbstractHBaseTool {
       LOG.info("Starting to mutate data...");
       System.out.println("Starting to mutate data...");
       // TODO : currently append and increment operations not tested with tags
-      // Will update this aftet it is done
+      // Will update this after it is done
       updaterThreads.start(startKey, endKey, numUpdaterThreads);
     }
 
@@ -897,7 +897,7 @@ public class LoadTestTool extends AbstractHBaseTool {
 
   private void addAuthInfoToConf(Properties authConfig, Configuration conf, String owner,
       String userList) throws IOException {
-    List<String> users = new ArrayList(Arrays.asList(userList.split(",")));
+    List<String> users = new ArrayList<>(Arrays.asList(userList.split(",")));
     users.add(owner);
     for (String user : users) {
       String keyTabFileConfKey = "hbase." + user + ".keytab.file";


Mime
View raw message