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

HDDS-10103. Simplified snapshotCache with just one ConcurrentHashMap. #5986

Merged
merged 2 commits into from
Jan 11, 2024
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 @@ -194,7 +194,6 @@ public void testMultipleSnapshotKeyReclaim() throws Exception {
// /vol1/bucket2/bucket2snap1 has been cleaned up from cache map
SnapshotCache snapshotCache = om.getOmSnapshotManager().getSnapshotCache();
assertEquals(2, snapshotCache.size());
assertEquals(2, snapshotCache.getPendingEvictionListSize());
}

@SuppressWarnings("checkstyle:MethodLength")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Add reference counter to an object instance.
*/
public class ReferenceCounted<T, U extends ReferenceCountedCallback>
aswinshakil marked this conversation as resolved.
Show resolved Hide resolved
public class ReferenceCounted<T, U>
implements AutoCloseable {

/**
Expand Down Expand Up @@ -95,12 +95,6 @@ public long incrementRefCount() {
long newValTotal = refCount.incrementAndGet();
Preconditions.checkState(newValTotal > 0L,
"Total reference count overflown");

if (refCount.get() == 1L) {
// ref count increased to one (from zero), remove from
// pendingEvictionList if added
parentWithCallback.callback(this);
}
}

return refCount.get();
Expand Down Expand Up @@ -131,11 +125,6 @@ public long decrementRefCount() {
long newValTotal = refCount.decrementAndGet();
Preconditions.checkState(newValTotal >= 0L,
"Total reference count underflow");

if (refCount.get() == 0L) {
// ref count decreased to zero, add to pendingEvictionList
parentWithCallback.callback(this);
}
}

return refCount.get();
Expand Down

This file was deleted.

Loading