Class SyncFutureCache

java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.SyncFutureCache

@Private public final class SyncFutureCache extends Object
A cache of SyncFutures. 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.