You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2011/02/03 12:49:02 UTC

svn commit: r1066787 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Author: larsgeorge
Date: Thu Feb  3 11:49:02 2011
New Revision: 1066787

URL: http://svn.apache.org/viewvc?rev=1066787&view=rev
Log:
HBASE-3495  Shell is failing on subsequent split calls

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1066787&r1=1066786&r2=1066787&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Feb  3 11:49:02 2011
@@ -39,6 +39,7 @@ Release 0.91.0 - Unreleased
    HBASE-3416  For intra-row scanning, the update readers notification resets
                the query matcher and can lead to incorrect behavior
    HBASE-3492  NPE while splitting table with empty column family store
+   HBASE-3495  Shell is failing on subsequent split calls
 
 
   IMPROVEMENTS

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1066787&r1=1066786&r2=1066787&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Feb  3 11:49:02 2011
@@ -53,10 +53,10 @@ import org.apache.hadoop.hbase.util.Writ
 import org.apache.hadoop.ipc.RemoteException;
 
 /**
- * Provides an interface to manage HBase database table metadata + general 
- * administrative functions.  Use HBaseAdmin to create, drop, list, enable and 
- * disable tables. Use it also to add and drop table column families. 
- * 
+ * Provides an interface to manage HBase database table metadata + general
+ * administrative functions.  Use HBaseAdmin to create, drop, list, enable and
+ * disable tables. Use it also to add and drop table column families.
+ *
  * <p>See {@link HTable} to add, update, and delete data from an individual table.
  * <p>Currently HBaseAdmin instances are not expected to be long-lived.  For
  * example, an HBaseAdmin instance will not ride over a Master restart.
@@ -151,7 +151,7 @@ public class HBaseAdmin implements Abort
   /**
    * @param tableName Table to check.
    * @return True if table exists already.
-   * @throws IOException 
+   * @throws IOException
    */
   public boolean tableExists(final String tableName)
   throws IOException {
@@ -168,7 +168,7 @@ public class HBaseAdmin implements Abort
   /**
    * @param tableName Table to check.
    * @return True if table exists already.
-   * @throws IOException 
+   * @throws IOException
    */
   public boolean tableExists(final byte [] tableName)
   throws IOException {
@@ -451,7 +451,7 @@ public class HBaseAdmin implements Abort
   public void enableTable(final byte [] tableName)
   throws IOException {
     enableTableAsync(tableName);
- 
+
     // Wait until all regions are enabled
     boolean enabled = false;
     for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
@@ -818,7 +818,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to flush
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void flush(final String tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -831,7 +831,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to flush
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void flush(final byte [] tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -873,7 +873,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to compact
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void compact(final String tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -886,7 +886,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to compact
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void compact(final byte [] tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -899,7 +899,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to major compact
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void majorCompact(final String tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -912,7 +912,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to major compact
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void majorCompact(final byte [] tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -926,7 +926,7 @@ public class HBaseAdmin implements Abort
    * @param tableNameOrRegionName table or region to compact
    * @param major True if we are to do a major compaction.
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   private void compact(final byte [] tableNameOrRegionName, final boolean major)
   throws IOException, InterruptedException {
@@ -974,8 +974,8 @@ public class HBaseAdmin implements Abort
    * <code> host187.example.com,60020,1289493121758</code>.
    * @throws UnknownRegionException Thrown if we can't find a region named
    * <code>encodedRegionName</code>
-   * @throws ZooKeeperConnectionException 
-   * @throws MasterNotRunningException 
+   * @throws ZooKeeperConnectionException
+   * @throws MasterNotRunningException
    */
   public void move(final byte [] encodedRegionName, final byte [] destServerName)
   throws UnknownRegionException, MasterNotRunningException, ZooKeeperConnectionException {
@@ -1039,7 +1039,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table or region to split
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void split(final String tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -1052,7 +1052,7 @@ public class HBaseAdmin implements Abort
    *
    * @param tableNameOrRegionName table to region to split
    * @throws IOException if a remote or network exception occurs
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public void split(final byte [] tableNameOrRegionName)
   throws IOException, InterruptedException {
@@ -1094,11 +1094,12 @@ public class HBaseAdmin implements Abort
         for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
           // May not be a server for a particular row
           if (pair.getSecond() == null) continue;
-          if (splitPoint != null) {
-            // if a split point given, only split that particular region
-            HRegionInfo r = pair.getFirst();
-            if (!r.containsRow(splitPoint)) continue;
-          }
+          HRegionInfo r = pair.getFirst();
+          // check for parents
+          if (r.isSplitParent()) continue;
+          // if a split point given, only split that particular region
+          if (splitPoint != null && !r.containsRow(splitPoint)) continue;
+          // call out to region server to do split now
           split(pair.getSecond(), pair.getFirst(), splitPoint);
         }
       }
@@ -1139,7 +1140,7 @@ public class HBaseAdmin implements Abort
    * @return True if <code>tableNameOrRegionName</code> is *possibly* a region
    * name else false if a verified tablename (we call {@link #tableExists(byte[])};
    * else we throw an exception.
-   * @throws IOException 
+   * @throws IOException
    */
   private boolean isRegionName(final byte [] tableNameOrRegionName)
   throws IOException {