Skip to content

Commit 2c92e6f

Browse files
authored
HBASE-27906 Fix the javadoc for SyncFutureCache (#5325)
1 parent 3353381 commit 2c92e6f

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()}. Usage pattern:
31-
* SyncFuture sf = syncFutureCache.getIfPresentOrNew(); sf.reset(...); // Use the sync future
32-
* finally: syncFutureCache.offer(sf); Offering the sync future back to the cache makes it eligible
33-
* for reuse within the same thread context. Cache keyed by the accessing thread instance and
34-
* 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)