You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2012/12/17 20:42:58 UTC

svn commit: r1423112 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java

Author: tedyu
Date: Mon Dec 17 19:42:57 2012
New Revision: 1423112

URL: http://svn.apache.org/viewvc?rev=1423112&view=rev
Log:
HBASE-7342 Split operation without split key incorrectly finds the middle key in off-by-one error (Aleksandr Shulman)


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

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java?rev=1423112&r1=1423111&r2=1423112&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java Mon Dec 17 19:42:57 2012
@@ -342,7 +342,7 @@ public class HFileBlockIndex {
         midKey = Arrays.copyOfRange(b.array(), keyOffset, keyOffset + keyLen);
       } else {
         // The middle of the root-level index.
-        midKey = blockKeys[(rootCount - 1) / 2];
+        midKey = blockKeys[rootCount / 2];
       }
 
       this.midKey.set(midKey);
@@ -1429,5 +1429,4 @@ public class HFileBlockIndex {
   public static int getMaxChunkSize(Configuration conf) {
     return conf.getInt(MAX_CHUNK_SIZE_KEY, DEFAULT_MAX_CHUNK_SIZE);
   }
-
 }