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 Logger
protected final AtomicInteger
protected final ConcurrentHashMap<FileCacheable,
MemoryMappedFileCache.CacheElement.CacheFile> protected final int
protected final AtomicBoolean
protected final AtomicInteger
protected static final Logger
protected final int
protected final AtomicInteger
protected String
protected final long
protected final int
protected 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 TypeMethodDescriptionFileCacheable
acquire
(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) FileCacheable
acquire
(FileFactory factory, DatasetUrl durl) protected void
addRaf
(String uriString, MemoryMappedRandomAccessFile mmraf) void
clearCache
(boolean force) void
disable()
void
void
enable()
boolean
release
(FileCacheable ncfile) void
void
void
void
showTracking
(Formatter format) static void
shutdown()
-
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:
disable
in interfaceFileCacheIF
-
enable
public void enable()- Specified by:
enable
in interfaceFileCacheIF
-
acquire
- Specified by:
acquire
in interfaceFileCacheIF
- 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 interfaceFileCacheIF
- Throws:
IOException
-
eject
- Specified by:
eject
in interfaceFileCacheIF
-
release
- Specified by:
release
in interfaceFileCacheIF
- Throws:
IOException
-
clearCache
public void clearCache(boolean force) - Specified by:
clearCache
in interfaceFileCacheIF
-
showCache
- Specified by:
showCache
in interfaceFileCacheIF
-
showCache
- Specified by:
showCache
in interfaceFileCacheIF
-
showStats
- Specified by:
showStats
in interfaceFileCacheIF
-
showTracking
- Specified by:
showTracking
in interfaceFileCacheIF
-
resetTracking
public void resetTracking()- Specified by:
resetTracking
in interfaceFileCacheIF
-