Repository navigation
Closed
Labels
type/bugThe PR fixed a bug or issue reported a bug
Description
Describe the bug
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
Lines 136 to 162 in a242f03
| 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 | |
| cursor.ledger.getExecutor().execute(safeRun(() -> { | |
| readPosition = cursor.ledger.startReadOperationOnLedger(nextReadPosition, OpReadEntry.this); | |
| cursor.ledger.asyncReadEntries(OpReadEntry.this); | |
| })); | |
| } else { | |
| // The reading was already completed, release resources and trigger callback | |
| try { | |
| cursor.readOperationCompleted(); | |
| } finally { | |
| cursor.ledger.getExecutor().executeOrdered(cursor.ledger.getName(), safeRun(() -> { | |
| callback.readEntriesComplete(entries, ctx); | |
| recycle(); | |
| })); | |
| } | |
| } | |
| } |
line_141 - line_143.
The code is useless, it looks like half completed code which forget to be remove.
line_147 will recalculate readPosition.
Metadata
Metadata
Assignees
Labels
type/bugThe PR fixed a bug or issue reported a bug
Activity