From 9ccf16db51a9ac0948459dbc8499ffea9b83632f Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Tue, 2 Jul 2013 22:46:25 +0000 Subject: [PATCH] HBASE-8798 Fix a minor bug in shell command with clone_snapshot table error git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1499138 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java | 2 +- hbase-server/src/main/ruby/shell/commands.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 7945e1da968..d3f84e1938b 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -2462,7 +2462,7 @@ public class HBaseAdmin implements Abortable, Closeable { public void cloneSnapshot(final String snapshotName, final String tableName) throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException { if (tableExists(tableName)) { - throw new TableExistsException("Table '" + tableName + " already exists"); + throw new TableExistsException(tableName); } internalRestoreSnapshot(snapshotName, tableName); waitUntilTableIsEnabled(Bytes.toBytes(tableName)); diff --git a/hbase-server/src/main/ruby/shell/commands.rb b/hbase-server/src/main/ruby/shell/commands.rb index fba5f1d32d6..6dc35a11ee9 100644 --- a/hbase-server/src/main/ruby/shell/commands.rb +++ b/hbase-server/src/main/ruby/shell/commands.rb @@ -86,8 +86,8 @@ module Shell rescue org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException valid_cols = table(args.first).get_all_columns.map { |c| c + '*' } raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}" - rescue org.apache.hadoop.hbase.exceptions.TableExistsException - raise "Table already exists: #{args.first}!" + rescue org.apache.hadoop.hbase.exceptions.TableExistsException => e + raise "Table already exists: #{e.message}!" end end end