Skip to content
Closed
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,8 +25,7 @@
/**
* Add reference counter to an object instance.
*/
public class ReferenceCounted<T, U extends ReferenceCountedCallback>
implements AutoCloseable {
public class ReferenceCounted<T, U> implements AutoCloseable {

/**
* Object that is being reference counted. e.g. OmSnapshot
Expand Down Expand Up @@ -95,12 +94,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 +124,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 All @@ -153,7 +141,7 @@ public long getTotalRefCount() {
}

/**
* @return Number of times current thread has held reference to the object.
* @return Number of times the current thread has held reference to the object.
*/
public long getCurrentThreadRefCount() {
if (refCount == null || threadMap == null) {
Expand All @@ -166,7 +154,7 @@ public long getCurrentThreadRefCount() {

@Override
public void close() {
// Decrease ref count by 1 when close() is called on this object
// Decrease ref count by 1 when close() is called on this object,
// so it is eligible to be used with try-with-resources.
decrementRefCount();
}
Expand Down

This file was deleted.

Loading