hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13327 Addendum replaced the nested try with a cast of getAdmin() to HBaseAdmin and a call to the original compact/majorCompact method (Solomon)
Date Fri, 27 Mar 2015 01:01:33 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 18256fc95 -> 306c44156


HBASE-13327 Addendum replaced the nested try with a cast of getAdmin() to HBaseAdmin and a
call to the original compact/majorCompact method (Solomon)


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

Branch: refs/heads/master
Commit: 306c44156a0f8248f9271d03000244182cecb3ae
Parents: 18256fc
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Mar 26 18:01:21 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Mar 26 18:01:21 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/thrift/ThriftServerRunner.java | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/306c4415/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 285d369..9309c20 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -66,6 +66,7 @@ import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Increment;
 import org.apache.hadoop.hbase.client.OperationWithAttributes;
@@ -778,13 +779,11 @@ public class ThriftServerRunner implements Runnable {
 
     @Override
     public void compact(ByteBuffer tableNameOrRegionName) throws IOError {
-      byte[] tableNameOrRegionNameArray = getBytes(tableNameOrRegionName);
       try {
-        try {
-          getAdmin().compactRegion(tableNameOrRegionNameArray);
-        } catch (IllegalArgumentException e) {
-          getAdmin().compact(TableName.valueOf(tableNameOrRegionNameArray));
-        }
+        // TODO: HBaseAdmin.compact(byte[]) deprecated and not trivial to replace here.
+        // ThriftServerRunner.compact should be deprecated and replaced with methods specific
to
+        // table and region.
+        ((HBaseAdmin) getAdmin()).compact(getBytes(tableNameOrRegionName));
       } catch (IOException e) {
         LOG.warn(e.getMessage(), e);
         throw new IOError(e.getMessage());
@@ -793,13 +792,11 @@ public class ThriftServerRunner implements Runnable {
 
     @Override
     public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError {
-      byte[] tableNameOrRegionNameArray = getBytes(tableNameOrRegionName);
       try {
-        try {
-          getAdmin().majorCompactRegion(tableNameOrRegionNameArray);
-        } catch (IllegalArgumentException e) {
-          getAdmin().majorCompact(TableName.valueOf(tableNameOrRegionNameArray));
-        }
+        // TODO: HBaseAdmin.majorCompact(byte[]) deprecated and not trivial to replace here.
+        // ThriftServerRunner.majorCompact should be deprecated and replaced with methods
specific
+        // to table and region.
+        ((HBaseAdmin) getAdmin()).majorCompact(getBytes(tableNameOrRegionName));
       } catch (IOException e) {
         LOG.warn(e.getMessage(), e);
         throw new IOError(e.getMessage());


Mime
View raw message