use of org.exist.util.io.FileFilterInputStreamCache in project exist by eXist-db.
the class BinaryValues method getCacheInstances.
@Override
public List<BinaryInputStreamCacheInfo> getCacheInstances() {
final FilterInputStreamCacheMonitor monitor = FilterInputStreamCacheMonitor.getInstance();
final Collection<FilterInputStreamCacheInfo> cacheInstances = monitor.getActive();
final List<BinaryInputStreamCacheInfo> results = new ArrayList<>();
for (final FilterInputStreamCacheInfo cacheInstance : cacheInstances) {
final BinaryInputStreamCacheInfo result;
final FilterInputStreamCache cache = cacheInstance.getCache();
if (cache instanceof FileFilterInputStreamCache) {
result = new BinaryInputStreamCacheInfo(CacheType.FILE, cacheInstance.getRegistered(), Optional.of(((FileFilterInputStreamCache) cache).getFilePath()), cache.getLength());
} else if (cache instanceof MemoryMappedFileFilterInputStreamCache) {
result = new BinaryInputStreamCacheInfo(CacheType.MEMORY_MAPPED_FILE, cacheInstance.getRegistered(), Optional.of(((MemoryMappedFileFilterInputStreamCache) cache).getFilePath()), cache.getLength());
} else {
result = new BinaryInputStreamCacheInfo(CacheType.MEMORY, cacheInstance.getRegistered(), Optional.empty(), cache.getLength());
}
results.add(result);
}
return results;
}
Aggregations