Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-8736: Streams performance improvement, use isEmpty() rather tha… #7164

Merged
merged 1 commit into from Aug 6, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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