ololo3000 commented on a change in pull request #8692:
URL: https://github.com/apache/ignite/pull/8692#discussion_r563761670



##########
File path: modules/core/src/main/java/org/apache/ignite/client/ClientCache.java
##########
@@ -558,6 +575,47 @@
      */
     public IgniteClientFuture<Boolean> putIfAbsentAsync(K key, V val) throws 
ClientException;
 
+    /**
+     * Atomically associates the specified key with the given value if it is 
not already associated with a value.
+     * <p>
+     * This is equivalent to performing the following operations as a single 
atomic action:
+     * <pre><code>
+     * if (!cache.containsKey(key)) {}
+     *   cache.put(key, value);
+     *   return null;
+     * } else {
+     *   return cache.get(key);
+     * }
+     * </code></pre>
+     *
+     * @param key Key with which the specified value is to be associated.
+     * @param val Value to be associated with the specified key.
+     * @return Value that is already associated with the specified key, or 
{@code null} if no value was associated
+     * with the specified key and a value was set.
+     */
+    public V getAndPutIfAbsent(K key, V val) throws ClientException;
+
+    /**
+     * Atomically associates the specified key with the given value if it is 
not already associated with a value.
+     * <p>
+     * This is equivalent to performing the following operations as a single 
atomic action:
+     * <pre><code>
+     * if (!cache.containsKey(key)) {}

Review comment:
       Done.




----------------------------------------------------------------
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]


Reply via email to