hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1301789 - /hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb
Date Fri, 16 Mar 2012 22:08:38 GMT
Author: mbautin
Date: Fri Mar 16 22:08:37 2012
New Revision: 1301789

URL: http://svn.apache.org/viewvc?rev=1301789&view=rev
Log:
[jira] [HBASE-5581] [89-fb] Creating a table with invalid syntax does not give an error message
when it fails

Summary:
Creating a table with invalid syntax does not give an error message when it
fails. In this case, it doesn't actually create the CF requested, but doesn't
give any indication to the user that it failed. Throw an error in case of
invalid table creation syntax.

Fix a typo in the error message when NUMREGIONS <= 1.

Test Plan:
Try to create a table with an invalid command as follows -
create 'test', {NAME => 'test', VERSIONS => 1, BLOCKCACHE => true, NUMREGIONS =>
20, SPLITALGO => "HexStringSplit", COMPRESSION => 'LZO', BLOOMFILTER => 'ROW'}

This should report an error.

Verify that the table is created correctly when the column family configuration
is specified in a separate clause as shown below

create 'test', {NAME => 'test', VERSIONS => 1, BLOCKCACHE => true, COMPRESSION
=> 'LZO', BLOOMFILTER => 'ROW'}, {NUMREGIONS => 20, SPLITALGO =>
"HexStringSplit"}

Reviewers: kannan

Reviewed By: kannan

Differential Revision: https://reviews.facebook.net/D2343

Modified:
    hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb

Modified: hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb?rev=1301789&r1=1301788&r2=1301789&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb (original)
+++ hbase/branches/0.89-fb/src/main/ruby/hbase/admin.rb Fri Mar 16 22:08:37 2012
@@ -160,9 +160,10 @@ module Hbase
         end
 
         if arg.kind_of?(Hash) and (arg.has_key?(NUMREGIONS) or arg.has_key?(SPLITALGO))
+          raise(ArgumentError, "Column family configuration should be specified in a separate
clause") if arg.has_key?(NAME)
           raise(ArgumentError, "Number of regions must be specified") unless arg.has_key?(NUMREGIONS)
           raise(ArgumentError, "Split algorithm must be specified") unless arg.has_key?(SPLITALGO)
-          raise(ArgumentError, "Number of regions must be geter than 1") unless arg[NUMREGIONS]
> 1
+          raise(ArgumentError, "Number of regions must be greater than 1") unless arg[NUMREGIONS]
> 1
           num_regions = arg[NUMREGIONS]
           split_algo = RegionSplitter.newSplitAlgoInstance(@conf, arg[SPLITALGO])
         else



Mime
View raw message