hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r692585 - in /hadoop/hbase: branches/0.2/ branches/0.2/bin/ branches/0.2/src/java/org/apache/hadoop/hbase/ branches/0.2/src/java/org/apache/hadoop/hbase/client/ branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/ trunk/ trunk/b...
Date Fri, 05 Sep 2008 23:57:41 GMT
Author: stack
Date: Fri Sep  5 16:57:40 2008
New Revision: 692585

URL: http://svn.apache.org/viewvc?rev=692585&view=rev
Log:
HBASE-872 Getting exceptions in shell when creating/disabling tables

Added:
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/RegionException.java
Modified:
    hadoop/hbase/branches/0.2/CHANGES.txt
    hadoop/hbase/branches/0.2/bin/hirb.rb
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/bin/hirb.rb
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java

Modified: hadoop/hbase/branches/0.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/CHANGES.txt?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.2/CHANGES.txt Fri Sep  5 16:57:40 2008
@@ -55,6 +55,7 @@
                the region location cache
    HBASE-864   Deadlock in regionserver
    HBASE-865   Fix javadoc warnings (Rong-En Fan via Jim Kellerman)
+   HBASE-872   Getting exceptions in shell when creating/disabling tables
 
   IMPROVEMENTS
    HBASE-801  When a table haven't disable, shell could response in a "user

Modified: hadoop/hbase/branches/0.2/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/bin/hirb.rb?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/bin/hirb.rb (original)
+++ hadoop/hbase/branches/0.2/bin/hirb.rb Fri Sep  5 16:57:40 2008
@@ -70,7 +70,7 @@
 # Turn off retries in hbase and ipc.  Human doesn't want to wait on N retries.
 @configuration = org.apache.hadoop.hbase.HBaseConfiguration.new()
 @configuration.set("hbase.master", master) if master
-@configuration.setInt("hbase.client.retries.number", 3)
+@configuration.setInt("hbase.client.retries.number", 5)
 @configuration.setInt("ipc.client.connect.max.retries", 3)
 
 # Do lazy create of admin because if we are pointed at bad master, it will hang

Added: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/RegionException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/RegionException.java?rev=692585&view=auto
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/RegionException.java (added)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/RegionException.java Fri Sep
 5 16:57:40 2008
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase;
+
+import java.io.IOException;
+/**
+ * Thrown when something happens related to region handling.
+ * Subclasses have to be more specific.
+ */
+public class RegionException extends IOException {
+  private static final long serialVersionUID = 1473510258071111371L;
+
+  /** default constructor */
+  public RegionException() {
+    super();
+  }
+
+  /**
+   * Constructor
+   * @param s message
+   */
+  public RegionException(String s) {
+    super(s);
+  }
+
+}

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/TableNotFoundException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
(original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
Fri Sep  5 16:57:40 2008
@@ -19,10 +19,8 @@
  */
 package org.apache.hadoop.hbase;
 
-import java.io.IOException;
-
 /** Thrown when a table can not be located */
-public class TableNotFoundException extends IOException {
+public class TableNotFoundException extends RegionException {
   private static final long serialVersionUID = 993179627856392526L;
 
   /** default constructor */

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Fri
Sep  5 16:57:40 2008
@@ -31,9 +31,9 @@
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MasterNotRunningException;
+import org.apache.hadoop.hbase.RegionException;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.TableExistsException;
-import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.io.Cell;
 import org.apache.hadoop.hbase.io.RowResult;
 import org.apache.hadoop.hbase.ipc.HMasterInterface;
@@ -157,7 +157,7 @@
         connection.locateRegion(desc.getName(), HConstants.EMPTY_START_ROW);
         break;
         
-      } catch (TableNotFoundException e) {
+      } catch (RegionException e) {
         if (tries == numRetries - 1) {
           // Ran out of tries
           throw e;
@@ -414,9 +414,10 @@
           Bytes.toString(tableName));
       }
     }
-    if (isTableEnabled(tableName))
-      throw new IOException("unable to disable table " +
-        Bytes.toString(tableName));
+    if (isTableEnabled(tableName)) {
+      throw new RegionException("Retries exhausted, it took too long to wait"+
+        " for the table " + Bytes.toString(tableName) + " to be disabled.");
+    }
     LOG.info("Disabled " + Bytes.toString(tableName));
   }
   

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
(original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
Fri Sep  5 16:57:40 2008
@@ -19,12 +19,12 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import java.io.IOException;
+import org.apache.hadoop.hbase.RegionException;
 
 /**
  * Thrown when no region server can be found for a region
  */
-public class NoServerForRegionException extends IOException {
+public class NoServerForRegionException extends RegionException {
   private static final long serialVersionUID = 1L << 11 - 1L;
 
   /** default constructor */

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
(original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
Fri Sep  5 16:57:40 2008
@@ -19,10 +19,10 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import java.io.IOException;
+import org.apache.hadoop.hbase.RegionException;
 
 /** Thrown when a table can not be located */
-public class RegionOfflineException extends IOException {
+public class RegionOfflineException extends RegionException {
   private static final long serialVersionUID = 466008402L;
 /** default constructor */
   public RegionOfflineException() {

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
(original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
Fri Sep  5 16:57:40 2008
@@ -446,4 +446,4 @@
     }
     return result;
   }
-}
\ No newline at end of file
+}

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Sep  5 16:57:40 2008
@@ -57,6 +57,7 @@
                the region location cache
    HBASE-864   Deadlock in regionserver
    HBASE-865   Fix javadoc warnings (Rong-En Fan via Jim Kellerman)
+   HBASE-872   Getting exceptions in shell when creating/disabling tables
 
   IMPROVEMENTS
    HBASE-801  When a table haven't disable, shell could response in a "user

Modified: hadoop/hbase/trunk/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hirb.rb?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/hirb.rb (original)
+++ hadoop/hbase/trunk/bin/hirb.rb Fri Sep  5 16:57:40 2008
@@ -70,7 +70,7 @@
 # Turn off retries in hbase and ipc.  Human doesn't want to wait on N retries.
 @configuration = org.apache.hadoop.hbase.HBaseConfiguration.new()
 @configuration.set("hbase.master", master) if master
-@configuration.setInt("hbase.client.retries.number", 3)
+@configuration.setInt("hbase.client.retries.number", 5)
 @configuration.setInt("ipc.client.connect.max.retries", 3)
 
 # Do lazy create of admin because if we are pointed at bad master, it will hang

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/TableNotFoundException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/TableNotFoundException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/TableNotFoundException.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/TableNotFoundException.java Fri Sep
 5 16:57:40 2008
@@ -19,10 +19,8 @@
  */
 package org.apache.hadoop.hbase;
 
-import java.io.IOException;
-
 /** Thrown when a table can not be located */
-public class TableNotFoundException extends IOException {
+public class TableNotFoundException extends RegionException {
   private static final long serialVersionUID = 993179627856392526L;
 
   /** default constructor */

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=692585&r1=692584&r2=692585&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 Fri Sep  5
16:57:40 2008
@@ -31,9 +31,9 @@
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MasterNotRunningException;
+import org.apache.hadoop.hbase.RegionException;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.TableExistsException;
-import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.io.Cell;
 import org.apache.hadoop.hbase.io.RowResult;
 import org.apache.hadoop.hbase.ipc.HMasterInterface;
@@ -145,7 +145,7 @@
         connection.locateRegion(desc.getName(), HConstants.EMPTY_START_ROW);
         break;
         
-      } catch (TableNotFoundException e) {
+      } catch (RegionException e) {
         if (tries == numRetries - 1) {
           // Ran out of tries
           throw e;
@@ -368,9 +368,10 @@
           Bytes.toString(tableName));
       }
     }
-    if (isTableEnabled(tableName))
-      throw new IOException("unable to disable table " +
-        Bytes.toString(tableName));
+    if (isTableEnabled(tableName)) {
+      throw new RegionException("Retries exhausted, it took too long to wait"+
+        " for the table " + Bytes.toString(tableName) + " to be disabled.");
+    }
     LOG.info("Disabled " + Bytes.toString(tableName));
   }
   

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
Fri Sep  5 16:57:40 2008
@@ -19,12 +19,12 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import java.io.IOException;
+import org.apache.hadoop.hbase.RegionException;
 
 /**
  * Thrown when no region server can be found for a region
  */
-public class NoServerForRegionException extends IOException {
+public class NoServerForRegionException extends RegionException {
   private static final long serialVersionUID = 1L << 11 - 1L;
 
   /** default constructor */

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
Fri Sep  5 16:57:40 2008
@@ -19,10 +19,10 @@
  */
 package org.apache.hadoop.hbase.client;
 
-import java.io.IOException;
+import org.apache.hadoop.hbase.RegionException;
 
 /** Thrown when a table can not be located */
-public class RegionOfflineException extends IOException {
+public class RegionOfflineException extends RegionException {
   private static final long serialVersionUID = 466008402L;
 /** default constructor */
   public RegionOfflineException() {

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java?rev=692585&r1=692584&r2=692585&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java
Fri Sep  5 16:57:40 2008
@@ -446,4 +446,4 @@
     }
     return result;
   }
-}
\ No newline at end of file
+}



Mime
View raw message