HBASE-8004. Creating an existing table from Shell does not throw TableExistsException (Jeffrey Zhong)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1454222 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2013-03-08 02:56:10 +00:00
parent e687c3bf24
commit a584f3de87
3 changed files with 5 additions and 5 deletions

View File

@ -379,7 +379,7 @@ def loadRegions(options, hostname)
begin begin
isSuccessfulScan(admin, r) isSuccessfulScan(admin, r)
exists = true exists = true
rescue org.apache.hadoop.hbase.NotServingRegionException => e rescue org.apache.hadoop.hbase.exceptions.NotServingRegionException => e
$LOG.info("Failed scan of " + e.message) $LOG.info("Failed scan of " + e.message)
end end
count = count + 1 count = count + 1

View File

@ -47,7 +47,7 @@ require 'java'
import org.apache.hadoop.hbase.HBaseConfiguration import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.HConstants import org.apache.hadoop.hbase.HConstants
import org.apache.hadoop.hbase.MasterNotRunningException import org.apache.hadoop.hbase.exceptions.MasterNotRunningException
import org.apache.hadoop.hbase.client.HBaseAdmin import org.apache.hadoop.hbase.client.HBaseAdmin
import org.apache.hadoop.hbase.client.HTable import org.apache.hadoop.hbase.client.HTable
import org.apache.hadoop.hbase.client.Scan import org.apache.hadoop.hbase.client.Scan

View File

@ -81,12 +81,12 @@ module Shell
def translate_hbase_exceptions(*args) def translate_hbase_exceptions(*args)
yield yield
rescue org.apache.hadoop.hbase.TableNotFoundException rescue org.apache.hadoop.hbase.exceptions.TableNotFoundException
raise "Unknown table #{args.first}!" raise "Unknown table #{args.first}!"
rescue org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException rescue org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException
valid_cols = table(args.first).get_all_columns.map { |c| c + '*' } valid_cols = table(args.first).get_all_columns.map { |c| c + '*' }
raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}" raise "Unknown column family! Valid column names: #{valid_cols.join(", ")}"
rescue org.apache.hadoop.hbase.TableExistsException rescue org.apache.hadoop.hbase.exceptions.TableExistsException
raise "Table already exists: #{args.first}!" raise "Table already exists: #{args.first}!"
end end
end end