hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [16/50] [abbrv] hbase git commit: Revert "HBASE-14769 Removing unused functions from HBaseAdmin. Removing redundant javadocs from HBaseAdmin as they will be automatically inhertited from Admin.java. (Apekshit)" Reverting. The conversation on issues to do
Date Mon, 07 Dec 2015 16:55:53 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithMOB.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithMOB.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithMOB.java
index 13a5936..82a599c 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithMOB.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithMOB.java
@@ -121,7 +121,7 @@ public class IntegrationTestIngestWithMOB extends IntegrationTestIngest
{
       if(Arrays.equals(columnDescriptor.getName(), mobColumnFamily)) {
         columnDescriptor.setMobEnabled(true);
         columnDescriptor.setMobThreshold((long) threshold);
-        admin.modifyColumnFamily(tableName, columnDescriptor);
+        admin.modifyColumn(tableName, columnDescriptor);
       }
     }
     LOG.info("Enabling table " + getTablename());

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 5333c15..5bb25db 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -58,6 +58,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.BufferedMutator;
+import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Consistency;
@@ -2680,15 +2681,13 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility
{
 
   /**
    * Returns a Admin instance.
-   * This instance is shared between HBaseTestingUtility instance users. Closing it has no
effect,
-   * it will be closed automatically when the cluster shutdowns
+   * This instance is shared between HBaseTestingUtility instance users.
+   * Closing it has no effect, it will be closed automatically when the
+   * cluster shutdowns
    *
-   * @return HBaseAdmin instance which is guaranteed to support only {@link Admin} interface.
-   *     Functions in HBaseAdmin not provided by {@link Admin} interface can be changed/deleted
-   *     anytime.
-   * @deprecated Since 2.0. Will be removed in 3.0. Use {@link #getAdmin()} instead.
+   * @return An Admin instance.
+   * @throws IOException
    */
-  @Deprecated
   public synchronized HBaseAdmin getHBaseAdmin()
   throws IOException {
     if (hbaseAdmin == null){
@@ -2697,19 +2696,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility
{
     return hbaseAdmin;
   }
 
-  /**
-   * Returns an Admin instance which is shared between HBaseTestingUtility instance users.
-   * Closing it has no effect, it will be closed automatically when the cluster shutdowns
-   */
-  public synchronized Admin getAdmin() throws IOException {
-    if (hbaseAdmin == null){
-      this.hbaseAdmin = (HBaseAdmin) getConnection().getAdmin();
-    }
-    return hbaseAdmin;
-  }
-
   private HBaseAdmin hbaseAdmin = null;
 
+
   /**
    * Returns a ZooKeeperWatcher instance.
    * This instance is shared between HBaseTestingUtility instance users.

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
index 989192d..5450148 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
@@ -88,7 +88,7 @@ public class TestAcidGuarantees implements Tool {
       // force mob enabled such that all data is mob data
       hcd.setMobEnabled(true);
       hcd.setMobThreshold(4);
-      util.getHBaseAdmin().modifyColumnFamily(TABLE_NAME, hcd);
+      util.getHBaseAdmin().modifyColumn(TABLE_NAME, hcd);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
index e510d28..0f286b6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
@@ -465,8 +465,8 @@ public class TestAdmin2 {
         onlineRegions.contains(info));
   }
 
-  private HBaseAdmin createTable(TableName tableName) throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+  private Admin createTable(TableName tableName) throws IOException {
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     HTableDescriptor htd = new HTableDescriptor(tableName);
     HColumnDescriptor hcd = new HColumnDescriptor("value");

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
index 5e302d2..7278892 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java
@@ -400,8 +400,8 @@ public class TestMetaWithReplicas {
       }
     }
     assert(moveToServer != null);
-    TableName tableName = TableName.valueOf("randomTable5678");
-    TEST_UTIL.createTable(tableName, "f");
+    String tableName = "randomTable5678";
+    TEST_UTIL.createTable(TableName.valueOf(tableName), "f");
     assertTrue(TEST_UTIL.getHBaseAdmin().tableExists(tableName));
     TEST_UTIL.getHBaseAdmin().move(HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(),
         Bytes.toBytes(moveToServer.getServerName()));
@@ -413,8 +413,8 @@ public class TestMetaWithReplicas {
       i++;
     } while (!moveToServer.equals(currentServer) && i < 1000); //wait for 10 seconds
overall
     assert(i != 1000);
-    TEST_UTIL.getHBaseAdmin().disableTable(tableName);
-    assertTrue(TEST_UTIL.getHBaseAdmin().isTableDisabled(tableName));
+    TEST_UTIL.getHBaseAdmin().disableTable("randomTable5678");
+    assertTrue(TEST_UTIL.getHBaseAdmin().isTableDisabled("randomTable5678"));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java
index 267201f..fff6f44 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java
@@ -100,7 +100,7 @@ public class TestExpiredMobFileCleaner {
     int timeToLive = expireDays * secondsOfDay();
     hcd.setTimeToLive(timeToLive);
 
-    admin.modifyColumnFamily(tableName, hcd);
+    admin.modifyColumn(tableName, hcd);
   }
 
   private void putKVAndFlush(BufferedMutator table, byte[] row, byte[] value, long ts)

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java
index f3cfc39..e556a58 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.List;
 import java.util.Random;
 
@@ -40,6 +41,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.regionserver.Store;
+import org.apache.hadoop.hbase.regionserver.StoreFile;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -149,7 +151,7 @@ public class TestFIFOCompactionPolicy {
     TEST_UTIL.startMiniCluster(1);
 
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-TTL");
+    String tableName = this.tableName.getNameAsString()+"-TTL";
     if (admin.tableExists(tableName)) {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);
@@ -178,7 +180,7 @@ public class TestFIFOCompactionPolicy {
     TEST_UTIL.startMiniCluster(1);
 
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-MinVersion");
+    String tableName = this.tableName.getNameAsString()+"-MinVersion";
     if (admin.tableExists(tableName)) {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);
@@ -209,7 +211,7 @@ public class TestFIFOCompactionPolicy {
     TEST_UTIL.startMiniCluster(1);
 
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-BlockingStoreFiles");
+    String tableName = this.tableName.getNameAsString()+"-MinVersion";
     if (admin.tableExists(tableName)) {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/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 0b42f7c..ac201cd 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -201,7 +201,7 @@ module Hbase
     def enable(table_name)
       tableExists(table_name)
       return if enabled?(table_name)
-      @admin.enableTable(TableName.valueOf(table_name))
+      @admin.enableTable(table_name)
     end
 
     #----------------------------------------------------------------------------------------------
@@ -216,7 +216,7 @@ module Hbase
     def disable(table_name)
       tableExists(table_name)
       return if disabled?(table_name)
-      @admin.disableTable(TableName.valueOf(table_name))
+      @admin.disableTable(table_name)
     end
 
     #----------------------------------------------------------------------------------------------
@@ -235,15 +235,14 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Is table disabled?
     def disabled?(table_name)
-      @admin.isTableDisabled(TableName.valueOf(table_name))
+      @admin.isTableDisabled(table_name)
     end
 
     #----------------------------------------------------------------------------------------------
     # Drops a table
     def drop(table_name)
       tableExists(table_name)
-      raise ArgumentError, "Table #{table_name} is enabled. Disable it first." if enabled?(
-          table_name)
+      raise ArgumentError, "Table #{table_name} is enabled. Disable it first." if enabled?(table_name)
 
       @admin.deleteTable(org.apache.hadoop.hbase.TableName.valueOf(table_name))
     end
@@ -432,17 +431,15 @@ module Hbase
 
     #----------------------------------------------------------------------------------------------
     # Truncates table (deletes all records by recreating the table)
-    def truncate(table_name_str, conf = @conf)
-      table_name = TableName.valueOf(table_name_str)
-      table_description = @admin.getTableDescriptor(table_name)
-      raise ArgumentError, "Table #{table_name_str} is not enabled. Enable it first." unless
-          enabled?(table_name_str)
+    def truncate(table_name, conf = @conf)
+      table_description = @admin.getTableDescriptor(TableName.valueOf(table_name))
+      raise ArgumentError, "Table #{table_name} is not enabled. Enable it first." unless
enabled?(table_name)
       yield 'Disabling table...' if block_given?
       @admin.disableTable(table_name)
 
       begin
         yield 'Truncating table...' if block_given?
-        @admin.truncateTable(table_name, false)
+        @admin.truncateTable(org.apache.hadoop.hbase.TableName.valueOf(table_name), false)
       rescue => e
         # Handle the compatibility case, where the truncate method doesn't exists on the
Master
         raise e unless e.respond_to?(:cause) && e.cause != nil
@@ -450,7 +447,7 @@ module Hbase
         if rootCause.kind_of?(org.apache.hadoop.hbase.DoNotRetryIOException) then
           # Handle the compatibility case, where the truncate method doesn't exists on the
Master
           yield 'Dropping table...' if block_given?
-          @admin.deleteTable(table_name)
+          @admin.deleteTable(org.apache.hadoop.hbase.TableName.valueOf(table_name))
 
           yield 'Creating table...' if block_given?
           @admin.createTable(table_description)
@@ -462,22 +459,21 @@ module Hbase
 
     #----------------------------------------------------------------------------------------------
     # Truncates table while maintaing region boundaries (deletes all records by recreating
the table)
-    def truncate_preserve(table_name_str, conf = @conf)
-      table_name = TableName.valueOf(table_name_str)
-      h_table = @connection.getTable(table_name)
-      locator = @connection.getRegionLocator(table_name)
+    def truncate_preserve(table_name, conf = @conf)
+      h_table = @connection.getTable(TableName.valueOf(table_name))
+      locator = @connection.getRegionLocator(TableName.valueOf(table_name))
       splits = locator.getAllRegionLocations().
           map{|i| Bytes.toString(i.getRegionInfo().getStartKey)}.
           delete_if{|k| k == ""}.to_java :String
       locator.close()
 
-      table_description = @admin.getTableDescriptor(table_name)
+      table_description = @admin.getTableDescriptor(TableName.valueOf(table_name))
       yield 'Disabling table...' if block_given?
-      disable(table_name_str)
+      disable(table_name)
 
       begin
         yield 'Truncating table...' if block_given?
-        @admin.truncateTable(table_name, true)
+        @admin.truncateTable(org.apache.hadoop.hbase.TableName.valueOf(table_name), true)
       rescue => e
         # Handle the compatibility case, where the truncate method doesn't exists on the
Master
         raise e unless e.respond_to?(:cause) && e.cause != nil
@@ -485,7 +481,7 @@ module Hbase
         if rootCause.kind_of?(org.apache.hadoop.hbase.DoNotRetryIOException) then
           # Handle the compatibility case, where the truncate method doesn't exists on the
Master
           yield 'Dropping table...' if block_given?
-          @admin.deleteTable(table_name)
+          @admin.deleteTable(org.apache.hadoop.hbase.TableName.valueOf(table_name))
 
           yield 'Creating table with region boundaries...' if block_given?
           @admin.createTable(table_description, splits)
@@ -519,21 +515,18 @@ module Hbase
 
     #----------------------------------------------------------------------------------------------
     # Change table structure or table options
-    def alter(table_name_str, wait = true, *args)
+    def alter(table_name, wait = true, *args)
       # Table name should be a string
-      raise(ArgumentError, "Table name must be of type String") unless
-          table_name_str.kind_of?(String)
+      raise(ArgumentError, "Table name must be of type String") unless table_name.kind_of?(String)
 
       # Table should exist
-      raise(ArgumentError, "Can't find a table: #{table_name_str}") unless exists?(table_name_str)
+      raise(ArgumentError, "Can't find a table: #{table_name}") unless exists?(table_name)
 
       # There should be at least one argument
       raise(ArgumentError, "There should be at least one argument but the table name") if
args.empty?
 
-      table_name = TableName.valueOf(table_name_str)
-
       # Get table descriptor
-      htd = @admin.getTableDescriptor(table_name)
+      htd = @admin.getTableDescriptor(TableName.valueOf(table_name))
 
       # Process all args
       args.each do |arg|
@@ -561,11 +554,11 @@ module Hbase
 
           if wait == true
             puts "Updating all regions with the new schema..."
-            alter_status(table_name_str)
+            alter_status(table_name)
           end
 
           # We bypass descriptor when adding column families; refresh it to apply other args
correctly.
-          htd = @admin.getTableDescriptor(table_name)
+          htd = @admin.getTableDescriptor(TableName.valueOf(table_name))
           next
         end
 
@@ -575,7 +568,7 @@ module Hbase
           # Delete column family
           if method == "delete"
             raise(ArgumentError, "NAME parameter missing for delete method") unless name
-            @admin.deleteColumn(table_name, name.to_java_bytes)
+            @admin.deleteColumn(table_name, name)
           # Unset table attributes
           elsif method == "table_att_unset"
             raise(ArgumentError, "NAME parameter missing for table_att_unset method") unless
name
@@ -592,7 +585,7 @@ module Hbase
               end
               htd.remove(name)
             end
-            @admin.modifyTable(table_name, htd)
+            @admin.modifyTable(table_name.to_java_bytes, htd)
           # Unknown method
           else
             raise ArgumentError, "Unknown method: #{method}"
@@ -604,12 +597,12 @@ module Hbase
 
           if wait == true
             puts "Updating all regions with the new schema..."
-            alter_status(table_name_str)
+            alter_status(table_name)
           end
 
           if method == "delete"
             # We bypass descriptor when deleting column families; refresh it to apply other
args correctly.
-            htd = @admin.getTableDescriptor(table_name)
+            htd = @admin.getTableDescriptor(TableName.valueOf(table_name))
           end
           next
         end
@@ -656,7 +649,7 @@ module Hbase
             arg.delete(key)
           end
 
-          @admin.modifyTable(table_name, htd)
+          @admin.modifyTable(table_name.to_java_bytes, htd)
 
           arg.each_key do |unknown_key|
             puts("Unknown argument ignored: %s" % [unknown_key])
@@ -664,7 +657,7 @@ module Hbase
 
           if wait == true
             puts "Updating all regions with the new schema..."
-            alter_status(table_name_str)
+            alter_status(table_name)
           end
           next
         end
@@ -781,13 +774,13 @@ module Hbase
 
     # Does table exist?
     def exists?(table_name)
-      @admin.tableExists(TableName.valueOf(table_name))
+      @admin.tableExists(table_name)
     end
 
     #----------------------------------------------------------------------------------------------
     # Is table enabled
     def enabled?(table_name)
-      @admin.isTableEnabled(TableName.valueOf(table_name))
+      @admin.isTableEnabled(table_name)
     end
 
     #----------------------------------------------------------------------------------------------
@@ -899,23 +892,14 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Take a snapshot of specified table
     def snapshot(table, snapshot_name, *args)
-      # Table name should be a string
-      raise(ArgumentError, "Table name must be of type String") unless table.kind_of?(String)
-
-      # Snapshot name should be a string
-      raise(ArgumentError, "Snapshot name must be of type String") unless
-          snapshot_name.kind_of?(String)
-
-      table_name = TableName.valueOf(table)
       if args.empty?
-         @admin.snapshot(snapshot_name, table_name)
+         @admin.snapshot(snapshot_name.to_java_bytes, table.to_java_bytes)
       else
          args.each do |arg|
             if arg[SKIP_FLUSH] == true
-              @admin.snapshot(snapshot_name, table_name,
-                              SnapshotDescription::Type::SKIPFLUSH)
+              @admin.snapshot(snapshot_name.to_java_bytes, table.to_java_bytes, SnapshotDescription::Type::SKIPFLUSH)
             else
-               @admin.snapshot(snapshot_name, table_name)
+               @admin.snapshot(snapshot_name.to_java_bytes, table.to_java_bytes)
             end
          end
       end
@@ -924,19 +908,19 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Restore specified snapshot
     def restore_snapshot(snapshot_name)
-      @admin.restoreSnapshot(snapshot_name)
+      @admin.restoreSnapshot(snapshot_name.to_java_bytes)
     end
 
     #----------------------------------------------------------------------------------------------
     # Create a new table by cloning the snapshot content
     def clone_snapshot(snapshot_name, table)
-      @admin.cloneSnapshot(snapshot_name, TableName.valueOf(table))
+      @admin.cloneSnapshot(snapshot_name.to_java_bytes, table.to_java_bytes)
     end
 
     #----------------------------------------------------------------------------------------------
     # Delete specified snapshot
     def delete_snapshot(snapshot_name)
-      @admin.deleteSnapshot(snapshot_name)
+      @admin.deleteSnapshot(snapshot_name.to_java_bytes)
     end
 
     #----------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-shell/src/main/ruby/hbase/security.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/security.rb b/hbase-shell/src/main/ruby/hbase/security.rb
index 20f3298..c7b94e8 100644
--- a/hbase-shell/src/main/ruby/hbase/security.rb
+++ b/hbase-shell/src/main/ruby/hbase/security.rb
@@ -64,7 +64,7 @@ module Hbase
             # Table should exist
             raise(ArgumentError, "Can't find a table: #{table_name}") unless exists?(table_name)
 
-            tableName = org.apache.hadoop.hbase.TableName.valueOf(table_name)
+            tableName = org.apache.hadoop.hbase.TableName.valueOf(table_name.to_java_bytes)
             htd = @admin.getTableDescriptor(tableName)
 
             if (family != nil)
@@ -106,7 +106,7 @@ module Hbase
              # Table should exist
              raise(ArgumentError, "Can't find a table: #{table_name}") unless exists?(table_name)
 
-             tableName = org.apache.hadoop.hbase.TableName.valueOf(table_name)
+             tableName = org.apache.hadoop.hbase.TableName.valueOf(table_name.to_java_bytes)
              htd = @admin.getTableDescriptor(tableName)
 
              if (family != nil)
@@ -165,7 +165,7 @@ module Hbase
 
     # Does table exist?
     def exists?(table_name)
-      @admin.tableExists(TableName.valueOf(table_name))
+      @admin.tableExists(table_name)
     end
 
     def isNamespace?(table_name)

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/hbase-shell/src/main/ruby/hbase/visibility_labels.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/visibility_labels.rb b/hbase-shell/src/main/ruby/hbase/visibility_labels.rb
index 98bfb2c..0d50d8a 100644
--- a/hbase-shell/src/main/ruby/hbase/visibility_labels.rb
+++ b/hbase-shell/src/main/ruby/hbase/visibility_labels.rb
@@ -153,7 +153,7 @@ module Hbase
 
     # Does table exist?
     def exists?(table_name)
-      @admin.tableExists(TableName.valueOf(table_name))
+      @admin.tableExists(table_name)
     end
   end
 end

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/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 0270037..0a1a92e 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -405,21 +405,21 @@ module Hbase
     end
 
     #-------------------------------------------------------------------------------
-    define_test "Snapshot should fail with non-string table name" do
-      assert_raise(ArgumentError) do
+    define_test "Snapshot should fail with non-string snapshot name" do
+      assert_raise(NoMethodError) do
         admin.snapshot(123, 'xxx')
       end
     end
 
-    define_test "Snapshot should fail with non-string snapshot name" do
-      assert_raise(ArgumentError) do
-        admin.snapshot(@test_name, 123)
+    define_test "Snapshot should fail with non-string table name" do
+      assert_raise(NoMethodError) do
+        admin.snapshot(@create_test_snapshot, 123)
       end
     end
 
-    define_test "Snapshot should fail without snapshot name" do
+    define_test "Snapshot should fail without table name" do
       assert_raise(ArgumentError) do
-        admin.snapshot(@test_name)
+        admin.snapshot("hbase_create_test_snapshot")
       end
     end
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/src/main/asciidoc/_chapters/cp.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/cp.adoc b/src/main/asciidoc/_chapters/cp.adoc
index a4587ec..aa2ac0f 100644
--- a/src/main/asciidoc/_chapters/cp.adoc
+++ b/src/main/asciidoc/_chapters/cp.adoc
@@ -421,7 +421,7 @@ onwards.
 +
 [source,java]
 ----
-TableName tableName = TableName.valueOf("users");
+String tableName = "users";
 String path = "hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.jar";
 Configuration conf = HBaseConfiguration.create();
 HBaseAdmin admin = new HBaseAdmin(conf);

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/src/main/asciidoc/_chapters/external_apis.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/external_apis.adoc b/src/main/asciidoc/_chapters/external_apis.adoc
index 43a428a..4aa5815 100644
--- a/src/main/asciidoc/_chapters/external_apis.adoc
+++ b/src/main/asciidoc/_chapters/external_apis.adoc
@@ -741,7 +741,7 @@ the data, and deletes the table.
 [source,jython]
 ----
 import java.lang
-from org.apache.hadoop.hbase import HBaseConfiguration, HTableDescriptor, HColumnDescriptor,
HConstants, TableName
+from org.apache.hadoop.hbase import HBaseConfiguration, HTableDescriptor, HColumnDescriptor,
HConstants
 from org.apache.hadoop.hbase.client import HBaseAdmin, HTable, Get
 from org.apache.hadoop.hbase.io import Cell, RowResult
 
@@ -753,7 +753,7 @@ conf = HBaseConfiguration()
 # Create a table named 'test' that has two column families,
 # one named 'content, and the other 'anchor'.  The colons
 # are required for column family names.
-tablename = TableName.valueOf("test")
+tablename = "test"
 
 desc = HTableDescriptor(tablename)
 desc.addFamily(HColumnDescriptor("content:"))

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/src/main/asciidoc/_chapters/ops_mgt.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/ops_mgt.adoc b/src/main/asciidoc/_chapters/ops_mgt.adoc
index e8d44eb..db255aa 100644
--- a/src/main/asciidoc/_chapters/ops_mgt.adoc
+++ b/src/main/asciidoc/_chapters/ops_mgt.adoc
@@ -2214,7 +2214,7 @@ or in code it would be as follows:
 
 [source,java]
 ----
-void rename(Admin admin, String oldTableName, TableName newTableName) {
+void rename(Admin admin, String oldTableName, String newTableName) {
   String snapshotName = randomName();
   admin.disableTable(oldTableName);
   admin.snapshot(snapshotName, oldTableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/92e178df/src/main/asciidoc/_chapters/schema_design.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/schema_design.adoc b/src/main/asciidoc/_chapters/schema_design.adoc
index e2dcbad..926df71 100644
--- a/src/main/asciidoc/_chapters/schema_design.adoc
+++ b/src/main/asciidoc/_chapters/schema_design.adoc
@@ -53,7 +53,7 @@ Tables must be disabled when making ColumnFamily modifications, for example:
 
 Configuration config = HBaseConfiguration.create();
 Admin admin = new Admin(conf);
-TableName table = TableName.valueOf("myTable");
+String table = "myTable";
 
 admin.disableTable(table);
 


Mime
View raw message