Skip to content

Commit

Permalink
[cleanup] [broker] Remove useless code to avoid confusion in OpReadEn…
Browse files Browse the repository at this point in the history
…try#checkReadCompletion. (apache#15104)

(cherry picked from commit 9376128)
  • Loading branch information
horizonzy authored and codelipenghui committed Jun 7, 2022
1 parent eed7825 commit f03b168
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,8 @@ void checkReadCompletion() {
// op readPosition is smaller or equals maxPosition then can read again
if (entries.size() < count && cursor.hasMoreEntries()
&& maxPosition.compareTo(readPosition) > 0) {
// We still have more entries to read from the next ledger, schedule a new async operation
if (nextReadPosition.getLedgerId() != readPosition.getLedgerId()) {
cursor.ledger.startReadOperationOnLedger(nextReadPosition, OpReadEntry.this);
}

// Schedule next read in a different thread
// We still have more entries to read from the next ledger, schedule a new async operation
cursor.ledger.getExecutor().execute(safeRun(() -> {
readPosition = cursor.ledger.startReadOperationOnLedger(nextReadPosition, OpReadEntry.this);
cursor.ledger.asyncReadEntries(OpReadEntry.this);
Expand Down

0 comments on commit f03b168

Please sign in to comment.