public class ManagedCursorImpl extends Object implements ManagedCursor
| Modifier and Type | Class and Description |
|---|---|
static interface |
ManagedCursorImpl.VoidCallback |
ManagedCursor.FindPositionConstraint, ManagedCursor.IndividualDeletedEntries| Modifier and Type | Field and Description |
|---|---|
protected BookKeeper |
bookkeeper |
protected ManagedLedgerConfig |
config |
static int |
FALSE |
protected static AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> |
LAST_MARK_DELETE_ENTRY_UPDATER |
protected org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry |
lastMarkDeleteEntry |
protected ManagedLedgerImpl |
ledger |
protected PositionImpl |
markDeletePosition |
protected ManagedCursorMXBean |
mbean |
protected long |
messagesConsumedCounter |
protected ArrayDeque<org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> |
pendingMarkDeleteOps |
protected PositionImpl |
persistentMarkDeletePosition |
protected static AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> |
READ_POSITION_UPDATER |
protected PositionImpl |
readPosition |
protected org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.State |
state |
protected PositionImpl |
statsLastReadPosition |
static int |
TRUE |
protected static AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.OpReadEntry> |
WAITING_READ_OP_UPDATER |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncClearBacklog(AsyncCallbacks.ClearBacklogCallback callback,
Object ctx)
Clear the cursor backlog.
|
void |
asyncClose(AsyncCallbacks.CloseCallback callback,
Object ctx)
Close the cursor asynchronously and release the associated resources.
|
void |
asyncDelete(Iterable<Position> positions,
AsyncCallbacks.DeleteCallback callback,
Object ctx)
Delete a group of messages asynchronously
Mark a group of messages for deletion.
|
void |
asyncDelete(Position pos,
AsyncCallbacks.DeleteCallback callback,
Object ctx)
Delete a single message asynchronously
Mark a single message for deletion.
|
void |
asyncFindNewestMatching(ManagedCursor.FindPositionConstraint constraint,
com.google.common.base.Predicate<Entry> condition,
AsyncCallbacks.FindEntryCallback callback,
Object ctx)
Find the newest entry that matches the given predicate.
|
void |
asyncGetNthEntry(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.
|
void |
asyncMarkDelete(Position position,
AsyncCallbacks.MarkDeleteCallback callback,
Object ctx)
Asynchronous mark delete.
|
void |
asyncMarkDelete(Position position,
Map<String,Long> properties,
AsyncCallbacks.MarkDeleteCallback callback,
Object ctx)
Asynchronous mark delete.
|
void |
asyncReadEntries(int numberOfEntriesToRead,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
Asynchronously read entries from the ManagedLedger.
|
void |
asyncReadEntries(int numberOfEntriesToRead,
long maxSizeBytes,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
Asynchronously read entries from the ManagedLedger.
|
void |
asyncReadEntriesOrWait(int numberOfEntriesToRead,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
Asynchronously read entries from the ManagedLedger.
|
void |
asyncReadEntriesOrWait(int maxEntries,
long maxSizeBytes,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
Asynchronously read entries from the ManagedLedger, up to the specified number and size.
|
Set<? extends Position> |
asyncReplayEntries(Set<? extends Position> positions,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx)
Async replays given positions: a.
|
Set<? extends Position> |
asyncReplayEntries(Set<? extends Position> positions,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
boolean sortEntries)
Read the specified set of positions from ManagedLedger.
|
void |
asyncResetCursor(Position newPos,
AsyncCallbacks.ResetCursorCallback callback)
reset the cursor to specified position to enable replay of messages.
|
void |
asyncSkipEntries(int numEntriesToSkip,
ManagedCursor.IndividualDeletedEntries deletedEntries,
AsyncCallbacks.SkipEntriesCallback callback,
Object ctx)
Skip n entries from the read position of this cursor.
|
boolean |
cancelPendingReadRequest()
Cancel a previously scheduled asyncReadEntriesOrWait operation.
|
boolean |
checkAndUpdateReadPositionChanged()
Checks if read position changed since this method was called last time.
|
void |
clearBacklog()
Clear the cursor backlog.
|
void |
close()
Close the cursor and releases the associated resources.
|
void |
delete(Iterable<Position> positions)
Delete a group of entries.
|
void |
delete(Position position)
Delete a single message.
|
Position |
findNewestMatching(ManagedCursor.FindPositionConstraint constraint,
com.google.common.base.Predicate<Entry> condition)
Find the newest entry that matches the given predicate.
|
Position |
findNewestMatching(com.google.common.base.Predicate<Entry> condition)
Find the newest entry that matches the given predicate.
|
long[] |
getBatchPositionAckSet(Position position) |
long |
getCursorLedger() |
long |
getCursorLedgerLastEntry() |
long[] |
getDeletedBatchIndexesAsLongArray(PositionImpl position)
Get deleted batch indexes list for a batch message.
|
long |
getEstimatedSizeSinceMarkDeletePosition()
Returns the estimated size of the unacknowledged backlog for this cursor
|
Position |
getFirstPosition()
Get the first position.
|
String |
getIndividuallyDeletedMessages() |
LongPairRangeSet<PositionImpl> |
getIndividuallyDeletedMessagesSet() |
long |
getLastActive()
Get the last active time of the cursor.
|
com.google.common.collect.Range<PositionImpl> |
getLastIndividualDeletedRange()
Get last individual deleted range
|
long |
getLastLedgerSwitchTimestamp() |
ManagedLedger |
getManagedLedger()
Get
ManagedLedger attached with cursor |
Position |
getMarkDeletedPosition()
Get the newest mark deleted position on this cursor.
|
long |
getMessagesConsumedCounter() |
String |
getName()
Get the unique cursor name.
|
PositionImpl |
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.
|
Position |
getNextLedgerPosition(long currentLedgerId) |
int |
getNonContiguousDeletedMessagesRangeSerializedSize()
Returns the serialized size of mark-Delete ranges.
|
Entry |
getNthEntry(int n,
ManagedCursor.IndividualDeletedEntries deletedEntries)
Get 'N'th entry from the mark delete position in the cursor without updating any cursor positions.
|
long |
getNumberOfEntries()
Return the number of messages that this cursor still has to read.
|
protected long |
getNumberOfEntries(com.google.common.collect.Range<PositionImpl> range) |
long |
getNumberOfEntriesInBacklog(boolean isPrecise)
Return the number of non-deleted messages on this cursor.
|
long |
getNumberOfEntriesInStorage() |
long |
getNumberOfEntriesSinceFirstNotAckedMessage()
Returns total number of entries from the first not-acked message to current dispatching position.
|
int |
getPendingReadOpsCount() |
Position |
getPersistentMarkDeletedPosition()
Get the persistent newest mark deleted position on this cursor.
|
Map<String,Long> |
getProperties()
Return any properties that were associated with the last stored position.
|
Position |
getReadPosition()
Get the read position.
|
String |
getState() |
ManagedCursorMXBean |
getStats() |
double |
getThrottleMarkDelete()
Returns cursor throttle mark-delete rate.
|
int |
getTotalNonContiguousDeletedMessagesRange()
Returns number of mark-Delete range.
|
boolean |
hasMoreEntries()
Tells whether this cursor has already consumed all the available entries.
|
boolean |
hasPendingReadRequest() |
protected void |
internalAsyncMarkDelete(PositionImpl newPosition,
Map<String,Long> properties,
AsyncCallbacks.MarkDeleteCallback callback,
Object ctx) |
protected void |
internalResetCursor(PositionImpl position,
AsyncCallbacks.ResetCursorCallback resetCursorCallback) |
boolean |
isActive()
Checks if cursor is active or not.
|
static boolean |
isBkErrorNotRecoverable(int rc)
return BK error codes that are considered not likely to be recoverable.
|
boolean |
isClosed()
Checks if the cursor is closed.
|
boolean |
isDurable()
Tells whether the cursor is durable or just kept in memory.
|
boolean |
isIndividuallyDeletedEntriesEmpty() |
boolean |
isMessageDeleted(Position position) |
void |
markDelete(Position position)
This signals that the reader is done with all the entries up to "position" (included).
|
void |
markDelete(Position position,
Map<String,Long> properties)
This signals that the reader is done with all the entries up to "position" (included).
|
boolean |
putProperty(String key,
Long value)
Add a property associated with the last stored position.
|
List<Entry> |
readEntries(int numberOfEntriesToRead)
Read entries from the ManagedLedger, up to the specified number.
|
List<Entry> |
readEntriesOrWait(int numberOfEntriesToRead)
Read entries from the ManagedLedger, up to the specified number.
|
List<Entry> |
readEntriesOrWait(int numberOfEntriesToRead,
long maxSizeBytes)
Read entries from the ManagedLedger, up to the specified number and size.
|
protected void |
recoverFromLedger(MLDataFormats.ManagedCursorInfo info,
ManagedCursorImpl.VoidCallback callback) |
boolean |
removeProperty(String key)
Remove a property associated with the last stored position.
|
List<Entry> |
replayEntries(Set<? extends Position> positions)
Read the specified set of positions from ManagedLedger.
|
void |
resetCursor(Position newPos)
reset the cursor to specified position to enable replay of messages.
|
void |
rewind()
Rewind the cursor to the mark deleted position to replay all the already read but not yet mark deleted messages.
|
void |
seek(Position newReadPositionInt,
boolean force) |
void |
setActive()
Activate cursor: EntryCacheManager caches entries only for activated-cursors.
|
void |
setAlwaysInactive()
A cursor that is set as always-inactive will never trigger the caching of
entries.
|
void |
setInactive()
Deactivate cursor.
|
void |
setThrottleMarkDelete(double throttleMarkDelete)
Update throttle mark delete rate.
|
void |
skipEntries(int numEntriesToSkip,
ManagedCursor.IndividualDeletedEntries deletedEntries)
Skip n entries from the read position of this cursor.
|
String |
toString() |
void |
trimDeletedEntries(List<Entry> entries)
Trim delete entries for the given entries
|
void |
updateLastActive()
Update the last active time of the cursor
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitseekprotected final BookKeeper bookkeeper
protected final ManagedLedgerConfig config
protected final ManagedLedgerImpl ledger
protected volatile PositionImpl markDeletePosition
protected volatile PositionImpl persistentMarkDeletePosition
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,PositionImpl> READ_POSITION_UPDATER
protected volatile PositionImpl readPosition
protected volatile PositionImpl statsLastReadPosition
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> LAST_MARK_DELETE_ENTRY_UPDATER
protected volatile org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry lastMarkDeleteEntry
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl,org.apache.bookkeeper.mledger.impl.OpReadEntry> WAITING_READ_OP_UPDATER
public static final int FALSE
public static final int TRUE
protected volatile long messagesConsumedCounter
protected final ArrayDeque<org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.MarkDeleteEntry> pendingMarkDeleteOps
protected volatile org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.State state
protected final ManagedCursorMXBean mbean
public Map<String,Long> getProperties()
ManagedCursorgetProperties in interface ManagedCursorpublic boolean putProperty(String key, Long value)
ManagedCursorputProperty in interface ManagedCursorpublic boolean removeProperty(String key)
ManagedCursorremoveProperty in interface ManagedCursorprotected void recoverFromLedger(MLDataFormats.ManagedCursorInfo info, ManagedCursorImpl.VoidCallback callback)
public List<Entry> readEntries(int numberOfEntriesToRead) throws InterruptedException, ManagedLedgerException
ManagedCursorreadEntries in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returnManagedLedgerExceptionInterruptedExceptionpublic void asyncReadEntries(int numberOfEntriesToRead,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
ManagedCursorasyncReadEntries in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returncallback - callback objectctx - opaque contextmaxPosition - max position can readManagedCursor.readEntries(int)public void asyncReadEntries(int numberOfEntriesToRead,
long maxSizeBytes,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
ManagedCursorasyncReadEntries in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returnmaxSizeBytes - max size in bytes of the entries to returncallback - callback objectctx - opaque contextmaxPosition - max position can readpublic Entry getNthEntry(int n, ManagedCursor.IndividualDeletedEntries deletedEntries) throws InterruptedException, ManagedLedgerException
ManagedCursorgetNthEntry in interface ManagedCursorn - entry positiondeletedEntries - skip individual deleted entriesInterruptedExceptionManagedLedgerExceptionpublic void asyncGetNthEntry(int n,
ManagedCursor.IndividualDeletedEntries deletedEntries,
AsyncCallbacks.ReadEntryCallback callback,
Object ctx)
ManagedCursorasyncGetNthEntry in interface ManagedCursorn - entry positiondeletedEntries - skip individual deleted entriespublic List<Entry> readEntriesOrWait(int numberOfEntriesToRead) throws InterruptedException, ManagedLedgerException
ManagedCursorreadEntriesOrWait in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returnManagedLedgerExceptionInterruptedExceptionpublic List<Entry> readEntriesOrWait(int numberOfEntriesToRead, long maxSizeBytes) throws InterruptedException, ManagedLedgerException
ManagedCursorreadEntriesOrWait in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returnmaxSizeBytes - max size in bytes of the entries to returnManagedLedgerExceptionInterruptedExceptionpublic void asyncReadEntriesOrWait(int numberOfEntriesToRead,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
ManagedCursorasyncReadEntriesOrWait in interface ManagedCursornumberOfEntriesToRead - maximum number of entries to returncallback - callback objectctx - opaque contextmaxPosition - max position can readManagedCursor.readEntriesOrWait(int)public void asyncReadEntriesOrWait(int maxEntries,
long maxSizeBytes,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx,
PositionImpl maxPosition)
ManagedCursorasyncReadEntriesOrWait in interface ManagedCursormaxEntries - maximum number of entries to returnmaxSizeBytes - max size in bytes of the entries to returncallback - callback objectctx - opaque contextmaxPosition - max position can readManagedCursor.readEntriesOrWait(int, long)public boolean isClosed()
ManagedCursorisClosed in interface ManagedCursorpublic boolean cancelPendingReadRequest()
ManagedCursorcancelPendingReadRequest in interface ManagedCursor#asyncReadEntriesOrWait(int, ReadEntriesCallback, Object, PositionImpl)public boolean hasPendingReadRequest()
public boolean hasMoreEntries()
ManagedCursorhasMoreEntries in interface ManagedCursorpublic long getNumberOfEntries()
ManagedCursorgetNumberOfEntries in interface ManagedCursorpublic long getNumberOfEntriesSinceFirstNotAckedMessage()
ManagedCursorgetNumberOfEntriesSinceFirstNotAckedMessage in interface ManagedCursorpublic int getTotalNonContiguousDeletedMessagesRange()
ManagedCursorgetTotalNonContiguousDeletedMessagesRange in interface ManagedCursorpublic int getNonContiguousDeletedMessagesRangeSerializedSize()
ManagedCursorgetNonContiguousDeletedMessagesRangeSerializedSize in interface ManagedCursorpublic long getEstimatedSizeSinceMarkDeletePosition()
ManagedCursorgetEstimatedSizeSinceMarkDeletePosition in interface ManagedCursorpublic long getNumberOfEntriesInBacklog(boolean isPrecise)
ManagedCursorgetNumberOfEntriesInBacklog in interface ManagedCursorisPrecise - set to true to get precise backlog countpublic long getNumberOfEntriesInStorage()
public Position findNewestMatching(com.google.common.base.Predicate<Entry> condition) throws InterruptedException, ManagedLedgerException
ManagedCursorfindNewestMatching in interface ManagedCursorcondition - predicate that reads an entry an applies a conditionInterruptedExceptionManagedLedgerExceptionpublic Position findNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition) throws InterruptedException, ManagedLedgerException
ManagedCursorfindNewestMatching in interface ManagedCursorconstraint - search only active entries or all entriescondition - predicate that reads an entry an applies a conditionInterruptedExceptionManagedLedgerExceptionpublic void asyncFindNewestMatching(ManagedCursor.FindPositionConstraint constraint, com.google.common.base.Predicate<Entry> condition, AsyncCallbacks.FindEntryCallback callback, Object ctx)
ManagedCursorasyncFindNewestMatching in interface ManagedCursorconstraint - search only active entries or all entriescondition - predicate that reads an entry an applies a conditioncallback - callback object returning the resultant positionctx - opaque contextpublic void setActive()
ManagedCursorsetActive in interface ManagedCursorpublic boolean isActive()
ManagedCursorisActive in interface ManagedCursorpublic void setInactive()
ManagedCursorsetInactive in interface ManagedCursorpublic void setAlwaysInactive()
ManagedCursorsetAlwaysInactive in interface ManagedCursorpublic Position getFirstPosition()
ManagedCursorgetFirstPosition in interface ManagedCursorprotected void internalResetCursor(PositionImpl position, AsyncCallbacks.ResetCursorCallback resetCursorCallback)
public void asyncResetCursor(Position newPos, AsyncCallbacks.ResetCursorCallback callback)
ManagedCursorasyncResetCursor in interface ManagedCursornewPos - position to move the cursor tocallback - callback objectpublic void resetCursor(Position newPos) throws ManagedLedgerException, InterruptedException
ManagedCursorresetCursor in interface ManagedCursornewPos - position to move the cursor toManagedLedgerExceptionInterruptedExceptionpublic List<Entry> replayEntries(Set<? extends Position> positions) throws InterruptedException, ManagedLedgerException
ManagedCursorreplayEntries in interface ManagedCursorpositions - set of positions to readInterruptedExceptionManagedLedgerExceptionpublic Set<? extends Position> asyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx)
asyncReplayEntries in interface ManagedCursorpositions - set of positions to readcallback - callback object returning the list of entriesctx - opaque contextpublic Set<? extends Position> asyncReplayEntries(Set<? extends Position> positions, AsyncCallbacks.ReadEntriesCallback callback, Object ctx, boolean sortEntries)
ManagedCursorasyncReplayEntries in interface ManagedCursorpositions - set of positions to readcallback - callback object returning the list of entriesctx - opaque contextsortEntries - callback with sorted entry list.protected long getNumberOfEntries(com.google.common.collect.Range<PositionImpl> range)
public void markDelete(Position position) throws InterruptedException, ManagedLedgerException
ManagedCursormarkDelete in interface ManagedCursorposition - the last position that have been successfully consumedManagedLedgerExceptionInterruptedExceptionpublic void markDelete(Position position, Map<String,Long> properties) throws InterruptedException, ManagedLedgerException
ManagedCursormarkDelete in interface ManagedCursorposition - the last position that have been successfully consumedproperties - additional user-defined properties that can be associated with a particular cursor positionManagedLedgerExceptionInterruptedExceptionpublic void clearBacklog()
throws InterruptedException,
ManagedLedgerException
ManagedCursorclearBacklog in interface ManagedCursorInterruptedExceptionManagedLedgerExceptionpublic void asyncClearBacklog(AsyncCallbacks.ClearBacklogCallback callback, Object ctx)
ManagedCursorasyncClearBacklog in interface ManagedCursorcallback - callback objectctx - opaque contextpublic void skipEntries(int numEntriesToSkip,
ManagedCursor.IndividualDeletedEntries deletedEntries)
throws InterruptedException,
ManagedLedgerException
ManagedCursorskipEntries in interface ManagedCursornumEntriesToSkip - number of entries to skipdeletedEntries - skip individual deleted entriesInterruptedExceptionManagedLedgerExceptionpublic void asyncSkipEntries(int numEntriesToSkip,
ManagedCursor.IndividualDeletedEntries deletedEntries,
AsyncCallbacks.SkipEntriesCallback callback,
Object ctx)
ManagedCursorasyncSkipEntries in interface ManagedCursornumEntriesToSkip - number of entries to skipdeletedEntries - skip individual deleted entriescallback - callback objectctx - opaque contextpublic void asyncMarkDelete(Position position, AsyncCallbacks.MarkDeleteCallback callback, Object ctx)
ManagedCursorasyncMarkDelete in interface ManagedCursorposition - the last position that have been successfully consumedcallback - callback objectctx - opaque contextManagedCursor.markDelete(Position)public void asyncMarkDelete(Position position, Map<String,Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx)
ManagedCursorasyncMarkDelete in interface ManagedCursorposition - the last position that have been successfully consumedproperties - additional user-defined properties that can be associated with a particular cursor positioncallback - callback objectctx - opaque contextManagedCursor.markDelete(Position)protected void internalAsyncMarkDelete(PositionImpl newPosition, Map<String,Long> properties, AsyncCallbacks.MarkDeleteCallback callback, Object ctx)
public void delete(Position position) throws InterruptedException, ManagedLedgerException
ManagedCursordelete in interface ManagedCursorposition - the position of the message to be deletedInterruptedExceptionManagedLedgerExceptionpublic void asyncDelete(Position pos, AsyncCallbacks.DeleteCallback callback, Object ctx)
ManagedCursorasyncDelete in interface ManagedCursorpos - the position of the message to be deletedcallback - callback objectctx - opaque contextpublic void delete(Iterable<Position> positions) throws InterruptedException, ManagedLedgerException
ManagedCursordelete in interface ManagedCursorpositions - positions of the messages to be deletedInterruptedExceptionManagedLedgerExceptionpublic void asyncDelete(Iterable<Position> positions, AsyncCallbacks.DeleteCallback callback, Object ctx)
ManagedCursorasyncDelete in interface ManagedCursorpositions - the positions of the messages to be deletedcallback - callback objectctx - opaque contextpublic String getName()
ManagedCursorgetName in interface ManagedCursorpublic long getLastActive()
ManagedCursorgetLastActive in interface ManagedCursorpublic void updateLastActive()
ManagedCursorupdateLastActive in interface ManagedCursorpublic boolean isDurable()
ManagedCursorisDurable in interface ManagedCursorpublic Position getReadPosition()
ManagedCursorgetReadPosition in interface ManagedCursorpublic Position getMarkDeletedPosition()
ManagedCursorgetMarkDeletedPosition in interface ManagedCursorpublic Position getPersistentMarkDeletedPosition()
ManagedCursorgetPersistentMarkDeletedPosition in interface ManagedCursorpublic void rewind()
ManagedCursorrewind in interface ManagedCursorpublic void seek(Position newReadPositionInt, boolean force)
seek in interface ManagedCursorpublic void close()
throws InterruptedException,
ManagedLedgerException
ManagedCursorclose in interface ManagedCursorInterruptedExceptionManagedLedgerExceptionpublic void asyncClose(AsyncCallbacks.CloseCallback callback, Object ctx)
ManagedCursorasyncClose in interface ManagedCursorcallback - callback objectctx - opaque contextpublic static boolean isBkErrorNotRecoverable(int rc)
public int getPendingReadOpsCount()
public long getMessagesConsumedCounter()
public long getCursorLedger()
public long getCursorLedgerLastEntry()
public String getIndividuallyDeletedMessages()
public LongPairRangeSet<PositionImpl> getIndividuallyDeletedMessagesSet()
public boolean isMessageDeleted(Position position)
public long[] getBatchPositionAckSet(Position position)
public PositionImpl getNextAvailablePosition(PositionImpl position)
position - public Position getNextLedgerPosition(long currentLedgerId)
public boolean isIndividuallyDeletedEntriesEmpty()
public long getLastLedgerSwitchTimestamp()
public String getState()
public double getThrottleMarkDelete()
ManagedCursorgetThrottleMarkDelete in interface ManagedCursorpublic void setThrottleMarkDelete(double throttleMarkDelete)
ManagedCursorsetThrottleMarkDelete in interface ManagedCursorpublic ManagedLedger getManagedLedger()
ManagedCursorManagedLedger attached with cursorgetManagedLedger in interface ManagedCursorpublic com.google.common.collect.Range<PositionImpl> getLastIndividualDeletedRange()
ManagedCursorgetLastIndividualDeletedRange in interface ManagedCursorpublic void trimDeletedEntries(List<Entry> entries)
ManagedCursortrimDeletedEntries in interface ManagedCursorpublic long[] getDeletedBatchIndexesAsLongArray(PositionImpl position)
ManagedCursorgetDeletedBatchIndexesAsLongArray in interface ManagedCursorpublic ManagedCursorMXBean getStats()
getStats in interface ManagedCursorpublic boolean checkAndUpdateReadPositionChanged()
ManagedCursorcheckAndUpdateReadPositionChanged in interface ManagedCursorCopyright © 2017–2022 Apache Software Foundation. All rights reserved.