diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java index c44634cec51a6..816ae9e55437c 100644 --- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java +++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java @@ -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 ENTRIES_ADDED_COUNTER_UPDATER = AtomicLongFieldUpdater .newUpdater(ManagedLedgerImpl.class, "entriesAddedCounter"); @@ -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 pendingAddEntries = new ConcurrentLinkedQueue<>(); @@ -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(); @@ -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()) { @@ -3392,7 +3392,7 @@ long getNumberOfEntries(Range 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) { @@ -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; } }