You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2012/10/04 23:17:32 UTC

svn commit: r1394272 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java test/ruby/hbase/admin_test.rb

Author: jdcryans
Date: Thu Oct  4 21:17:32 2012
New Revision: 1394272

URL: http://svn.apache.org/viewvc?rev=1394272&view=rev
Log:
HBASE-6916  HBA logs at info level errors that won't show in the shell

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/branches/0.94/src/test/ruby/hbase/admin_test.rb

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1394272&r1=1394271&r2=1394272&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Oct  4 21:17:32 2012
@@ -1088,16 +1088,16 @@ public class HBaseAdmin implements Abort
       if (serverName != null) {
         Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
         if (pair == null || pair.getFirst() == null) {
-          LOG.info("No region in .META. for " +
-            Bytes.toStringBinary(regionname) + "; pair=" + pair);
+          throw new UnknownRegionException(Bytes.toStringBinary(regionname));
         } else {
           closeRegion(new ServerName(serverName), pair.getFirst());
         }
       } else {
         Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
-        if (pair == null || pair.getSecond() == null) {
-          LOG.info("No server in .META. for " +
-            Bytes.toStringBinary(regionname) + "; pair=" + pair);
+        if (pair == null) {
+          throw new UnknownRegionException(Bytes.toStringBinary(regionname));
+        } else if (pair.getSecond() == null) {
+          throw new NoServerForRegionException(Bytes.toStringBinary(regionname));
         } else {
           closeRegion(pair.getSecond(), pair.getFirst());
         }
@@ -1190,8 +1190,7 @@ public class HBaseAdmin implements Abort
         = getRegion(tableNameOrRegionName, ct);
       if (regionServerPair != null) {
         if (regionServerPair.getSecond() == null) {
-          LOG.info("No server in .META. for " +
-            Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
+          throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
         } else {
           flush(regionServerPair.getSecond(), regionServerPair.getFirst());
         }
@@ -1294,8 +1293,7 @@ public class HBaseAdmin implements Abort
         = getRegion(tableNameOrRegionName, ct);
       if (regionServerPair != null) {
         if (regionServerPair.getSecond() == null) {
-          LOG.info("No server in .META. for " +
-            Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
+          throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
         } else {
           compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major);
         }
@@ -1467,8 +1465,7 @@ public class HBaseAdmin implements Abort
         = getRegion(tableNameOrRegionName, ct);
       if (regionServerPair != null) {
         if (regionServerPair.getSecond() == null) {
-          LOG.info("No server in .META. for " +
-            Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
+            throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
         } else {
           split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint);
         }
@@ -1765,8 +1762,7 @@ public class HBaseAdmin implements Abort
         = getRegion(tableNameOrRegionName, ct);
       if (regionServerPair != null) {
         if (regionServerPair.getSecond() == null) {
-          LOG.info("No server in .META. for " +
-            Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
+          throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
         } else {
           ServerName sn = regionServerPair.getSecond();
           HRegionInterface rs =

Modified: hbase/branches/0.94/src/test/ruby/hbase/admin_test.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/ruby/hbase/admin_test.rb?rev=1394272&r1=1394271&r2=1394272&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/ruby/hbase/admin_test.rb (original)
+++ hbase/branches/0.94/src/test/ruby/hbase/admin_test.rb Thu Oct  4 21:17:32 2012
@@ -160,17 +160,6 @@ module Hbase
 
     #-------------------------------------------------------------------------------
 
-    define_test "close should work without region server name" do
-      if admin.exists?(@create_test_name)
-        admin.disable(@create_test_name)
-        admin.drop(@create_test_name)
-      end
-      admin.create(@create_test_name, 'foo')
-      admin.close_region(@create_test_name + ',,0', nil)
-    end
-
-    #-------------------------------------------------------------------------------
-
     define_test "describe should fail for non-existent tables" do
       assert_raise(ArgumentError) do
         admin.describe('.NOT.EXISTS.')