Class EntryCacheManager.EntryCacheDisabled

    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface EntryCache
        Returns:
        the name of the cache
      • insert

        public boolean insert​(EntryImpl entry)
        Description copied from interface: 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

        Specified by:
        insert in interface EntryCache
        Parameters:
        entry - the entry to be cached
        Returns:
        whether the entry was inserted in cache
      • invalidateEntries

        public void invalidateEntries​(PositionImpl lastPosition)
        Description copied from interface: EntryCache
        Remove from cache all the entries related to a ledger up to lastPosition included.
        Specified by:
        invalidateEntries in interface EntryCache
        Parameters:
        lastPosition - the position of the last entry to be invalidated (non-inclusive)
      • invalidateAllEntries

        public void invalidateAllEntries​(long ledgerId)
        Description copied from interface: EntryCache
        Remove from the cache all the entries belonging to a specific ledger.
        Specified by:
        invalidateAllEntries in interface EntryCache
        Parameters:
        ledgerId - the ledger id
      • clear

        public void clear()
        Description copied from interface: EntryCache
        Remove all the entries from the cache.
        Specified by:
        clear in interface EntryCache
      • evictEntries

        public org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Long> evictEntries​(long sizeToFree)
        Description copied from interface: EntryCache
        Force the cache to drop entries to free space.
        Specified by:
        evictEntries in interface EntryCache
        Parameters:
        sizeToFree - the total memory size to free
        Returns:
        a pair containing the number of entries evicted and their total size
      • asyncReadEntry

        public void asyncReadEntry​(org.apache.bookkeeper.client.api.ReadHandle lh,
                                   long firstEntry,
                                   long lastEntry,
                                   boolean isSlowestReader,
                                   AsyncCallbacks.ReadEntriesCallback callback,
                                   java.lang.Object ctx)
        Description copied from interface: 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.

        Specified by:
        asyncReadEntry in interface EntryCache
        Parameters:
        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
      • asyncReadEntry

        public void asyncReadEntry​(org.apache.bookkeeper.client.api.ReadHandle lh,
                                   PositionImpl position,
                                   AsyncCallbacks.ReadEntryCallback callback,
                                   java.lang.Object ctx)
        Description copied from interface: 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.

        Specified by:
        asyncReadEntry in interface EntryCache
        Parameters:
        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
      • getSize

        public long getSize()
        Description copied from interface: EntryCache
        Get the total size in bytes of all the entries stored in this cache.
        Specified by:
        getSize in interface EntryCache
        Returns:
        the size of the entry cache
      • compareTo

        public int compareTo​(EntryCache other)
        Specified by:
        compareTo in interface java.lang.Comparable<EntryCache>