Class ReadOnlyCursorImpl
- java.lang.Object
-
- org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
-
- org.apache.bookkeeper.mledger.impl.ReadOnlyCursorImpl
-
- All Implemented Interfaces:
ManagedCursor,ReadOnlyCursor
public class ReadOnlyCursorImpl extends ManagedCursorImpl implements ReadOnlyCursor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
ManagedCursorImpl.VoidCallback
-
Nested classes/interfaces inherited from interface org.apache.bookkeeper.mledger.ManagedCursor
ManagedCursor.FindPositionConstraint, ManagedCursor.IndividualDeletedEntries
-
-
Field Summary
-
Fields inherited from class org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
bookkeeper, config, FALSE, LAST_MARK_DELETE_ENTRY_UPDATER, lastMarkDeleteEntry, ledger, markDeletePosition, mbean, messagesConsumedCounter, pendingMarkDeleteOps, persistentMarkDeletePosition, READ_POSITION_UPDATER, readPosition, state, statsLastReadPosition, TRUE, WAITING_READ_OP_UPDATER
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyCursorImpl(org.apache.bookkeeper.client.BookKeeper bookkeeper, ManagedLedgerConfig config, ManagedLedgerImpl ledger, PositionImpl startPosition, java.lang.String cursorName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidasyncClose(AsyncCallbacks.CloseCallback callback, java.lang.Object ctx)Close the cursor asynchronously and release the associated resources.MLDataFormats.ManagedLedgerInfo.LedgerInfogetCurrentLedgerInfo()longgetNumberOfEntries(com.google.common.collect.Range<PositionImpl> range)Return the number of messages that this cursor still has to read.voidskipEntries(int numEntriesToSkip)Skip n entries from the read position of this cursor.-
Methods inherited from class org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
asyncClearBacklog, asyncDelete, asyncDelete, asyncFindNewestMatching, asyncGetNthEntry, asyncMarkDelete, asyncMarkDelete, asyncReadEntries, asyncReadEntries, asyncReadEntriesOrWait, asyncReadEntriesOrWait, asyncReplayEntries, asyncReplayEntries, asyncResetCursor, asyncSkipEntries, cancelPendingReadRequest, checkAndUpdateReadPositionChanged, clearBacklog, close, delete, delete, findNewestMatching, findNewestMatching, getBatchPositionAckSet, getCursorLedger, getCursorLedgerLastEntry, getDeletedBatchIndexesAsLongArray, getEstimatedSizeSinceMarkDeletePosition, getFirstPosition, getIndividuallyDeletedMessages, getIndividuallyDeletedMessagesSet, getLastActive, getLastIndividualDeletedRange, getLastLedgerSwitchTimestamp, getManagedLedger, getMarkDeletedPosition, getMessagesConsumedCounter, getName, getNextAvailablePosition, getNextLedgerPosition, getNonContiguousDeletedMessagesRangeSerializedSize, getNthEntry, getNumberOfEntries, getNumberOfEntriesInBacklog, getNumberOfEntriesInStorage, getNumberOfEntriesSinceFirstNotAckedMessage, getPendingReadOpsCount, getPersistentMarkDeletedPosition, getProperties, getReadPosition, getState, getStats, getThrottleMarkDelete, getTotalNonContiguousDeletedMessagesRange, hasMoreEntries, hasPendingReadRequest, internalAsyncMarkDelete, internalResetCursor, isActive, isBkErrorNotRecoverable, isClosed, isDurable, isIndividuallyDeletedEntriesEmpty, isMessageDeleted, markDelete, markDelete, readEntries, readEntriesOrWait, readEntriesOrWait, recoverFromLedger, replayEntries, resetCursor, rewind, seek, setActive, setAlwaysInactive, setInactive, setThrottleMarkDelete, skipEntries, toString, trimDeletedEntries, updateLastActive
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.bookkeeper.mledger.ReadOnlyCursor
asyncReadEntries, asyncReadEntries, close, findNewestMatching, getNumberOfEntries, getReadPosition, hasMoreEntries, readEntries
-
-
-
-
Constructor Detail
-
ReadOnlyCursorImpl
public ReadOnlyCursorImpl(org.apache.bookkeeper.client.BookKeeper bookkeeper, ManagedLedgerConfig config, ManagedLedgerImpl ledger, PositionImpl startPosition, java.lang.String cursorName)
-
-
Method Detail
-
skipEntries
public void skipEntries(int numEntriesToSkip)
Description copied from interface:ReadOnlyCursorSkip n entries from the read position of this cursor.- Specified by:
skipEntriesin interfaceReadOnlyCursor- Parameters:
numEntriesToSkip- number of entries to skip
-
asyncClose
public void asyncClose(AsyncCallbacks.CloseCallback callback, java.lang.Object ctx)
Description copied from interface:ManagedCursorClose the cursor asynchronously and release the associated resources.- Specified by:
asyncClosein interfaceManagedCursor- Specified by:
asyncClosein interfaceReadOnlyCursor- Overrides:
asyncClosein classManagedCursorImpl- Parameters:
callback- callback objectctx- opaque context
-
getCurrentLedgerInfo
public MLDataFormats.ManagedLedgerInfo.LedgerInfo getCurrentLedgerInfo()
-
getNumberOfEntries
public long getNumberOfEntries(com.google.common.collect.Range<PositionImpl> range)
Description copied from interface:ReadOnlyCursorReturn the number of messages that this cursor still has to read. This method has linear time complexity on the number of ledgers included in the managed ledger.- Specified by:
getNumberOfEntriesin interfaceReadOnlyCursor- Overrides:
getNumberOfEntriesin classManagedCursorImpl- Parameters:
range- the range between two positions- Returns:
- the number of entries in range
-
-