public interface EntryCache extends Comparable<EntryCache>
| Modifier and Type | Method and Description |
|---|---|
void |
asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh,
long firstEntry,
long lastEntry,
boolean isSlowestReader,
AsyncCallbacks.ReadEntriesCallback callback,
Object ctx)
Read entries from the cache or from bookkeeper.
|
void |
asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh,
PositionImpl position,
AsyncCallbacks.ReadEntryCallback callback,
Object ctx)
Read entry at given position from the cache or from bookkeeper.
|
void |
clear()
Remove all the entries from the cache.
|
org.apache.commons.lang3.tuple.Pair<Integer,Long> |
evictEntries(long sizeToFree)
Force the cache to drop entries to free space.
|
String |
getName() |
long |
getSize()
Get the total size in bytes of all the entries stored in this cache.
|
boolean |
insert(EntryImpl entry)
Insert an entry in the cache.
|
void |
invalidateAllEntries(long ledgerId)
Remove from the cache all the entries belonging to a specific ledger.
|
void |
invalidateEntries(PositionImpl lastPosition)
Remove from cache all the entries related to a ledger up to lastPosition included.
|
void |
invalidateEntriesBeforeTimestamp(long timestamp) |
compareToString getName()
boolean insert(EntryImpl entry)
entry - the entry to be cachedvoid invalidateEntries(PositionImpl lastPosition)
lastPosition - the position of the last entry to be invalidated (non-inclusive)void invalidateEntriesBeforeTimestamp(long timestamp)
void invalidateAllEntries(long ledgerId)
ledgerId - the ledger idvoid clear()
org.apache.commons.lang3.tuple.Pair<Integer,Long> evictEntries(long sizeToFree)
sizeToFree - the total memory size to freevoid asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh, long firstEntry, long lastEntry, boolean isSlowestReader, AsyncCallbacks.ReadEntriesCallback callback, Object ctx)
lh - the ledger handlefirstEntry - the first entry to read (inclusive)lastEntry - the last entry to read (inclusive)isSlowestReader - whether the reader cursor is the most far behind in the streamcallback - the callback object that will be notified when read is donectx - the context objectvoid asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh, PositionImpl position, AsyncCallbacks.ReadEntryCallback callback, Object ctx)
lh - the ledger handleposition - position to read the entry fromcallback - the callback object that will be notified when read is donectx - the context objectlong getSize()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.