hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1526353 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase: KeyValue.java io/hfile/HFilePrettyPrinter.java
Date Thu, 26 Sep 2013 02:17:10 GMT
Author: jmhsieh
Date: Thu Sep 26 02:17:09 2013
New Revision: 1526353

URL: http://svn.apache.org/r1526353
Log:
HBASE-9649 HFilePrettyPrinter should not throw a NPE if FirstKey or LastKey is null (Jean-Marc
Spaggiari)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/KeyValue.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/KeyValue.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/KeyValue.java?rev=1526353&r1=1526352&r2=1526353&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/KeyValue.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/KeyValue.java Thu Sep 26 02:17:09
2013
@@ -713,6 +713,9 @@ public class KeyValue implements Writabl
    * @return Key as a String.
    */
   public static String keyToString(final byte [] k) {
+    if (k == null) {
+      return "";
+    }
     return keyToString(k, 0, k.length);
   }
 

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java?rev=1526353&r1=1526352&r2=1526353&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
Thu Sep 26 02:17:09 2013
@@ -344,7 +344,11 @@ public class HFilePrettyPrinter {
       }
     }
 
-    System.out.println("Mid-key: " + Bytes.toStringBinary(reader.midkey()));
+    try {
+      System.out.println("Mid-key: " + Bytes.toStringBinary(reader.midkey()));
+    } catch (Exception e) {
+      System.out.println("Unable to retrieve the midkey");
+    }
 
     // Printing general bloom information
     DataInput bloomMeta = reader.getGeneralBloomFilterMetadata();



Mime
View raw message