You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2023/07/20 13:48:09 UTC
[hbase] branch branch-2 updated: HBASE-27906 Fix the javadoc for SyncFutureCache (#5325)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 229d7709ebb HBASE-27906 Fix the javadoc for SyncFutureCache (#5325)
229d7709ebb is described below
commit 229d7709ebbb80d867fb21c50fbe507857e91e9d
Author: Dimitrios Efthymiou <ef...@gmail.com>
AuthorDate: Mon Jul 17 07:03:01 2023 +0100
HBASE-27906 Fix the javadoc for SyncFutureCache (#5325)
(cherry picked from commit 2c92e6fdce85cb02a4a5c2ecb714fd2efa30835c)
---
.../hbase/regionserver/wal/SyncFutureCache.java | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java
index 27b9f4769ea..f842cc3dabe 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java
@@ -27,12 +27,20 @@ import org.apache.hbase.thirdparty.com.google.common.cache.CacheBuilder;
/**
* 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 {