hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r731987 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Date Tue, 06 Jan 2009 16:22:59 GMT
Author: stack
Date: Tue Jan  6 08:22:59 2009
New Revision: 731987

URL: http://svn.apache.org/viewvc?rev=731987&view=rev
Log:
HBASE-1082 Administrative functions for table/region maintenance; Add byte array overloads
for jgray

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=731987&r1=731986&r2=731987&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Tue Jan  6
08:22:59 2009
@@ -547,15 +547,33 @@
    * @throws IOException
    */
   public void flush(final String tableNameOrRegionName) throws IOException {
+    flush(Bytes.toBytes(tableNameOrRegionName));
+  }
+
+  /**
+   * Flush a table or an individual region
+   * @param tableNameOrRegionName
+   * @throws IOException
+   */
+  public void flush(final byte [] tableNameOrRegionName) throws IOException {
     modifyTable(tableNameOrRegionName, HConstants.MODIFY_TABLE_FLUSH);
   }
-  
+
   /**
    * Compact a table or an individual region
    * @param tableNameOrRegionName
    * @throws IOException
    */
   public void compact(final String tableNameOrRegionName) throws IOException {
+    compact(Bytes.toBytes(tableNameOrRegionName));
+  }
+
+  /**
+   * Compact a table or an individual region
+   * @param tableNameOrRegionName
+   * @throws IOException
+   */
+  public void compact(final byte [] tableNameOrRegionName) throws IOException {
     modifyTable(tableNameOrRegionName, HConstants.MODIFY_TABLE_COMPACT);
   }
   
@@ -566,6 +584,16 @@
    */
   public void majorCompact(final String tableNameOrRegionName)
   throws IOException {
+    majorCompact(Bytes.toBytes(tableNameOrRegionName));
+  }
+
+  /**
+   * Major compact a table or an individual region
+   * @param tableNameOrRegionName
+   * @throws IOException
+   */
+  public void majorCompact(final byte [] tableNameOrRegionName)
+  throws IOException {
     modifyTable(tableNameOrRegionName, HConstants.MODIFY_TABLE_MAJOR_COMPACT);
   }
 
@@ -575,10 +603,18 @@
    * @throws IOException
    */
   public void split(final String tableNameOrRegionName) throws IOException {
+    split(Bytes.toBytes(tableNameOrRegionName));
+  }
+
+  /**
+   * Split a table or an individual region
+   * @param tableNameOrRegionName
+   * @throws IOException
+   */
+  public void split(final byte [] tableNameOrRegionName) throws IOException {
     modifyTable(tableNameOrRegionName, HConstants.MODIFY_TABLE_SPLIT);
   }
 
-  
   /*
    * Call modifyTable using passed tableName or region name String.  If no
    * such table, presume we have been passed a region name.
@@ -586,16 +622,16 @@
    * @param op
    * @throws IOException
    */
-  private void modifyTable(final String tableNameOrRegionName, final int op)
+  private void modifyTable(final byte [] tableNameOrRegionName, final int op)
   throws IOException {
     if (tableNameOrRegionName == null) {
       throw new IllegalArgumentException("Pass a table name or region name");
     }
-    String tableName = tableExists(tableNameOrRegionName)?
+    byte [] tableName = tableExists(tableNameOrRegionName)?
       tableNameOrRegionName: null;
-    String regionName = tableName == null? tableNameOrRegionName: null;
-    Object [] args = regionName == null? null: new String [] {regionName};
-    modifyTable(tableName == null? null: Bytes.toBytes(tableName), op, args);
+    byte [] regionName = tableName == null? tableNameOrRegionName: null;
+    Object [] args = regionName == null? null: new byte [][] {regionName};
+    modifyTable(tableName == null? null: tableName, op, args);
   }
 
   /**



Mime
View raw message