ptupitsyn commented on a change in pull request #8174:
URL: https://github.com/apache/ignite/pull/8174#discussion_r492932098
##########
File path: modules/core/src/main/java/org/apache/ignite/client/ClientCache.java
##########
@@ -138,6 +218,27 @@
*/
public boolean replace(K key, V oldVal, V newVal) throws ClientException;
+ /**
+ * Atomically replaces the entry for a key only if currently mapped to a
given value.
+ * <p>
+ * This is equivalent to:
+ * <pre><code>
+ * if (cache.containsKey(key) && equals(cache.get(key), oldValue))
{
+ * cache.put(key, newValue);
+ * return true;
+ * } else {
+ * return false;
+ * }
+ * </code></pre>
+ * except that the action is performed atomically.
Review comment:
Good point, fixed here and in other places
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]