hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r602267 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt src/java/org/apache/hadoop/hbase/rest/TableHandler.java
Date Fri, 07 Dec 2007 23:26:31 GMT
Author: stack
Date: Fri Dec  7 15:26:30 2007
New Revision: 602267

URL: http://svn.apache.org/viewvc?rev=602267&view=rev
Log:
HADOOP-2380 REST servlet throws NPE when any value node has an empty string

Modified:
    lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/rest/TableHandler.java

Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?rev=602267&r1=602266&r2=602267&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Fri Dec  7 15:26:30 2007
@@ -11,7 +11,7 @@
     HADOOP-2084 Add a LocalHBaseCluster
     HADOOP-2068 RESTful interface (Bryan Duxbury via Stack)
     HADOOP-2316 Run REST servlet outside of master
-                (Bryan Duxbury via Stack)
+                (Bryan Duxbury & Stack)
 
   OPTIMIZATIONS
 
@@ -61,6 +61,8 @@
    HADOOP-2365 Result of HashFunction.hash() contains all identical values
    HADOOP-2362 Leaking hdfs file handle on region split
    HADOOP-2338 Fix NullPointerException in master server.
+   HADOOP-2380 REST servlet throws NPE when any value node has an empty string
+               (Bryan Duxbury via Stack)
 
   IMPROVEMENTS
    HADOOP-2401 Add convenience put method that takes writable

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/rest/TableHandler.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/rest/TableHandler.java?rev=602267&r1=602266&r2=602267&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/rest/TableHandler.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/rest/TableHandler.java
Fri Dec  7 15:26:30 2007
@@ -308,8 +308,16 @@
 
         Node value_node = column.getElementsByTagName("value").item(0);
 
-        // decode the base64'd value
-        byte[] value = org.apache.hadoop.hbase.util.Base64.decode(value_node.getFirstChild().getNodeValue());
+        byte[] value = new byte[0];
+        
+        // for some reason there's no value here. probably indicates that
+        // the consumer passed a null as the cell value.
+        if(value_node.getFirstChild() != null && 
+          value_node.getFirstChild().getNodeValue() != null){
+          // decode the base64'd value
+          value = org.apache.hadoop.hbase.util.Base64.decode(
+            value_node.getFirstChild().getNodeValue());
+        }
 
         // put the value
         table.put(lock_id, name, value);



Mime
View raw message