Skip to content

Commit 8556282

Browse files
orionlibsApache9
authored andcommitted
HBASE-27906 Fix the javadoc for SyncFutureCache (#5325)
(cherry picked from commit 2c92e6f)
1 parent 0ffa751 commit 8556282

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,20 @@
2727

2828
/**
2929
* A cache of {@link SyncFuture}s. This class supports two methods
30-
* {@link SyncFutureCache#getIfPresentOrNew()} and {@link SyncFutureCache#offer(SyncFuture)}. Usage
31-
* pattern: SyncFuture sf = syncFutureCache.getIfPresentOrNew(); sf.reset(...); // Use the sync
32-
* future finally: syncFutureCache.offer(sf); Offering the sync future back to the cache makes it
33-
* eligible for reuse within the same thread context. Cache keyed by the accessing thread instance
34-
* and automatically invalidated if it remains unused for
35-
* {@link SyncFutureCache#SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS} minutes.
30+
* {@link SyncFutureCache#getIfPresentOrNew()} and {@link SyncFutureCache#offer(SyncFuture)}}.
31+
* <p>
32+
* Usage pattern:
33+
*
34+
* <pre>
35+
* SyncFuture sf = syncFutureCache.getIfPresentOrNew();
36+
* sf.reset(...);
37+
* // Use the sync future
38+
* finally: syncFutureCache.offer(sf);
39+
* </pre>
40+
*
41+
* Offering the sync future back to the cache makes it eligible for reuse within the same thread
42+
* context. Cache keyed by the accessing thread instance and automatically invalidated if it remains
43+
* unused for {@link SyncFutureCache#SYNC_FUTURE_INVALIDATION_TIMEOUT_MINS} minutes.
3644
*/
3745
@InterfaceAudience.Private
3846
public final class SyncFutureCache {

0 commit comments

Comments
 (0)