From f09ab44cc689e30d56da13ec39d150afa8b63ee9 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Tue, 18 Mar 2014 00:02:14 +0000 Subject: [PATCH] HBASE-10778 Unique keys accounting in MultiThreadedReader is incorrect git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-10070@1578672 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/util/MultiThreadedReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReader.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReader.java index df0d3f84d30..cc87800081a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReader.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReader.java @@ -180,8 +180,8 @@ public class MultiThreadedReader extends MultiThreadedAction startTimeMs = System.currentTimeMillis(); curKey = startKey; long [] keysForThisReader = new long[batchSize]; - int readingRandomKeyStartIndex = -1; while (curKey < endKey && !aborted) { + int readingRandomKeyStartIndex = -1; int numKeys = 0; // if multiGet, loop until we have the number of keys equal to the batch size do { @@ -204,7 +204,7 @@ public class MultiThreadedReader extends MultiThreadedAction readingRandomKeyStartIndex = numKeys; } numKeys++; - } while (numKeys < batchSize); + } while (numKeys < batchSize && curKey < endKey && !aborted); if (numKeys > 0) { //meaning there is some key to read readKey(keysForThisReader);