hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1507881 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Date Mon, 29 Jul 2013 01:53:50 GMT
Author: tedyu
Date: Mon Jul 29 01:53:50 2013
New Revision: 1507881

URL: http://svn.apache.org/r1507881
Log:
HBASE-9055 HBaseAdmin#isTableEnabled() should return false for non-existent table (Ted Yu)


Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java?rev=1507881&r1=1507880&r2=1507881&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java
Mon Jul 29 01:53:50 2013
@@ -141,7 +141,7 @@ public class ZKTableReadOnly {
   throws KeeperException {
     String znode = ZKUtil.joinZNode(zkw.tableZNode, child);
     byte [] data = ZKUtil.getData(zkw, znode);
-    if (data == null || data.length <= 0) return ZooKeeperProtos.Table.State.ENABLED;
+    if (data == null || data.length <= 0) return null;
     try {
       ProtobufUtil.expectPBMagicPrefix(data);
       ZooKeeperProtos.Table.Builder builder = ZooKeeperProtos.Table.newBuilder();

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1507881&r1=1507880&r2=1507881&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Mon
Jul 29 01:53:50 2013
@@ -366,7 +366,16 @@ public class TestAdmin {
            assertTrue(exceptionThrown);
        }
    }
-  /**
+  
+  @Test
+  public void testIsEnabledOnNonexistentTable() throws IOException {
+    try {
+      assertFalse(admin.isTableEnabled(Bytes.toBytes("non-existing")));
+    } catch (IOException e) {
+    }
+  }
+   
+    /**
    * Verify schema modification takes.
    * @throws IOException
    * @throws InterruptedException



Mime
View raw message