Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ public long size() {
return cache.size();
}

public boolean isEmpty() {
return cache.isEmpty();
}

synchronized Iterator<Map.Entry<Bytes, LRUNode>> subMapIterator(final Bytes from, final Bytes to) {
return cache.subMap(from, true, to, true).entrySet().iterator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public MemoryLRUCacheBytesIterator all(final String namespace) {
}
return new MemoryLRUCacheBytesIterator(cache.allIterator());
}

public long size() {
long size = 0;
for (final NamedCache cache : caches.values()) {
Expand Down Expand Up @@ -235,7 +235,7 @@ private void maybeEvict(final String namespace) {
// a put on another cache. So even though the sizeInBytes() is
// still > maxCacheSizeBytes there is nothing to evict from this
// namespaced cache.
if (cache.size() == 0) {
if (cache.isEmpty()) {
return;
}
cache.evict();
Expand Down