@InterfaceAudience.Private public final class SyncFutureCache extends Object
SyncFuture
s. This class supports two methods
getIfPresentOrNew()
and offer(SyncFuture)
. Usage
pattern: SyncFuture sf = syncFutureCache.getIfPresentOrNew(); sf.reset(...); // Use the sync
future finally: syncFutureCache.offer(sf); Offering the sync future back to the cache makes it
eligible for reuse within the same thread context. Cache keyed by the accessing thread instance
and automatically invalidated if it remains unused for
SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS
minutes.Modifier and Type | Field and Description |
---|---|
private static long |
SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS |
private org.apache.hbase.thirdparty.com.google.common.cache.Cache<Thread,SyncFuture> |
syncFutureCache |
Constructor and Description |
---|
SyncFutureCache(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
SyncFuture |
getIfPresentOrNew() |
void |
offer(SyncFuture syncFuture)
Offers the sync future back to the cache for reuse.
|
private static final long SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS
private final org.apache.hbase.thirdparty.com.google.common.cache.Cache<Thread,SyncFuture> syncFutureCache
public SyncFutureCache(org.apache.hadoop.conf.Configuration conf)
public SyncFuture getIfPresentOrNew()
public void offer(SyncFuture syncFuture)
public void clear()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.