From cf3215d343d5c412735f51c68dc3686087736a86 Mon Sep 17 00:00:00 2001 From: CHIA-PING TSAI Date: Mon, 10 Apr 2017 17:03:47 +0800 Subject: [PATCH] HBASE-17897 StripeStoreFileManager#nonOpenRowCompare use the wrong comparison function --- .../hadoop/hbase/regionserver/StripeStoreFileManager.java | 2 +- .../hbase/regionserver/TestStripeStoreFileManager.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java index 4a719f3b175..ef86e2fc74e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java @@ -562,7 +562,7 @@ public class StripeStoreFileManager */ private final int nonOpenRowCompare(byte[] k1, byte[] k2) { assert !isOpen(k1) && !isOpen(k2); - return cellComparator.compareRows(new KeyOnlyKeyValue(k1), k2, 0, k2.length); + return Bytes.compareTo(k1, k2); } private final int nonOpenRowCompare(Cell k1, byte[] k2) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java index a6ce270a8d5..ca13263f9cd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java @@ -58,9 +58,9 @@ public class TestStripeStoreFileManager { private static final Path CFDIR = HStore.getStoreHomedir(BASEDIR, "region", Bytes.toBytes("cf")); private static final byte[] KEY_A = Bytes.toBytes("aaa"); - private static final byte[] KEY_B = Bytes.toBytes("bbb"); - private static final byte[] KEY_C = Bytes.toBytes("ccc"); - private static final byte[] KEY_D = Bytes.toBytes("ddd"); + private static final byte[] KEY_B = Bytes.toBytes("aab"); + private static final byte[] KEY_C = Bytes.toBytes("aac"); + private static final byte[] KEY_D = Bytes.toBytes("aad"); private static final KeyValue KV_A = new KeyValue(KEY_A, 0L); private static final KeyValue KV_B = new KeyValue(KEY_B, 0L);