hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject hbase git commit: HBASE-13329 ArrayIndexOutOfBoundsException in CellComparator#getMinimumMidpointArray.
Date Sun, 05 Jul 2015 19:27:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 215290eb7 -> 1f9bf419c


HBASE-13329 ArrayIndexOutOfBoundsException in CellComparator#getMinimumMidpointArray.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1f9bf419
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1f9bf419
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1f9bf419

Branch: refs/heads/master
Commit: 1f9bf419c1c9040504de1b36fb85d0be7163eadf
Parents: 215290e
Author: Lars Hofhansl <larsh@apache.org>
Authored: Sun Jul 5 12:28:27 2015 -0700
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Sun Jul 5 12:28:27 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/io/hfile/HFileWriterImpl.java  |  2 +-
 .../hadoop/hbase/regionserver/TestHRegion.java  | 24 ++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1f9bf419/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java
index 42b94d4..fcb264d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java
@@ -431,7 +431,7 @@ public class HFileWriterImpl implements HFile.Writer {
       final int leftLength, final byte[] rightArray, final int rightOffset, final int rightLength)
{
     // rows are different
     int minLength = leftLength < rightLength ? leftLength : rightLength;
-    short diffIdx = 0;
+    int diffIdx = 0;
     while (diffIdx < minLength
         && leftArray[leftOffset + diffIdx] == rightArray[rightOffset + diffIdx])
{
       diffIdx++;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1f9bf419/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index bd6d452..23f5e48 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -3366,6 +3366,30 @@ public class TestHRegion {
     }
   }
 
+  /**
+   * Write an HFile block full with Cells whose qualifier that are identical between
+   * 0 and Short.MAX_VALUE. See HBASE-13329.
+   * @throws Exception
+   */
+  @Test
+  public void testLongQualifier() throws Exception {
+    String method = name.getMethodName();
+    TableName tableName = TableName.valueOf(method);
+    byte[] family = Bytes.toBytes("family");
+    this.region = initHRegion(tableName, method, CONF, family);
+    byte[] q = new byte[Short.MAX_VALUE+2];
+    Arrays.fill(q, 0, q.length-1, (byte)42);
+    for (byte i=0; i<10; i++) {
+      Put p = new Put(Bytes.toBytes("row"));
+      // qualifiers that differ past Short.MAX_VALUE
+      q[q.length-1]=i;
+      p.addColumn(family, q, q);
+      region.put(p);
+    }
+    region.flush(false);
+    HBaseTestingUtility.closeRegionAndWAL(this.region);
+    this.region = null;
+  }
   // ////////////////////////////////////////////////////////////////////////////
   // Split test
   // ////////////////////////////////////////////////////////////////////////////


Mime
View raw message