public SyncFuture getIfPresentOrNew() {
    // Invalidate the entry if a mapping exists. We do not want it to be reused at the same time.
    SyncFuture future = syncFutureCache.asMap().remove(Thread.currentThread());
    return (future == null) ? new SyncFuture() : future;
  }
A cache of {@link SyncFuture}s. This class supports two methods
{@link SyncFutureCache#getIfPresentOrNew()} and {@link SyncFutureCache#offer(SyncFuture)}}.
<p>
Usage pattern:

<pre>
  SyncFuture sf = syncFutureCache.getIfPresentOrNew();
  sf.reset(...);
  // Use the sync future
  finally: syncFutureCache.offer(sf);
</pre>

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 {@link SyncFutureCache#SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS} minutes.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java