diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java index 0136a2923af..cabe137077a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java @@ -135,7 +135,9 @@ public class Get extends OperationWithAttributes if(set == null) { set = new TreeSet(Bytes.BYTES_COMPARATOR); } - set.add(qualifier); + if (qualifier != null) { + set.add(qualifier); + } familyMap.put(family, set); return this; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java index f55dd11a8bf..e721627e76e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -224,7 +224,9 @@ public class Scan extends OperationWithAttributes implements Writable { if(set == null) { set = new TreeSet(Bytes.BYTES_COMPARATOR); } - set.add(qualifier); + if (qualifier != null) { + set.add(qualifier); + } familyMap.put(family, set); return this; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java index fd9e7aac47b..3bfaf9beb39 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java @@ -925,7 +925,8 @@ public final class ProtobufUtil { edit.add(new KeyValue(keyValue.toByteArray())); } if (walEdit.getFamilyScopeCount() > 0) { - TreeMap scopes = new TreeMap(); + TreeMap scopes = + new TreeMap(Bytes.BYTES_COMPARATOR); for (FamilyScope scope: walEdit.getFamilyScopeList()) { scopes.put(scope.getFamily().toByteArray(), Integer.valueOf(scope.getScopeType().ordinal()));