You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/08/03 00:14:33 UTC

hbase git commit: HBASE-18102 Purge close_region command that allows by-pass of Master

Repository: hbase
Updated Branches:
  refs/heads/master de696cf6b -> 71151eb0e


HBASE-18102 Purge close_region command that allows by-pass of Master

Change-Id: I67e3f74e16706043056bac73bc1ff3a713d0e977


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

Branch: refs/heads/master
Commit: 71151eb0e9951830bc6d8a12d0d1629457d3ec73
Parents: de696cf
Author: Apekshit Sharma <ap...@apache.org>
Authored: Mon Jul 31 19:22:33 2017 -0700
Committer: Apekshit Sharma <ap...@apache.org>
Committed: Wed Aug 2 17:09:32 2017 -0700

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/admin.rb        | 18 ------------
 .../main/ruby/shell/commands/close_region.rb    | 30 +++-----------------
 hbase-shell/src/test/ruby/hbase/admin_test.rb   | 10 ++-----
 3 files changed, 7 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/71151eb0/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index d7c2739..4b0de5f 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -429,18 +429,6 @@ module Hbase
     end
 
     #----------------------------------------------------------------------------------------------
-    # Closes a region.
-    # If server name is nil, we presume region_name is full region name (HRegionInfo.getRegionName).
-    # If server name is not nil, we presume it is the region's encoded name (HRegionInfo.getEncodedName)
-    def close_region(region_name, server)
-      if region_name.end_with? '.'
-        @admin.closeRegion(region_name, server)
-      else
-        closeEncodedRegion?(region_name, server)
-      end
-    end
-
-    #----------------------------------------------------------------------------------------------
     #----------------------------------------------------------------------------------------------
     # Assign a region
     def assign(region_name)
@@ -837,12 +825,6 @@ module Hbase
     end
 
     #----------------------------------------------------------------------------------------------
-    # Is supplied region name is encoded region name
-    def closeEncodedRegion?(region_name, server)
-      @admin.closeRegionWithEncodedRegionName(region_name, server)
-    end
-
-    #----------------------------------------------------------------------------------------------
     # Return a new HColumnDescriptor made of passed args
     def hcd(arg, htd)
       # String arg, single parameter constructor

http://git-wip-us.apache.org/repos/asf/hbase/blob/71151eb0/hbase-shell/src/main/ruby/shell/commands/close_region.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands/close_region.rb b/hbase-shell/src/main/ruby/shell/commands/close_region.rb
index e33dd79..96450a7 100644
--- a/hbase-shell/src/main/ruby/shell/commands/close_region.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/close_region.rb
@@ -22,36 +22,14 @@ module Shell
     class CloseRegion < Command
       def help
         <<-EOF
-Close a single region.  Ask the master to close a region out on the cluster
-or if 'SERVER_NAME' is supplied, ask the designated hosting regionserver to
-close the region directly.  Closing a region, the master expects 'REGIONNAME'
-to be a fully qualified region name.  When asking the hosting regionserver to
-directly close a region, you pass the regions' encoded name only. A region
-name looks like this:
-
- TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
-or
- Namespace:TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
-
-The trailing period is part of the regionserver name. A region's encoded name
-is the hash at the end of a region name; e.g. 527db22f95c8a9e0116f0cc13c680396
-(without the period).  A 'SERVER_NAME' is its host, port plus startcode. For
-example: host187.example.com,60020,1289493121758 (find servername in master ui
-or when you do detailed status in shell).  This command will end up running
-close on the region hosting regionserver.  The close is done without the
-master's involvement (It will not know of the close).  Once closed, region will
-stay closed.  Use assign to reopen/reassign.  Use unassign or move to assign
-the region elsewhere on cluster. Use with caution.  For experts only.
-Examples:
-
-  hbase> close_region 'REGIONNAME'
-  hbase> close_region 'REGIONNAME', 'SERVER_NAME'
-  hbase> close_region 'ENCODED_REGIONNAME', 'SERVER_NAME'
+---------------------------------------------
+DEPRECATED!!! Use 'unassign' command instead.
+---------------------------------------------
 EOF
       end
 
       def command(region_name, server = nil)
-        admin.close_region(region_name, server)
+        puts "DEPRECATED!!! Use 'unassign' command instead."
       end
     end
   end

http://git-wip-us.apache.org/repos/asf/hbase/blob/71151eb0/hbase-shell/src/test/ruby/hbase/admin_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index 025b737..6a75886 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -334,17 +334,13 @@ module Hbase
       shutdown
     end
 
-    define_test "close_region should allow encoded & non-encoded region names" do
+    define_test "unassign should allow encoded & non-encoded region names" do
       region = command(:locate_region, @test_name, '')
-      serverName = region.getServerName().getServerName()
       regionName = region.getRegionInfo().getRegionNameAsString()
       encodedRegionName = region.getRegionInfo().getEncodedName()
 
-      # Close region with just region name.
-      command(:close_region, regionName, nil)
-      # Close region with region name and server.
-      command(:close_region, regionName, serverName)
-      command(:close_region, encodedRegionName, serverName)
+      command(:unassign, regionName, true)
+      command(:unassign, encodedRegionName, true)
     end
   end