Skip to content

Commit

Permalink
HBASE-27906 Fix the javadoc for SyncFutureCache (apache#5325)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2c92e6f)
(cherry picked from commit a0c5c8e)
Change-Id: Icc4ae5282b1efc463f788c13eb88eed843a465f8
  • Loading branch information
orionlibs authored and Jenkins committed Jul 24, 2023
1 parent 40c7d7a commit 24bcfef
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@

/**
* A cache of {@link SyncFuture}s. This class supports two methods
* {@link SyncFutureCache#getIfPresentOrNew()} and {@link SyncFutureCache#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
* {@link SyncFutureCache#SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS} minutes.
* {@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.
*/
@InterfaceAudience.Private
public final class SyncFutureCache {
Expand Down

0 comments on commit 24bcfef

Please sign in to comment.