Class PersistentDiskCache

    • Field Detail

      • DEFAULT_MAX_CACHE_SIZE_MB

        public static final int DEFAULT_MAX_CACHE_SIZE_MB
        See Also:
        Constant Field Values
      • DEFAULT_TEMP_FILES_CLEANUP_WAIT_TIME_MS

        public static final long DEFAULT_TEMP_FILES_CLEANUP_WAIT_TIME_MS
        See Also:
        Constant Field Values
    • Constructor Detail

      • PersistentDiskCache

        public PersistentDiskCache​(java.io.File directory,
                                   int cacheMaxSizeMB,
                                   IOMonitor diskCacheIOMonitor)
      • PersistentDiskCache

        public PersistentDiskCache​(java.io.File directory,
                                   int cacheMaxSizeMB,
                                   IOMonitor diskCacheIOMonitor,
                                   long tempFilesCleanupWaitTimeMs)
    • Method Detail

      • containsSegment

        public boolean containsSegment​(long msb,
                                       long lsb)
        Description copied from interface: PersistentCache
        Check if the segment exists in the cache.
        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.
        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.)