hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r939123 - in /hadoop/hbase/trunk: ./ core/src/main/java/org/apache/hadoop/hbase/master/
Date Wed, 28 Apr 2010 22:45:48 GMT
Author: stack
Date: Wed Apr 28 22:45:47 2010
New Revision: 939123

URL: http://svn.apache.org/viewvc?rev=939123&view=rev
Log:
HBASE-2497  ProcessServerShutdown throws NullPointerException for offline regions

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/TableOperation.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=939123&r1=939122&r2=939123&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Apr 28 22:45:47 2010
@@ -20,6 +20,8 @@ Release 0.21.0 - Unreleased
    HBASE-2392  Upgrade to ZooKeeper 3.3.0
    HBASE-2294  Enumerate ACID properties of HBase in a well defined spec
                (Todd Lipcon via Stack)
+   HBASE-2497  ProcessServerShutdown throws NullPointerException for offline
+               regions
 
   BUG FIXES
    HBASE-1791  Timeout in IndexRecordWriter (Bradford Stephens via Andrew

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java?rev=939123&r1=939122&r2=939123&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/BaseScanner.java
Wed Apr 28 22:45:47 2010
@@ -249,7 +249,7 @@ abstract class BaseScanner extends Chore
    * @param r
    * @return Empty String or server address found in <code>r</code>
    */
-  private String getServerAddress(final Result r) {
+  static String getServerAddress(final Result r) {
     byte [] val = r.getValue(CATALOG_FAMILY, SERVER_QUALIFIER);
     return val == null || val.length <= 0? "": Bytes.toString(val);
   }
@@ -258,7 +258,7 @@ abstract class BaseScanner extends Chore
    * @param r
    * @return Return 0L or server startcode found in <code>r</code>
    */
-  private long getStartCode(final Result r) {
+  static long getStartCode(final Result r) {
     byte [] val = r.getValue(CATALOG_FAMILY, STARTCODE_QUALIFIER);
     return val == null || val.length <= 0? 0L: Bytes.toLong(val);
   }

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java?rev=939123&r1=939122&r2=939123&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
Wed Apr 28 22:45:47 2010
@@ -140,10 +140,9 @@ class ProcessServerShutdown extends Regi
         // shutdown server but that would mean that we'd reassign regions that
         // were already out being assigned, ones that were product of a split
         // that happened while the shutdown was being processed.
-        String serverAddress = 
-          Bytes.toString(values.getValue(CATALOG_FAMILY, SERVER_QUALIFIER));
-        long startCode =
-          Bytes.toLong(values.getValue(CATALOG_FAMILY, STARTCODE_QUALIFIER));
+        String serverAddress = BaseScanner.getServerAddress(values);
+        long startCode = BaseScanner.getStartCode(values);
+
         String serverName = null;
         if (serverAddress != null && serverAddress.length() > 0) {
           serverName = HServerInfo.getServerName(serverAddress, startCode);

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/TableOperation.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/TableOperation.java?rev=939123&r1=939122&r2=939123&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/TableOperation.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/TableOperation.java
Wed Apr 28 22:45:47 2010
@@ -101,12 +101,10 @@ abstract class TableOperation implements
                       Bytes.toStringBinary(values.getRow()));
             continue;
           }
-          final String serverAddress =
-            Bytes.toString(values.getValue(CATALOG_FAMILY, SERVER_QUALIFIER));
+          final String serverAddress = BaseScanner.getServerAddress(values);
           String serverName = null;
           if (serverAddress != null && serverAddress.length() > 0) {
-            long startCode =
-              Bytes.toLong(values.getValue(CATALOG_FAMILY, STARTCODE_QUALIFIER));
+            long startCode = BaseScanner.getStartCode(values);
             serverName = HServerInfo.getServerName(serverAddress, startCode);
           }
           if (Bytes.compareTo(info.getTableDesc().getName(), tableName) > 0) {



Mime
View raw message