Class MemoryMappedFileCache

  • All Implemented Interfaces:
    FileCacheIF

    @ThreadSafe
    public class MemoryMappedFileCache
    extends Object
    implements FileCacheIF
    • Field Detail

      • log

        protected static final Logger log
      • cacheLog

        protected static final Logger cacheLog
      • softLimit

        protected final int softLimit
      • minElements

        protected final int minElements
      • hardLimit

        protected final int hardLimit
      • period

        protected final long period
      • files

        protected final ConcurrentHashMap<FileCacheable,​MemoryMappedFileCache.CacheElement.CacheFile> files
      • trackAll

        protected boolean trackAll
    • Constructor Detail

      • MemoryMappedFileCache

        public MemoryMappedFileCache​(int minElementsInMemory,
                                     int maxElementsInMemory,
                                     int period)
      • MemoryMappedFileCache

        public MemoryMappedFileCache​(int minElementsInMemory,
                                     int softLimit,
                                     int hardLimit,
                                     int period)
      • MemoryMappedFileCache

        public MemoryMappedFileCache​(String name,
                                     int minElementsInMemory,
                                     int softLimit,
                                     int hardLimit,
                                     int period)
    • Method Detail

      • shutdown

        public static void shutdown()
      • disable

        public void disable()
        Specified by:
        disable in interface FileCacheIF
      • enable

        public void enable()
        Specified by:
        enable in interface FileCacheIF
      • acquire

        public FileCacheable acquire​(FileFactory factory,
                                     DatasetUrl durl)
                              throws IOException
        Specified by:
        acquire in interface FileCacheIF
        Throws:
        IOException
      • acquire

        public FileCacheable acquire​(FileFactory factory,
                                     Object hashKey,
                                     DatasetUrl location,
                                     int buffer_size,
                                     CancelTask cancelTask,
                                     Object spiObject)
                              throws IOException
        Specified by:
        acquire in interface FileCacheIF
        Throws:
        IOException
      • eject

        public void eject​(Object hashKey)
        Specified by:
        eject in interface FileCacheIF
      • release

        public boolean release​(FileCacheable ncfile)
                        throws IOException
        Specified by:
        release in interface FileCacheIF
        Throws:
        IOException
      • clearCache

        public void clearCache​(boolean force)
        Specified by:
        clearCache in interface FileCacheIF
      • showCache

        public void showCache​(Formatter format)
        Specified by:
        showCache in interface FileCacheIF
      • showCache

        public List<String> showCache()
        Specified by:
        showCache in interface FileCacheIF
      • showStats

        public void showStats​(Formatter format)
        Specified by:
        showStats in interface FileCacheIF
      • showTracking

        public void showTracking​(Formatter format)
        Specified by:
        showTracking in interface FileCacheIF
      • resetTracking

        public void resetTracking()
        Specified by:
        resetTracking in interface FileCacheIF