Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Naireen committed Aug 12, 2024
1 parent a6de475 commit faecdb2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public boolean advance() throws IOException {
*/
while (true) {
if (curBatch.hasNext()) {
// data from the next partition?
PartitionState<K, V> pState = curBatch.next();

if (!pState.recordIter.hasNext()) { // -- (c)
Expand Down Expand Up @@ -228,14 +229,16 @@ public boolean advance() throws IOException {
for (Map.Entry<String, Long> backlogSplit : perPartitionBacklogMetrics.entrySet()) {
backlogBytesOfSplit.set(backlogSplit.getValue());
}
return true;
return true; // record has been read and proccessed, so we return. (only read a record at a time)

} else { // -- (b)
nextBatch();
nextBatch(); // void, returns nothing, can this be done in the background instead of when we call advance?

if (!curBatch.hasNext()) {
if (!curBatch.hasNext()) { // returns false because nothing returned in time?
return false;
}
// Gives no such element exception
// return true; //? returns, then will call advance again. Whats the difference between repeatedly calling advance vs iterating over constatnly?
}
}
}
Expand Down

0 comments on commit faecdb2

Please sign in to comment.