This is an automated email from the ASF dual-hosted git repository.
kezhuw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git
The following commit(s) were added to refs/heads/master by this push:
new 1bd8450c6 Document read effects after SharedValue.setValue (#1261)
1bd8450c6 is described below
commit 1bd8450c6cfadb2267e22c8018aaa32ca22cc472
Author: Kezhu Wang <[email protected]>
AuthorDate: Tue Apr 8 14:44:59 2025 +0800
Document read effects after SharedValue.setValue (#1261)
Closes #1254.
---
.../org/apache/curator/framework/recipes/shared/SharedCount.java | 8 +++++++-
.../org/apache/curator/framework/recipes/shared/SharedValue.java | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java
index 2ecc528e4..b9de863cc 100644
---
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java
+++
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java
@@ -65,7 +65,10 @@ public class SharedCount implements Closeable,
SharedCountReader, Listenable<Sha
}
/**
- * Change the shared count value irrespective of its previous state
+ * Change the shared count value irrespective of its previous state.
+ *
+ * <p>Later {@link #getCount()} will get some more updated value, whether
that value is set
+ * by this session or a different one cannot be guaranteed though.
*
* @param newCount new value
* @throws Exception ZK errors, interruptions, etc.
@@ -100,6 +103,9 @@ public class SharedCount implements Closeable,
SharedCountReader, Listenable<Sha
* value is updated. i.e. if the count is not successful you can get the
updated value
* by calling {@link #getCount()}.
*
+ * <p>Later {@link #getCount()} will get some more updated value, whether
that value is set
+ * by this session or a different one cannot be guaranteed though.
+ *
* @param newCount the new value to attempt
* @return true if the change attempt was successful, false if not. If the
change
* was not successful, {@link #getCount()} will return the updated value
diff --git
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java
index ddb96fcc2..c52750c99 100644
---
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java
+++
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java
@@ -130,7 +130,10 @@ public class SharedValue implements Closeable,
SharedValueReader {
}
/**
- * Change the shared value irrespective of its previous state
+ * Change the shared value irrespective of its previous state.
+ *
+ * <p>Later {@link #getValue()} will get some more updated value, whether
that value is set
+ * by this session or a different one cannot be guaranteed though.
*
* @param newValue new value
* @throws Exception ZK errors, interruptions, etc.
@@ -168,6 +171,9 @@ public class SharedValue implements Closeable,
SharedValueReader {
* value is updated. i.e. if the value is not successful you can get the
updated value
* by calling {@link #getValue()}.
*
+ * <p>Later {@link #getValue()} will get some more updated value, whether
that value is set
+ * by this session or a different one cannot be guaranteed though.
+ *
* @param newValue the new value to attempt
* @return true if the change attempt was successful, false if not. If the
change
* was not successful, {@link #getValue()} will return the updated value