@NotThreadSafe @VisibleForTesting public static class LookupCacheManager.RefCountedCache extends Object implements RefCounted
LookupCache
which also tracks the reference count of it.
This class is exposed as public for testing purpose and not thread safe. Concurrent
accesses should be guarded by synchronized methods provided by LookupCacheManager
.
Constructor and Description |
---|
RefCountedCache(LookupCache cache) |
Modifier and Type | Method and Description |
---|---|
LookupCache |
getCache() |
boolean |
release()
Decreases the reference counter.
|
void |
retain()
Increases the reference counter.
|
public RefCountedCache(LookupCache cache)
public void retain()
RefCounted
retain
in interface RefCounted
public boolean release()
RefCounted
release
in interface RefCounted
true
if the reference counter reached 0, false
otherwise.public LookupCache getCache()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.