HBASE-7342 Split operation without split key incorrectly finds the middle key in off-by-one error (Aleksandr Shulman)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1423110 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-12-17 19:41:36 +00:00
parent 4cc31baec3
commit 21594e57ef
1 changed files with 1 additions and 2 deletions

View File

@ -342,7 +342,7 @@ public class HFileBlockIndex {
midKey = Arrays.copyOfRange(b.array(), keyOffset, keyOffset + keyLen); midKey = Arrays.copyOfRange(b.array(), keyOffset, keyOffset + keyLen);
} else { } else {
// The middle of the root-level index. // The middle of the root-level index.
midKey = blockKeys[(rootCount - 1) / 2]; midKey = blockKeys[rootCount / 2];
} }
this.midKey.set(midKey); this.midKey.set(midKey);
@ -1427,5 +1427,4 @@ public class HFileBlockIndex {
public static int getMaxChunkSize(Configuration conf) { public static int getMaxChunkSize(Configuration conf) {
return conf.getInt(MAX_CHUNK_SIZE_KEY, DEFAULT_MAX_CHUNK_SIZE); return conf.getInt(MAX_CHUNK_SIZE_KEY, DEFAULT_MAX_CHUNK_SIZE);
} }
} }