try {
List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(mapfiles.length);
for (int i = 0; i < mapfiles.length; i++)
iters.add(mapfiles[i]);
MultiIterator mmfi = new MultiIterator(iters, new KeyExtent(new Text(""), endRow, prevEndRow));
mmfi.seek(new Range(new Key(startRow), null), LocalityGroupUtil.EMPTY_CF_SET, false);
int count = 0;
long t1 = System.currentTimeMillis();
Key lastKey = new Key();
while (mmfi.hasTop()) {
Key key = mmfi.getTopKey();
if (lastKey.compareTo(key) > 0) {
String msg = "Not sorted : " + lastKey + " " + key;
System.err.println(msg);
throw new RuntimeException(msg);
}
lastKey.set(key);
System.out.println(" " + key);
mmfi.next();
count++;
}
long t2 = System.currentTimeMillis();