Skip to content

Commit 1bd8450

Browse files
authored
Document read effects after SharedValue.setValue (#1261)
Closes #1254.
1 parent e4a4756 commit 1bd8450

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ public VersionedValue<Integer> getVersionedValue() {
6565
}
6666

6767
/**
68-
* Change the shared count value irrespective of its previous state
68+
* Change the shared count value irrespective of its previous state.
69+
*
70+
* <p>Later {@link #getCount()} will get some more updated value, whether that value is set
71+
* by this session or a different one cannot be guaranteed though.
6972
*
7073
* @param newCount new value
7174
* @throws Exception ZK errors, interruptions, etc.
@@ -100,6 +103,9 @@ public boolean trySetCount(int newCount) throws Exception {
100103
* value is updated. i.e. if the count is not successful you can get the updated value
101104
* by calling {@link #getCount()}.
102105
*
106+
* <p>Later {@link #getCount()} will get some more updated value, whether that value is set
107+
* by this session or a different one cannot be guaranteed though.
108+
*
103109
* @param newCount the new value to attempt
104110
* @return true if the change attempt was successful, false if not. If the change
105111
* was not successful, {@link #getCount()} will return the updated value

curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ public VersionedValue<byte[]> getVersionedValue() {
130130
}
131131

132132
/**
133-
* Change the shared value irrespective of its previous state
133+
* Change the shared value irrespective of its previous state.
134+
*
135+
* <p>Later {@link #getValue()} will get some more updated value, whether that value is set
136+
* by this session or a different one cannot be guaranteed though.
134137
*
135138
* @param newValue new value
136139
* @throws Exception ZK errors, interruptions, etc.
@@ -168,6 +171,9 @@ public boolean trySetValue(byte[] newValue) throws Exception {
168171
* value is updated. i.e. if the value is not successful you can get the updated value
169172
* by calling {@link #getValue()}.
170173
*
174+
* <p>Later {@link #getValue()} will get some more updated value, whether that value is set
175+
* by this session or a different one cannot be guaranteed though.
176+
*
171177
* @param newValue the new value to attempt
172178
* @return true if the change attempt was successful, false if not. If the change
173179
* was not successful, {@link #getValue()} will return the updated value

0 commit comments

Comments
 (0)