hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1394274 - in /hbase/trunk/hbase-server/src: main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java test/ruby/hbase/admin_test.rb
Date Thu, 04 Oct 2012 21:18:05 GMT
Author: jdcryans
Date: Thu Oct  4 21:18:04 2012
New Revision: 1394274

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

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/trunk/hbase-server/src/test/ruby/hbase/admin_test.rb

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1394274&r1=1394273&r2=1394274&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Thu Oct  4 21:18:04 2012
@@ -1105,16 +1105,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());
         }
@@ -1223,8 +1223,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());
         }
@@ -1333,8 +1332,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);
         }
@@ -1615,8 +1613,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);
         }
@@ -1976,8 +1973,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();
           AdminProtocol admin =

Modified: hbase/trunk/hbase-server/src/test/ruby/hbase/admin_test.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/ruby/hbase/admin_test.rb?rev=1394274&r1=1394273&r2=1394274&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/ruby/hbase/admin_test.rb (original)
+++ hbase/trunk/hbase-server/src/test/ruby/hbase/admin_test.rb Thu Oct  4 21:18:04 2012
@@ -163,17 +163,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.')



Mime
View raw message