protected static class OsmSegmenter.OpenRandomAccessFileCache extends java.util.LinkedHashMap<java.lang.String,MultiBufferedRandomAccessFile>
Modifier | Constructor and Description |
---|---|
protected |
OpenRandomAccessFileCache(java.io.PrintStream out)
Create a cache for opened random access files.
|
Modifier and Type | Method and Description |
---|---|
int |
getHoldingLimit()
Get the current maximum number of open file allowed in the cache.
|
void |
reduceHoldingLimit(int reserve)
Reduces the holding limit to 'reserve' less than the map size.
|
protected boolean |
removeEldestEntry(java.util.Map.Entry<java.lang.String,MultiBufferedRandomAccessFile> eldest)
Returns true if this map should remove its eldest entry.
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
protected OpenRandomAccessFileCache(java.io.PrintStream out)
out
- PrintStream to write debugging logging messages toprotected boolean removeEldestEntry(java.util.Map.Entry<java.lang.String,MultiBufferedRandomAccessFile> eldest)
removeEldestEntry
in class java.util.LinkedHashMap<java.lang.String,MultiBufferedRandomAccessFile>
eldest
- The least recently accessed
entry. This is the entry that will be removed it this
method returns true. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.public void reduceHoldingLimit(int reserve)
reserve
- int quantity to lower the limit relative to the current size if an IOException occurs
trying to open a new file to put in the cachepublic int getHoldingLimit()