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:
parent
e687c3bf24
commit
a584f3de87
|
@ -379,7 +379,7 @@ def loadRegions(options, hostname)
|
|||
begin
|
||||
isSuccessfulScan(admin, r)
|
||||
exists = true
|
||||
rescue org.apache.hadoop.hbase.NotServingRegionException => e
|
||||
rescue org.apache.hadoop.hbase.exceptions.NotServingRegionException => e
|
||||
$LOG.info("Failed scan of " + e.message)
|
||||
end
|
||||
count = count + 1
|
||||
|
|
|
@ -47,7 +47,7 @@ require 'java'
|
|||
|
||||
import org.apache.hadoop.hbase.HBaseConfiguration
|
||||
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.HTable
|
||||
import org.apache.hadoop.hbase.client.Scan
|
||||
|
|
|
@ -81,12 +81,12 @@ module Shell
|
|||
|
||||
def translate_hbase_exceptions(*args)
|
||||
yield
|
||||
rescue org.apache.hadoop.hbase.TableNotFoundException
|
||||
rescue org.apache.hadoop.hbase.exceptions.TableNotFoundException
|
||||
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 + '*' }
|
||||
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}!"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue