Package org.geotools.io
Class MemoryMappedFileCache
Object
MemoryMappedFileCache
- All Implemented Interfaces:
FileCacheIF
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentHashMap<Object,MemoryMappedFileCache.CacheElement> protected static final Loggerprotected final AtomicIntegerprotected final ConcurrentHashMap<FileCacheable,MemoryMappedFileCache.CacheElement.CacheFile> protected final intprotected final AtomicBooleanprotected final AtomicIntegerprotected static final Loggerprotected final intprotected final AtomicIntegerprotected Stringprotected final longprotected final intprotected ConcurrentHashMap<Object,MemoryMappedFileCache.CacheTracking> protected boolean -
Constructor Summary
ConstructorsConstructorDescriptionMemoryMappedFileCache(int minElementsInMemory, int maxElementsInMemory, int period) MemoryMappedFileCache(int minElementsInMemory, int softLimit, int hardLimit, int period) MemoryMappedFileCache(String name, int minElementsInMemory, int softLimit, int hardLimit, int period) -
Method Summary
Modifier and TypeMethodDescriptionFileCacheableacquire(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) FileCacheableacquire(FileFactory factory, DatasetUrl durl) protected voidaddRaf(String uriString, MemoryMappedRandomAccessFile mmraf) voidclearCache(boolean force) voiddisable()voidvoidenable()booleanrelease(FileCacheable ncfile) voidvoidvoidvoidshowTracking(Formatter format) static voidshutdown()
-
Field Details
-
log
protected static final Logger log -
cacheLog
protected static final Logger cacheLog -
name
-
softLimit
protected final int softLimit -
minElements
protected final int minElements -
hardLimit
protected final int hardLimit -
period
protected final long period -
hasScheduled
-
cache
-
files
-
cleanups
-
hits
-
miss
-
track
-
trackAll
protected boolean trackAll
-
-
Constructor Details
-
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 Details
-
shutdown
public static void shutdown() -
addRaf
-
disable
public void disable()- Specified by:
disablein interfaceFileCacheIF
-
enable
public void enable()- Specified by:
enablein interfaceFileCacheIF
-
acquire
- Specified by:
acquirein interfaceFileCacheIF- Throws:
IOException
-
acquire
public FileCacheable acquire(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) throws IOException - Specified by:
acquirein interfaceFileCacheIF- Throws:
IOException
-
eject
- Specified by:
ejectin interfaceFileCacheIF
-
release
- Specified by:
releasein interfaceFileCacheIF- Throws:
IOException
-
clearCache
public void clearCache(boolean force) - Specified by:
clearCachein interfaceFileCacheIF
-
showCache
- Specified by:
showCachein interfaceFileCacheIF
-
showCache
- Specified by:
showCachein interfaceFileCacheIF
-
showStats
- Specified by:
showStatsin interfaceFileCacheIF
-
showTracking
- Specified by:
showTrackingin interfaceFileCacheIF
-
resetTracking
public void resetTracking()- Specified by:
resetTrackingin interfaceFileCacheIF
-