类 RangeEntryCacheImpl

java.lang.Object
org.apache.bookkeeper.mledger.impl.cache.RangeEntryCacheImpl
所有已实现的接口:
Comparable<EntryCache>, EntryCache

public class RangeEntryCacheImpl extends Object implements EntryCache
Cache data payload for entries of all ledgers.
  • 字段详细资料

    • ALLOCATOR

      public static final io.netty.buffer.PooledByteBufAllocator ALLOCATOR
  • 构造器详细资料

  • 方法详细资料

    • getName

      public String getName()
      指定者:
      getName 在接口中 EntryCache
      返回:
      the name of the cache
    • insert

      public boolean insert(EntryImpl entry)
      从接口复制的说明: EntryCache
      Insert an entry in the cache.

      If the overall limit have been reached, this will triggered the eviction of other entries, possibly from other EntryCache instances

      指定者:
      insert 在接口中 EntryCache
      参数:
      entry - the entry to be cached
      返回:
      whether the entry was inserted in cache
    • invalidateEntries

      public void invalidateEntries(PositionImpl lastPosition)
      从接口复制的说明: EntryCache
      Remove from cache all the entries related to a ledger up to lastPosition included.
      指定者:
      invalidateEntries 在接口中 EntryCache
      参数:
      lastPosition - the position of the last entry to be invalidated (non-inclusive)
    • invalidateAllEntries

      public void invalidateAllEntries(long ledgerId)
      从接口复制的说明: EntryCache
      Remove from the cache all the entries belonging to a specific ledger.
      指定者:
      invalidateAllEntries 在接口中 EntryCache
      参数:
      ledgerId - the ledger id
    • asyncReadEntry

      public void asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh, PositionImpl position, AsyncCallbacks.ReadEntryCallback callback, Object ctx)
      从接口复制的说明: EntryCache
      Read entry at given position from the cache or from bookkeeper.

      Get the entry data either from cache or bookkeeper and mixes up the results in a single list.

      指定者:
      asyncReadEntry 在接口中 EntryCache
      参数:
      lh - the ledger handle
      position - position to read the entry from
      callback - the callback object that will be notified when read is done
      ctx - the context object
    • asyncReadEntry

      public void asyncReadEntry(org.apache.bookkeeper.client.api.ReadHandle lh, long firstEntry, long lastEntry, boolean isSlowestReader, AsyncCallbacks.ReadEntriesCallback callback, Object ctx)
      从接口复制的说明: EntryCache
      Read entries from the cache or from bookkeeper.

      Get the entry data either from cache or bookkeeper and mixes up the results in a single list.

      指定者:
      asyncReadEntry 在接口中 EntryCache
      参数:
      lh - the ledger handle
      firstEntry - 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 stream
      callback - the callback object that will be notified when read is done
      ctx - the context object
    • clear

      public void clear()
      从接口复制的说明: EntryCache
      Remove all the entries from the cache.
      指定者:
      clear 在接口中 EntryCache
    • getSize

      public long getSize()
      从接口复制的说明: EntryCache
      Get the total size in bytes of all the entries stored in this cache.
      指定者:
      getSize 在接口中 EntryCache
      返回:
      the size of the entry cache
    • compareTo

      public int compareTo(EntryCache other)
      指定者:
      compareTo 在接口中 Comparable<EntryCache>
    • evictEntries

      public org.apache.commons.lang3.tuple.Pair<Integer,Long> evictEntries(long sizeToFree)
      从接口复制的说明: EntryCache
      Force the cache to drop entries to free space.
      指定者:
      evictEntries 在接口中 EntryCache
      参数:
      sizeToFree - the total memory size to free
      返回:
      a pair containing the number of entries evicted and their total size
    • invalidateEntriesBeforeTimestamp

      public void invalidateEntriesBeforeTimestamp(long timestamp)
      指定者:
      invalidateEntriesBeforeTimestamp 在接口中 EntryCache