Class ReadOnlyCursorImpl
java.lang.Object
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
org.apache.bookkeeper.mledger.impl.ReadOnlyCursorImpl
- All Implemented Interfaces:
ManagedCursor,ReadOnlyCursor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
ManagedCursorImpl.State, ManagedCursorImpl.VoidCallbackNested 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
batchDeletedIndexes, bookkeeper, config, CURSOR_INTERNAL_PROPERTY_PREFIX, FALSE, individualDeletedMessages, INPROGRESS_MARKDELETE_PERSIST_POSITION_UPDATER, inProgressMarkDeletePersistPosition, LAST_MARK_DELETE_ENTRY_UPDATER, lastMarkDeleteEntry, ledger, markDeletePosition, mbean, messagesConsumedCounter, pendingMarkDeleteOps, persistentMarkDeletePosition, READ_POSITION_UPDATER, readPosition, state, STATE_UPDATER, statsLastReadPosition, TRUE, WAITING_READ_OP_UPDATER -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyCursorImpl(BookKeeper bookkeeper, ManagedLedgerConfig config, ManagedLedgerImpl ledger, PositionImpl startPosition, String cursorName) -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncClose(AsyncCallbacks.CloseCallback callback, Object ctx) Close the cursor asynchronously and release the associated resources.longgetNumberOfEntries(com.google.common.collect.Range<PositionImpl> range) Return the number of messages that this cursor still has to read.booleanisMessageDeleted(Position position) voidskipEntries(int numEntriesToSkip) Skip n entries from the read position of this cursor.Methods inherited from class org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
applyMaxSizeCap, asyncClearBacklog, asyncDelete, asyncDelete, asyncFindNewestMatching, asyncFindNewestMatching, asyncGetNthEntry, asyncMarkDelete, asyncMarkDelete, asyncReadEntries, asyncReadEntries, asyncReadEntriesOrWait, asyncReadEntriesOrWait, asyncReadEntriesWithSkip, asyncReadEntriesWithSkipOrWait, asyncReadEntriesWithSkipOrWait, asyncReplayEntries, asyncReplayEntries, asyncResetCursor, asyncSkipEntries, cancelPendingReadRequest, checkAndUpdateReadPositionChanged, clearBacklog, close, delete, delete, duplicateNonDurableCursor, findNewestMatching, findNewestMatching, getBatchPositionAckSet, getConfig, getCursorLedger, getCursorLedgerLastEntry, getCursorProperties, 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, isCacheReadEntry, isClosed, isDurable, isIndividuallyDeletedEntriesEmpty, markDelete, markDelete, putCursorProperty, putProperty, readEntries, readEntriesOrWait, readEntriesOrWait, recoverFromLedger, removeCursorProperty, removeProperty, replayEntries, resetCursor, rewind, rewind, scan, seek, setActive, setAlwaysInactive, setCacheReadEntry, setCursorProperties, setInactive, setState, setThrottleMarkDelete, skipEntries, skipNonRecoverableLedger, toString, trimDeletedEntries, updateLastActive, updateReadStatsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.mledger.ManagedCursor
seekMethods inherited from interface org.apache.bookkeeper.mledger.ReadOnlyCursor
asyncReadEntries, asyncReadEntries, close, findNewestMatching, getNumberOfEntries, getReadPosition, hasMoreEntries, readEntries
-
Constructor Details
-
ReadOnlyCursorImpl
public ReadOnlyCursorImpl(BookKeeper bookkeeper, ManagedLedgerConfig config, ManagedLedgerImpl ledger, PositionImpl startPosition, String cursorName)
-
-
Method Details
-
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
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
-
getNumberOfEntries
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
-
isMessageDeleted
- Overrides:
isMessageDeletedin classManagedCursorImpl
-