hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r987952 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java
Date Sun, 22 Aug 2010 22:20:16 GMT
Author: stack
Date: Sun Aug 22 22:20:16 2010
New Revision: 987952

URL: http://svn.apache.org/viewvc?rev=987952&view=rev
Log:
HBASE-2931 Do not throw RuntimeExceptions in RPC/HbaseObjectWritable code, ensure we log and
rethrow as IOE

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=987952&r1=987951&r2=987952&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sun Aug 22 22:20:16 2010
@@ -483,6 +483,9 @@ Release 0.21.0 - Unreleased
    HBASE-2928  Fault in logic in BinaryPrefixComparator leads to
                ArrayIndexOutOfBoundsException (pranav via jgray)
    HBASE-2924  TestLogRolling doesn't use the right HLog half the time
+   HBASE-2931  Do not throw RuntimeExceptions in RPC/HbaseObjectWritable
+               code, ensure we log and rethrow as IOE
+               (Karthik Ranganathan via Stack)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java?rev=987952&r1=987951&r2=987952&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java Sun Aug
22 22:20:16 2010
@@ -159,7 +159,6 @@ public class HbaseObjectWritable impleme
     addToMap(WritableByteArrayComparable.class, code++);
     addToMap(FirstKeyOnlyFilter.class, code++);
     addToMap(DependentColumnFilter.class, code++);
-    addToMap(ColumnPrefixFilter.class, code++);
 
     addToMap(Delete [].class, code++);
 
@@ -172,6 +171,7 @@ public class HbaseObjectWritable impleme
 
     // List
     addToMap(List.class, code++);
+    addToMap(ColumnPrefixFilter.class, code++);
   }
 
   private Class<?> declaredClass;
@@ -450,13 +450,19 @@ public class HbaseObjectWritable impleme
         try {
           instanceClass = getClassByName(conf, className);
         } catch (ClassNotFoundException e) {
-          throw new RuntimeException("Can't find class " + className);
+          LOG.error("Can't find class " + className, e);
+          throw new IOException("Can't find class " + className, e);
         }
       } else {
         instanceClass = CODE_TO_CLASS.get(b);
       }
       Writable writable = WritableFactories.newInstance(instanceClass, conf);
-      writable.readFields(in);
+      try {
+        writable.readFields(in);
+      } catch (Exception e) {
+        LOG.error("Error in readFields", e);
+        throw new IOException("Error in readFields" , e);
+      }
       instance = writable;
       if (instanceClass == NullInstance.class) {  // null
         declaredClass = ((NullInstance)instance).declaredClass;



Mime
View raw message