Class DelegatingPersistentCache

    • Constructor Detail

      • DelegatingPersistentCache

        public DelegatingPersistentCache()
    • Method Detail

      • readSegment

        @Nullable
        public @Nullable Buffer readSegment​(long msb,
                                            long lsb,
                                            @NotNull
                                            @NotNull Callable<Buffer> loader)
        Description copied from interface: PersistentCache
        Reads the segment from cache.
        Specified by:
        readSegment in interface PersistentCache
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        loader - in case of cache miss, with loader.call() missing element will be retrieved
        Returns:
        byte buffer containing the segment data or null if the segment doesn't exist
      • containsSegment

        public boolean containsSegment​(long msb,
                                       long lsb)
        Description copied from interface: PersistentCache
        Check if the segment exists in the cache.
        Specified by:
        containsSegment in interface PersistentCache
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        Returns:
        true if the segment exists
      • writeSegment

        public void writeSegment​(long msb,
                                 long lsb,
                                 Buffer buffer)
        Description copied from interface: PersistentCache
        Writes the segment to the cache.
        Specified by:
        writeSegment in interface PersistentCache
        Parameters:
        msb - the most significant bits of the identifier of the segment
        lsb - the least significant bits of the identifier of the segment
        buffer - the byte buffer containing the segment data
      • cleanUp

        public void cleanUp()
        Description copied from interface: PersistentCache
        Purges the cache entries according to the implementation policy (e.g. maximum cache size, maximum number of entries, etc.)
        Specified by:
        cleanUp in interface PersistentCache