hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r686322 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Date Fri, 15 Aug 2008 19:02:51 GMT
Author: stack
Date: Fri Aug 15 12:02:50 2008
New Revision: 686322

URL: http://svn.apache.org/viewvc?rev=686322&view=rev
Log:
HBASE-833 Doing an insert with an unknown family throws a NPE in HRS

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=686322&r1=686321&r2=686322&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Aug 15 12:02:50 2008
@@ -25,6 +25,7 @@
                (Jean-Daniel Cryans via Stack)
    HBASE-831   committing BatchUpdate with no row should complain
                (Andrew Purtell via Jim Kellerman)
+   HBASE-833   Doing an insert with an unknown family throws a NPE in HRS
 
   IMPROVEMENTS
    HBASE-801  When a table haven't disable, shell could response in a "user

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=686322&r1=686321&r2=686322&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Fri
Aug 15 12:02:50 2008
@@ -53,6 +53,7 @@
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HMsg;
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -1159,15 +1160,18 @@
       batchUpdate.iterator(); iter.hasNext();) {
       
       BatchOperation operation = iter.next();
-      int maxLength = 
-        desc.getFamily(HStoreKey.getFamily(operation.getColumn())).
-          getMaxValueLength();
-      if(operation.getValue() != null)
-        if(operation.getValue().length > maxLength) {
-          throw new IOException("Value in column " + 
-              Bytes.toString(operation.getColumn()) + " is too long. " + 
-              operation.getValue().length + " instead of " + maxLength);
+      if (operation.getValue() != null) {
+        HColumnDescriptor fam = 
+          desc.getFamily(HStoreKey.getFamily(operation.getColumn()));
+        if (fam != null) {
+          int maxLength = fam.getMaxValueLength();
+          if (operation.getValue().length > maxLength) {
+            throw new IOException("Value in column "
+                + Bytes.toString(operation.getColumn()) + " is too long. "
+                + operation.getValue().length + " instead of " + maxLength);
+          }
         }
+      }
     }
   }
   



Mime
View raw message