Skip to content

Commit

Permalink
[fix][broker] Typos in ManagedLedgerImpl (#18445)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzh0425 authored Nov 17, 2022
1 parent 883f760 commit aeb4503
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
private final ManagedCursorContainer activeCursors = new ManagedCursorContainer();


// Ever increasing counter of entries added
// Ever-increasing counter of entries added
@VisibleForTesting
static final AtomicLongFieldUpdater<ManagedLedgerImpl> ENTRIES_ADDED_COUNTER_UPDATER = AtomicLongFieldUpdater
.newUpdater(ManagedLedgerImpl.class, "entriesAddedCounter");
Expand Down Expand Up @@ -317,7 +317,7 @@ public enum PositionBound {
.newUpdater(ManagedLedgerImpl.class, ReadEntryCallbackWrapper.class, "lastReadCallback");

/**
* Queue of pending entries to be added to the managed ledger. Typically entries are queued when a new ledger is.
* Queue of pending entries to be added to the managed ledger. Typically, entries are queued when a new ledger is.
* created asynchronously and hence there is no ready ledger to write into.
*/
final ConcurrentLinkedQueue<OpAddEntry> pendingAddEntries = new ConcurrentLinkedQueue<>();
Expand Down Expand Up @@ -1847,7 +1847,7 @@ void asyncReadEntries(OpReadEntry opReadEntry) {
} else {
LedgerInfo ledgerInfo = ledgers.get(ledgerId);
if (ledgerInfo == null || ledgerInfo.getEntries() == 0) {
// Cursor is pointing to a empty ledger, there's no need to try opening it. Skip this ledger and
// Cursor is pointing to an empty ledger, there's no need to try opening it. Skip this ledger and
// move to the next one
opReadEntry.updateReadPosition(new PositionImpl(opReadEntry.readPosition.getLedgerId() + 1, 0));
opReadEntry.checkReadCompletion();
Expand Down Expand Up @@ -3053,7 +3053,7 @@ public void asyncOffloadPrefix(Position pos, OffloadCallback callback, Object ct
long current = ledgers.lastKey();

// the first ledger which will not be offloaded. Defaults to current,
// in the case that the whole headmap is offloaded. Otherwise it will
// in the case that the whole headmap is offloaded. Otherwise, it will
// be set as we iterate through the headmap values
long firstLedgerRetained = current;
for (LedgerInfo ls : ledgers.headMap(current).values()) {
Expand Down Expand Up @@ -3392,7 +3392,7 @@ long getNumberOfEntries(Range<PositionImpl> range) {
* @param n
* number of entries to skip ahead
* @param startRange
* specifies whether or not to include the start position in calculating the distance
* specifies whether to include the start position in calculating the distance
* @return the new position that is n entries ahead
*/
public PositionImpl getPositionAfterN(final PositionImpl startPosition, long n, PositionBound startRange) {
Expand Down Expand Up @@ -3516,10 +3516,10 @@ public boolean isValidPosition(PositionImpl position) {

if (ls == null) {
if (position.getLedgerId() < last.getLedgerId()) {
// Pointing to a non existing ledger that is older than the current ledger is invalid
// Pointing to a non-existing ledger that is older than the current ledger is invalid
return false;
} else {
// Pointing to a non existing ledger is only legitimate if the ledger was empty
// Pointing to a non-existing ledger is only legitimate if the ledger was empty
return position.getEntryId() == 0;
}
}
Expand Down

0 comments on commit aeb4503

Please sign in to comment.