change ParitionHolder.isComplete() to accept chunks beyond the "end"

This commit is contained in:
Himanshu Gupta 2015-09-16 21:33:11 -05:00
parent 46a520c07c
commit 22dfa8ecf7
1 changed files with 7 additions and 5 deletions

View File

@ -95,6 +95,8 @@ public class PartitionHolder<T> implements Iterable<PartitionChunk<T>>
Iterator<PartitionChunk<T>> iter = holderSet.iterator(); Iterator<PartitionChunk<T>> iter = holderSet.iterator();
PartitionChunk<T> curr = iter.next(); PartitionChunk<T> curr = iter.next();
boolean endSeen = curr.isEnd();
if (!curr.isStart()) { if (!curr.isStart()) {
return false; return false;
} }
@ -104,14 +106,14 @@ public class PartitionHolder<T> implements Iterable<PartitionChunk<T>>
if (!curr.abuts(next)) { if (!curr.abuts(next)) {
return false; return false;
} }
if (next.isEnd()) {
endSeen = true;
}
curr = next; curr = next;
} }
if (!curr.isEnd()) { return endSeen;
return false;
}
return true;
} }
public PartitionChunk<T> getChunk(final int partitionNum) public PartitionChunk<T> getChunk(final int partitionNum)