类 ManagedCursorImpl
java.lang.Object
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl
- 所有已实现的接口:
ManagedCursor
- 直接已知子类:
NonDurableCursorImpl,ReadOnlyCursorImpl
-
嵌套类概要
嵌套类从接口继承的嵌套类/接口 org.apache.bookkeeper.mledger.ManagedCursor
ManagedCursor.FindPositionConstraint, ManagedCursor.IndividualDeletedEntries -
字段概要
字段修饰符和类型字段说明protected final org.apache.bookkeeper.client.BookKeeperprotected final ManagedLedgerConfigstatic final intprotected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> protected PositionImplprotected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> protected org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntryprotected final ManagedLedgerImplprotected PositionImplprotected final ManagedCursorMXBeanprotected longprotected final ArrayDeque<org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry>protected PositionImplprotected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> protected PositionImplprotected ManagedCursorImpl.Stateprotected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,ManagedCursorImpl.State> protected PositionImplstatic final intprotected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.OpReadEntry> -
方法概要
修饰符和类型方法说明voidasyncClearBacklog(AsyncCallbacks.ClearBacklogCallback callback, Object ctx) Clear the cursor backlog.voidasyncClose(AsyncCallbacks.CloseCallback callback, Object ctx) Close the cursor asynchronously and release the associated resources.voidasyncDelete(Iterable<Position> positions, AsyncCallbacks.DeleteCallback callback, Object ctx) Delete a group of messages asynchronouslyvoidasyncDelete(Position pos, AsyncCallbacks.DeleteCallback callback, Object ctx) Delete a single message asynchronouslyvoidasyncFindNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition, AsyncCallbacks.FindEntryCallback callback, Object ctx) Find the newest entry that matches the given predicate.voidasyncGetNthEntry(int n, ManagedCursor.IndividualDeletedEntries deletedEntries, AsyncCallbacks.ReadEntryCallback callback, Object ctx) Asynchronously get 'N'th entry from the mark delete position in the cursor without updating any cursor positions.voidasyncMarkDelete(Position position, Map<String, Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) Asynchronous mark delete.voidasyncMarkDelete(Position position, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) Asynchronous mark delete.voidasyncReadEntries(int numberOfEntriesToRead, long maxSizeBytes, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) Asynchronously read entries from the ManagedLedger.voidasyncReadEntries(int numberOfEntriesToRead, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) Asynchronously read entries from the ManagedLedger.voidasyncReadEntriesOrWait(int maxEntries, long maxSizeBytes, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) Asynchronously read entries from the ManagedLedger, up to the specified number and size.voidasyncReadEntriesOrWait(int numberOfEntriesToRead, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) Asynchronously read entries from the ManagedLedger.asyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx) Async replays given positions: a. before reading it filters out already-acked messages b. reads remaining entries async and gives it to given ReadEntriesCallback c. returns all already-acked messages which are not replayed so, those messages can be removed by caller(Dispatcher)'s replay-list and it won't try to replay it againasyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, boolean sortEntries) Read the specified set of positions from ManagedLedger.voidasyncResetCursor(Position newPos, boolean forceReset, AsyncCallbacks.ResetCursorCallback callback) reset the cursor to specified position to enable replay of messages.voidasyncSkipEntries(int numEntriesToSkip, ManagedCursor.IndividualDeletedEntries deletedEntries, AsyncCallbacks.SkipEntriesCallback callback, Object ctx) Skip n entries from the read position of this cursor.booleanCancel a previously scheduled asyncReadEntriesOrWait operation.booleanChecks if read position changed since this method was called last time.voidClear the cursor backlog.voidclose()Close the cursor and releases the associated resources.voidDelete a group of entries.voidDelete a single message.findNewestMatching(com.google.common.base.Predicate<Entry> condition) Find the newest entry that matches the given predicate.findNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition) Find the newest entry that matches the given predicate.long[]getBatchPositionAckSet(Position position) longlongReturn any properties that were associated with the cursor.long[]Get deleted batch indexes list for a batch message.longReturns the estimated size of the unacknowledged backlog for this cursor.Get the first position.org.apache.pulsar.common.util.collections.LongPairRangeSet<PositionImpl>longGet the last active time of the cursor.com.google.common.collect.Range<PositionImpl>Get last individual deleted range.longGetManagedLedgerattached with cursor.Get the newest mark deleted position on this cursor.longgetName()Get the unique cursor name.getNextAvailablePosition(PositionImpl position) Checks given position is part of deleted-range and returns next position of upper-end as all the messages are deleted up to that point.getNextLedgerPosition(long currentLedgerId) intReturns the serialized size of mark-Delete ranges.getNthEntry(int n, ManagedCursor.IndividualDeletedEntries deletedEntries) Get 'N'th entry from the mark delete position in the cursor without updating any cursor positions.longReturn the number of messages that this cursor still has to read.protected longgetNumberOfEntries(com.google.common.collect.Range<PositionImpl> range) longgetNumberOfEntriesInBacklog(boolean isPrecise) Return the number of non-deleted messages on this cursor.longlongReturns total number of entries from the first not-acked message to current dispatching position.intGet the persistent newest mark deleted position on this cursor.Return any properties that were associated with the last stored position.Get the read position.getState()getStats()doubleReturns cursor throttle mark-delete rate.intReturns number of mark-Delete range.booleanTells whether this cursor has already consumed all the available entries.booleanprotected voidinternalAsyncMarkDelete(PositionImpl newPosition, Map<String, Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) protected voidinternalResetCursor(PositionImpl proposedReadPosition, AsyncCallbacks.ResetCursorCallback resetCursorCallback) booleanisActive()Checks if cursor is active or not.static booleanisBkErrorNotRecoverable(int rc) return BK error codes that are considered not likely to be recoverable.booleanisClosed()Checks if the cursor is closed.booleanTells whether the cursor is durable or just kept in memory.booleanbooleanisMessageDeleted(Position position) voidmarkDelete(Position position) This signals that the reader is done with all the entries up to "position" (included).voidmarkDelete(Position position, Map<String, Long> properties) This signals that the reader is done with all the entries up to "position" (included).booleanputProperty(String key, Long value) Add a property associated with the last stored position.readEntries(int numberOfEntriesToRead) Read entries from the ManagedLedger, up to the specified number.readEntriesOrWait(int numberOfEntriesToRead) Read entries from the ManagedLedger, up to the specified number.readEntriesOrWait(int numberOfEntriesToRead, long maxSizeBytes) Read entries from the ManagedLedger, up to the specified number and size.protected voidbooleanremoveProperty(String key) Remove a property associated with the last stored position.replayEntries(Set<? extends Position> positions) Read the specified set of positions from ManagedLedger.voidresetCursor(Position newPos) reset the cursor to specified position to enable replay of messages.voidrewind()Rewind the cursor to the mark deleted position to replay all the already read but not yet mark deleted messages.voidvoidActivate cursor: EntryCacheManager caches entries only for activated-cursors.voidA cursor that is set as always-inactive will never trigger the caching of entries.setCursorProperties(Map<String, String> cursorProperties) Updates the properties.voidDeactivate cursor.voidsetState(ManagedCursorImpl.State state) voidsetThrottleMarkDelete(double throttleMarkDelete) Update throttle mark delete rate.voidskipEntries(int numEntriesToSkip, ManagedCursor.IndividualDeletedEntries deletedEntries) Skip n entries from the read position of this cursor.toString()voidtrimDeletedEntries(List<Entry> entries) Trim delete entries for the given entries.voidUpdate the last active time of the cursor.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 org.apache.bookkeeper.mledger.ManagedCursor
seek
-
字段详细资料
-
bookkeeper
protected final org.apache.bookkeeper.client.BookKeeper bookkeeper -
config
-
ledger
-
markDeletePosition
-
persistentMarkDeletePosition
-
INPROGRESS_MARKDELETE_PERSIST_POSITION_UPDATER
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> INPROGRESS_MARKDELETE_PERSIST_POSITION_UPDATER -
inProgressMarkDeletePersistPosition
-
READ_POSITION_UPDATER
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> READ_POSITION_UPDATER -
readPosition
-
statsLastReadPosition
-
LAST_MARK_DELETE_ENTRY_UPDATER
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> LAST_MARK_DELETE_ENTRY_UPDATER -
lastMarkDeleteEntry
protected volatile org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry lastMarkDeleteEntry -
WAITING_READ_OP_UPDATER
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.OpReadEntry> WAITING_READ_OP_UPDATER -
FALSE
public static final int FALSE- 另请参阅:
-
TRUE
public static final int TRUE- 另请参阅:
-
messagesConsumedCounter
protected volatile long messagesConsumedCounter -
pendingMarkDeleteOps
protected final ArrayDeque<org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> pendingMarkDeleteOps -
STATE_UPDATER
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,ManagedCursorImpl.State> STATE_UPDATER -
state
-
mbean
-
-
方法详细资料
-
getProperties
从接口复制的说明:ManagedCursorReturn any properties that were associated with the last stored position.- 指定者:
getProperties在接口中ManagedCursor
-
getCursorProperties
从接口复制的说明:ManagedCursorReturn any properties that were associated with the cursor.- 指定者:
getCursorProperties在接口中ManagedCursor
-
setCursorProperties
从接口复制的说明:ManagedCursorUpdates the properties.- 指定者:
setCursorProperties在接口中ManagedCursor- 返回:
- a handle to the result of the operation
-
putProperty
从接口复制的说明:ManagedCursorAdd a property associated with the last stored position.- 指定者:
putProperty在接口中ManagedCursor
-
removeProperty
从接口复制的说明:ManagedCursorRemove a property associated with the last stored position.- 指定者:
removeProperty在接口中ManagedCursor
-
recoverFromLedger
protected void recoverFromLedger(MLDataFormats.ManagedCursorInfo info, ManagedCursorImpl.VoidCallback callback) -
readEntries
public List<Entry> readEntries(int numberOfEntriesToRead) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorRead entries from the ManagedLedger, up to the specified number. The returned list can be smaller.- 指定者:
readEntries在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to return- 返回:
- the list of entries
- 抛出:
ManagedLedgerExceptionInterruptedException
-
asyncReadEntries
public void asyncReadEntries(int numberOfEntriesToRead, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) 从接口复制的说明:ManagedCursorAsynchronously read entries from the ManagedLedger.- 指定者:
asyncReadEntries在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to returncallback- callback objectctx- opaque contextmaxPosition- max position can read- 另请参阅:
-
asyncReadEntries
public void asyncReadEntries(int numberOfEntriesToRead, long maxSizeBytes, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) 从接口复制的说明:ManagedCursorAsynchronously read entries from the ManagedLedger.- 指定者:
asyncReadEntries在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to returnmaxSizeBytes- max size in bytes of the entries to returncallback- callback objectctx- opaque contextmaxPosition- max position can read
-
getNthEntry
public Entry getNthEntry(int n, ManagedCursor.IndividualDeletedEntries deletedEntries) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorGet 'N'th entry from the mark delete position in the cursor without updating any cursor positions.- 指定者:
getNthEntry在接口中ManagedCursor- 参数:
n- entry positiondeletedEntries- skip individual deleted entries- 返回:
- the entry
- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncGetNthEntry
public void asyncGetNthEntry(int n, ManagedCursor.IndividualDeletedEntries deletedEntries, AsyncCallbacks.ReadEntryCallback callback, Object ctx) 从接口复制的说明:ManagedCursorAsynchronously get 'N'th entry from the mark delete position in the cursor without updating any cursor positions.- 指定者:
asyncGetNthEntry在接口中ManagedCursor- 参数:
n- entry positiondeletedEntries- skip individual deleted entries
-
readEntriesOrWait
public List<Entry> readEntriesOrWait(int numberOfEntriesToRead) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorRead entries from the ManagedLedger, up to the specified number. The returned list can be smaller. If no entries are available, the method will block until at least a new message will be persisted.- 指定者:
readEntriesOrWait在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to return- 返回:
- the list of entries
- 抛出:
ManagedLedgerExceptionInterruptedException
-
readEntriesOrWait
public List<Entry> readEntriesOrWait(int numberOfEntriesToRead, long maxSizeBytes) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorRead entries from the ManagedLedger, up to the specified number and size. If no entries are available, the method will block until at least a new message will be persisted.- 指定者:
readEntriesOrWait在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to returnmaxSizeBytes- max size in bytes of the entries to return- 返回:
- the list of entries
- 抛出:
ManagedLedgerExceptionInterruptedException
-
asyncReadEntriesOrWait
public void asyncReadEntriesOrWait(int numberOfEntriesToRead, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) 从接口复制的说明:ManagedCursorAsynchronously read entries from the ManagedLedger. If no entries are available, the callback will not be triggered. Instead it will be registered to wait until a new message will be persisted into the managed ledger- 指定者:
asyncReadEntriesOrWait在接口中ManagedCursor- 参数:
numberOfEntriesToRead- maximum number of entries to returncallback- callback objectctx- opaque contextmaxPosition- max position can read- 另请参阅:
-
asyncReadEntriesOrWait
public void asyncReadEntriesOrWait(int maxEntries, long maxSizeBytes, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, PositionImpl maxPosition) 从接口复制的说明:ManagedCursorAsynchronously read entries from the ManagedLedger, up to the specified number and size. If no entries are available, the callback will not be triggered. Instead it will be registered to wait until a new message will be persisted into the managed ledger- 指定者:
asyncReadEntriesOrWait在接口中ManagedCursor- 参数:
maxEntries- maximum number of entries to returnmaxSizeBytes- max size in bytes of the entries to returncallback- callback objectctx- opaque contextmaxPosition- max position can read- 另请参阅:
-
isClosed
public boolean isClosed()从接口复制的说明:ManagedCursorChecks if the cursor is closed.- 指定者:
isClosed在接口中ManagedCursor- 返回:
- whether this cursor is closed.
-
cancelPendingReadRequest
public boolean cancelPendingReadRequest()从接口复制的说明:ManagedCursorCancel a previously scheduled asyncReadEntriesOrWait operation.- 指定者:
cancelPendingReadRequest在接口中ManagedCursor- 返回:
- true if the read operation was canceled or false if there was no pending operation
- 另请参阅:
-
hasPendingReadRequest
public boolean hasPendingReadRequest() -
hasMoreEntries
public boolean hasMoreEntries()从接口复制的说明:ManagedCursorTells whether this cursor has already consumed all the available entries. This method is not blocking.- 指定者:
hasMoreEntries在接口中ManagedCursor- 返回:
- true if there are pending entries to read, false otherwise
-
getNumberOfEntries
public long getNumberOfEntries()从接口复制的说明:ManagedCursorReturn 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.- 指定者:
getNumberOfEntries在接口中ManagedCursor- 返回:
- the number of entries
-
getNumberOfEntriesSinceFirstNotAckedMessage
public long getNumberOfEntriesSinceFirstNotAckedMessage()从接口复制的说明:ManagedCursorReturns total number of entries from the first not-acked message to current dispatching position.- 指定者:
getNumberOfEntriesSinceFirstNotAckedMessage在接口中ManagedCursor- 返回:
-
getTotalNonContiguousDeletedMessagesRange
public int getTotalNonContiguousDeletedMessagesRange()从接口复制的说明:ManagedCursorReturns number of mark-Delete range.- 指定者:
getTotalNonContiguousDeletedMessagesRange在接口中ManagedCursor- 返回:
-
getNonContiguousDeletedMessagesRangeSerializedSize
public int getNonContiguousDeletedMessagesRangeSerializedSize()从接口复制的说明:ManagedCursorReturns the serialized size of mark-Delete ranges. -
getEstimatedSizeSinceMarkDeletePosition
public long getEstimatedSizeSinceMarkDeletePosition()从接口复制的说明:ManagedCursorReturns the estimated size of the unacknowledged backlog for this cursor.- 指定者:
getEstimatedSizeSinceMarkDeletePosition在接口中ManagedCursor- 返回:
- the estimated size from the mark delete position of the cursor
-
getNumberOfEntriesInBacklog
public long getNumberOfEntriesInBacklog(boolean isPrecise) 从接口复制的说明:ManagedCursorReturn the number of non-deleted messages on this cursor. This will also include messages that have already been read from the cursor but not deleted or mark-deleted yet. This method has linear time complexity on the number of ledgers included in the managed ledger.- 指定者:
getNumberOfEntriesInBacklog在接口中ManagedCursor- 参数:
isPrecise- set to true to get precise backlog count- 返回:
- the number of entries
-
getNumberOfEntriesInStorage
public long getNumberOfEntriesInStorage() -
findNewestMatching
public Position findNewestMatching(com.google.common.base.Predicate<Entry> condition) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorFind the newest entry that matches the given predicate. Will only search among active entries- 指定者:
findNewestMatching在接口中ManagedCursor- 参数:
condition- predicate that reads an entry an applies a condition- 返回:
- Position of the newest entry that matches the given predicate
- 抛出:
InterruptedExceptionManagedLedgerException
-
findNewestMatching
public Position findNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorFind the newest entry that matches the given predicate.- 指定者:
findNewestMatching在接口中ManagedCursor- 参数:
constraint- search only active entries or all entriescondition- predicate that reads an entry an applies a condition- 返回:
- Position of the newest entry that matches the given predicate
- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncFindNewestMatching
public void asyncFindNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition, AsyncCallbacks.FindEntryCallback callback, Object ctx) 从接口复制的说明:ManagedCursorFind the newest entry that matches the given predicate.- 指定者:
asyncFindNewestMatching在接口中ManagedCursor- 参数:
constraint- search only active entries or all entriescondition- predicate that reads an entry an applies a conditioncallback- callback object returning the resultant positionctx- opaque context
-
setActive
public void setActive()从接口复制的说明:ManagedCursorActivate cursor: EntryCacheManager caches entries only for activated-cursors.- 指定者:
setActive在接口中ManagedCursor
-
isActive
public boolean isActive()从接口复制的说明:ManagedCursorChecks if cursor is active or not.- 指定者:
isActive在接口中ManagedCursor- 返回:
-
setInactive
public void setInactive()从接口复制的说明:ManagedCursorDeactivate cursor.- 指定者:
setInactive在接口中ManagedCursor
-
setAlwaysInactive
public void setAlwaysInactive()从接口复制的说明:ManagedCursorA cursor that is set as always-inactive will never trigger the caching of entries.- 指定者:
setAlwaysInactive在接口中ManagedCursor
-
getFirstPosition
从接口复制的说明:ManagedCursorGet the first position.- 指定者:
getFirstPosition在接口中ManagedCursor- 返回:
- the first position
-
internalResetCursor
protected void internalResetCursor(PositionImpl proposedReadPosition, AsyncCallbacks.ResetCursorCallback resetCursorCallback) -
asyncResetCursor
public void asyncResetCursor(Position newPos, boolean forceReset, AsyncCallbacks.ResetCursorCallback callback) 从接口复制的说明:ManagedCursorreset the cursor to specified position to enable replay of messages.- 指定者:
asyncResetCursor在接口中ManagedCursor- 参数:
newPos- position to move the cursor toforceReset- whether to force reset the position even if the position is no longer in the managed ledger, this is used by compacted topic which has data in the compacted ledger, to ensure the cursor can read data from the compacted ledger.callback- callback object
-
resetCursor
从接口复制的说明:ManagedCursorreset the cursor to specified position to enable replay of messages.- 指定者:
resetCursor在接口中ManagedCursor- 参数:
newPos- position to move the cursor to- 抛出:
ManagedLedgerExceptionInterruptedException
-
replayEntries
public List<Entry> replayEntries(Set<? extends Position> positions) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorRead the specified set of positions from ManagedLedger.- 指定者:
replayEntries在接口中ManagedCursor- 参数:
positions- set of positions to read- 返回:
- the list of entries
- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncReplayEntries
public Set<? extends Position> asyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx) Async replays given positions: a. before reading it filters out already-acked messages b. reads remaining entries async and gives it to given ReadEntriesCallback c. returns all already-acked messages which are not replayed so, those messages can be removed by caller(Dispatcher)'s replay-list and it won't try to replay it again- 指定者:
asyncReplayEntries在接口中ManagedCursor- 参数:
positions- set of positions to readcallback- callback object returning the list of entriesctx- opaque context- 返回:
- skipped positions set of positions which are already deleted/acknowledged and skipped while replaying them
-
asyncReplayEntries
public Set<? extends Position> asyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, boolean sortEntries) 从接口复制的说明:ManagedCursorRead the specified set of positions from ManagedLedger.- 指定者:
asyncReplayEntries在接口中ManagedCursor- 参数:
positions- set of positions to readcallback- callback object returning the list of entriesctx- opaque contextsortEntries- callback with sorted entry list.- 返回:
- skipped positions set of positions which are already deleted/acknowledged and skipped while replaying them
-
getNumberOfEntries
-
markDelete
从接口复制的说明:ManagedCursorThis signals that the reader is done with all the entries up to "position" (included). This can potentially trigger a ledger deletion, if all the other cursors are done too with the underlying ledger.- 指定者:
markDelete在接口中ManagedCursor- 参数:
position- the last position that have been successfully consumed- 抛出:
ManagedLedgerExceptionInterruptedException
-
markDelete
public void markDelete(Position position, Map<String, Long> properties) throws InterruptedException, ManagedLedgerException从接口复制的说明:ManagedCursorThis signals that the reader is done with all the entries up to "position" (included). This can potentially trigger a ledger deletion, if all the other cursors are done too with the underlying ledger.- 指定者:
markDelete在接口中ManagedCursor- 参数:
position- the last position that have been successfully consumedproperties- additional user-defined properties that can be associated with a particular cursor position- 抛出:
ManagedLedgerExceptionInterruptedException
-
clearBacklog
从接口复制的说明:ManagedCursorClear the cursor backlog. Consume all the entries for this cursor.- 指定者:
clearBacklog在接口中ManagedCursor- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncClearBacklog
从接口复制的说明:ManagedCursorClear the cursor backlog. Consume all the entries for this cursor.- 指定者:
asyncClearBacklog在接口中ManagedCursor- 参数:
callback- callback objectctx- opaque context
-
skipEntries
public void skipEntries(int numEntriesToSkip, ManagedCursor.IndividualDeletedEntries deletedEntries) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorSkip n entries from the read position of this cursor.- 指定者:
skipEntries在接口中ManagedCursor- 参数:
numEntriesToSkip- number of entries to skipdeletedEntries- skip individual deleted entries- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncSkipEntries
public void asyncSkipEntries(int numEntriesToSkip, ManagedCursor.IndividualDeletedEntries deletedEntries, AsyncCallbacks.SkipEntriesCallback callback, Object ctx) 从接口复制的说明:ManagedCursorSkip n entries from the read position of this cursor.- 指定者:
asyncSkipEntries在接口中ManagedCursor- 参数:
numEntriesToSkip- number of entries to skipdeletedEntries- skip individual deleted entriescallback- callback objectctx- opaque context
-
asyncMarkDelete
public void asyncMarkDelete(Position position, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) 从接口复制的说明:ManagedCursorAsynchronous mark delete.- 指定者:
asyncMarkDelete在接口中ManagedCursor- 参数:
position- the last position that have been successfully consumedcallback- callback objectctx- opaque context- 另请参阅:
-
asyncMarkDelete
public void asyncMarkDelete(Position position, Map<String, Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) 从接口复制的说明:ManagedCursorAsynchronous mark delete.- 指定者:
asyncMarkDelete在接口中ManagedCursor- 参数:
position- the last position that have been successfully consumedproperties- additional user-defined properties that can be associated with a particular cursor positioncallback- callback objectctx- opaque context- 另请参阅:
-
internalAsyncMarkDelete
protected void internalAsyncMarkDelete(PositionImpl newPosition, Map<String, Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx) -
delete
从接口复制的说明:ManagedCursorDelete a single message. Mark a single message for deletion. When all the previous messages are all deleted, then markDelete() will be called internally to advance the persistent acknowledged position. The deletion of the message is not persisted into the durable storage and cannot be recovered upon the reopening of the ManagedLedger- 指定者:
delete在接口中ManagedCursor- 参数:
position- the position of the message to be deleted- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncDelete
从接口复制的说明:ManagedCursorDelete a single message asynchronously Mark a single message for deletion. When all the previous messages are all deleted, then markDelete() will be called internally to advance the persistent acknowledged position. The deletion of the message is not persisted into the durable storage and cannot be recovered upon the reopening of the ManagedLedger- 指定者:
asyncDelete在接口中ManagedCursor- 参数:
pos- the position of the message to be deletedcallback- callback objectctx- opaque context
-
delete
public void delete(Iterable<Position> positions) throws InterruptedException, ManagedLedgerException 从接口复制的说明:ManagedCursorDelete a group of entries. Mark multiple single messages for deletion. When all the previous messages are all deleted, then markDelete() will be called internally to advance the persistent acknowledged position. The deletion of the message is not persisted into the durable storage and cannot be recovered upon the reopening of the ManagedLedger- 指定者:
delete在接口中ManagedCursor- 参数:
positions- positions of the messages to be deleted- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncDelete
public void asyncDelete(Iterable<Position> positions, AsyncCallbacks.DeleteCallback callback, Object ctx) 从接口复制的说明:ManagedCursorDelete a group of messages asynchronously Mark a group of messages for deletion. When all the previous messages are all deleted, then markDelete() will be called internally to advance the persistent acknowledged position. The deletion of the messages is not persisted into the durable storage and cannot be recovered upon the reopening of the ManagedLedger- 指定者:
asyncDelete在接口中ManagedCursor- 参数:
positions- the positions of the messages to be deletedcallback- callback objectctx- opaque context
-
toString
-
getName
从接口复制的说明:ManagedCursorGet the unique cursor name.- 指定者:
getName在接口中ManagedCursor- 返回:
- the cursor name
-
getLastActive
public long getLastActive()从接口复制的说明:ManagedCursorGet the last active time of the cursor.- 指定者:
getLastActive在接口中ManagedCursor- 返回:
- the last active time of the cursor
-
updateLastActive
public void updateLastActive()从接口复制的说明:ManagedCursorUpdate the last active time of the cursor.- 指定者:
updateLastActive在接口中ManagedCursor
-
isDurable
public boolean isDurable()从接口复制的说明:ManagedCursorTells whether the cursor is durable or just kept in memory.- 指定者:
isDurable在接口中ManagedCursor
-
getReadPosition
从接口复制的说明:ManagedCursorGet the read position. This points to the next message to be read from the cursor.- 指定者:
getReadPosition在接口中ManagedCursor- 返回:
- the read position
-
getMarkDeletedPosition
从接口复制的说明:ManagedCursorGet the newest mark deleted position on this cursor.- 指定者:
getMarkDeletedPosition在接口中ManagedCursor- 返回:
- the mark deleted position
-
getPersistentMarkDeletedPosition
从接口复制的说明:ManagedCursorGet the persistent newest mark deleted position on this cursor.- 指定者:
getPersistentMarkDeletedPosition在接口中ManagedCursor- 返回:
- the persistent mark deleted position
-
rewind
public void rewind()从接口复制的说明:ManagedCursorRewind the cursor to the mark deleted position to replay all the already read but not yet mark deleted messages. The next message to be read is the one after the current mark deleted message.- 指定者:
rewind在接口中ManagedCursor
-
seek
- 指定者:
seek在接口中ManagedCursor
-
close
从接口复制的说明:ManagedCursorClose the cursor and releases the associated resources.- 指定者:
close在接口中ManagedCursor- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncClose
从接口复制的说明:ManagedCursorClose the cursor asynchronously and release the associated resources.- 指定者:
asyncClose在接口中ManagedCursor- 参数:
callback- callback objectctx- opaque context
-
isBkErrorNotRecoverable
public static boolean isBkErrorNotRecoverable(int rc) return BK error codes that are considered not likely to be recoverable. -
getPendingReadOpsCount
public int getPendingReadOpsCount() -
getMessagesConsumedCounter
public long getMessagesConsumedCounter() -
getCursorLedger
public long getCursorLedger() -
getCursorLedgerLastEntry
public long getCursorLedgerLastEntry() -
getIndividuallyDeletedMessages
-
getIndividuallyDeletedMessagesSet
public org.apache.pulsar.common.util.collections.LongPairRangeSet<PositionImpl> getIndividuallyDeletedMessagesSet() -
isMessageDeleted
-
getBatchPositionAckSet
-
getNextAvailablePosition
Checks given position is part of deleted-range and returns next position of upper-end as all the messages are deleted up to that point.- 参数:
position-- 返回:
- next available position
-
getNextLedgerPosition
-
isIndividuallyDeletedEntriesEmpty
public boolean isIndividuallyDeletedEntriesEmpty() -
getLastLedgerSwitchTimestamp
public long getLastLedgerSwitchTimestamp() -
getState
-
getThrottleMarkDelete
public double getThrottleMarkDelete()从接口复制的说明:ManagedCursorReturns cursor throttle mark-delete rate.- 指定者:
getThrottleMarkDelete在接口中ManagedCursor- 返回:
-
setThrottleMarkDelete
public void setThrottleMarkDelete(double throttleMarkDelete) 从接口复制的说明:ManagedCursorUpdate throttle mark delete rate.- 指定者:
setThrottleMarkDelete在接口中ManagedCursor
-
getManagedLedger
从接口复制的说明:ManagedCursorGetManagedLedgerattached with cursor.- 指定者:
getManagedLedger在接口中ManagedCursor- 返回:
- ManagedLedger
-
getLastIndividualDeletedRange
从接口复制的说明:ManagedCursorGet last individual deleted range.- 指定者:
getLastIndividualDeletedRange在接口中ManagedCursor- 返回:
- range
-
trimDeletedEntries
从接口复制的说明:ManagedCursorTrim delete entries for the given entries.- 指定者:
trimDeletedEntries在接口中ManagedCursor
-
getDeletedBatchIndexesAsLongArray
从接口复制的说明:ManagedCursorGet deleted batch indexes list for a batch message. -
getStats
- 指定者:
getStats在接口中ManagedCursor- 返回:
- the managed cursor stats MBean
-
checkAndUpdateReadPositionChanged
public boolean checkAndUpdateReadPositionChanged()从接口复制的说明:ManagedCursorChecks if read position changed since this method was called last time.- 指定者:
checkAndUpdateReadPositionChanged在接口中ManagedCursor- 返回:
- if read position changed
-
setState
-