|
@@ -69,7 +69,7 @@ class OpenFileCtxCache {
|
|
|
Iterator<Entry<FileHandle, OpenFileCtx>> it = openFileMap.entrySet()
|
|
|
.iterator();
|
|
|
if (LOG.isTraceEnabled()) {
|
|
|
- LOG.trace("openFileMap size:" + openFileMap.size());
|
|
|
+ LOG.trace("openFileMap size:" + size());
|
|
|
}
|
|
|
|
|
|
Entry<FileHandle, OpenFileCtx> idlest = null;
|
|
@@ -117,10 +117,10 @@ class OpenFileCtxCache {
|
|
|
boolean put(FileHandle h, OpenFileCtx context) {
|
|
|
OpenFileCtx toEvict = null;
|
|
|
synchronized (this) {
|
|
|
- Preconditions.checkState(openFileMap.size() <= this.maxStreams,
|
|
|
- "stream cache size " + openFileMap.size()
|
|
|
- + " is larger than maximum" + this.maxStreams);
|
|
|
- if (openFileMap.size() == this.maxStreams) {
|
|
|
+ Preconditions.checkState(size() <= this.maxStreams,
|
|
|
+ "stream cache size " + size() + " is larger than maximum" + this
|
|
|
+ .maxStreams);
|
|
|
+ if (size() == this.maxStreams) {
|
|
|
Entry<FileHandle, OpenFileCtx> pairs = getEntryToEvict();
|
|
|
if (pairs ==null) {
|
|
|
return false;
|
|
@@ -149,7 +149,7 @@ class OpenFileCtxCache {
|
|
|
Iterator<Entry<FileHandle, OpenFileCtx>> it = openFileMap.entrySet()
|
|
|
.iterator();
|
|
|
if (LOG.isTraceEnabled()) {
|
|
|
- LOG.trace("openFileMap size:" + openFileMap.size());
|
|
|
+ LOG.trace("openFileMap size:" + size());
|
|
|
}
|
|
|
|
|
|
while (it.hasNext()) {
|
|
@@ -168,7 +168,7 @@ class OpenFileCtxCache {
|
|
|
openFileMap.remove(handle);
|
|
|
if (LOG.isDebugEnabled()) {
|
|
|
LOG.debug("After remove stream " + handle.getFileId()
|
|
|
- + ", the stream number:" + openFileMap.size());
|
|
|
+ + ", the stream number:" + size());
|
|
|
}
|
|
|
ctxToRemove.add(ctx2);
|
|
|
}
|
|
@@ -201,7 +201,7 @@ class OpenFileCtxCache {
|
|
|
Iterator<Entry<FileHandle, OpenFileCtx>> it = openFileMap.entrySet()
|
|
|
.iterator();
|
|
|
if (LOG.isTraceEnabled()) {
|
|
|
- LOG.trace("openFileMap size:" + openFileMap.size());
|
|
|
+ LOG.trace("openFileMap size:" + size());
|
|
|
}
|
|
|
|
|
|
while (it.hasNext()) {
|