ololo3000 commented on a change in pull request #8692:
URL: https://github.com/apache/ignite/pull/8692#discussion_r563761891
##########
File path: modules/core/src/main/java/org/apache/ignite/client/ClientCache.java
##########
@@ -571,6 +629,32 @@
*/
public IgniteClientFuture<Void> clearAsync() throws ClientException;
+ /**
+ * Clears entry with specified key from the cache.
+ * In contrast to {@link #remove(Object)}}, this method does not notify
event listeners and cache writers.
+ */
+ public void clear(K key);
Review comment:
Done.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java
##########
@@ -570,6 +600,38 @@
);
}
+ /** {@inheritDoc} */
+ @Override public V getAndPutIfAbsent(K key, V val) throws ClientException {
+ if (key == null)
+ throw new NullPointerException("key");
+
+ if (val == null)
+ throw new NullPointerException("val");
+
+ return cacheSingleKeyOperation(
+ key,
+ ClientOperation.CACHE_GET_AND_PUT_IF_ABSENT,
+ req -> writeObject(req, val),
+ this::readObject
+ );
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteClientFuture<V> getAndPutIfAbsentAsync(K key, V
val) throws CacheException, TransactionException {
Review comment:
Done.
##########
File path: modules/core/src/main/java/org/apache/ignite/client/ClientCache.java
##########
@@ -571,6 +629,32 @@
*/
public IgniteClientFuture<Void> clearAsync() throws ClientException;
+ /**
+ * Clears entry with specified key from the cache.
+ * In contrast to {@link #remove(Object)}}, this method does not notify
event listeners and cache writers.
+ */
+ public void clear(K key);
+
+ /**
+ * Clears entry with specified key from the cache asynchronously.
+ * In contrast to {@link #removeAsync(Object)}}, this method does not
notify event listeners and cache writers.
Review comment:
Done.
##########
File path: modules/core/src/main/java/org/apache/ignite/client/ClientCache.java
##########
@@ -571,6 +629,32 @@
*/
public IgniteClientFuture<Void> clearAsync() throws ClientException;
+ /**
+ * Clears entry with specified key from the cache.
+ * In contrast to {@link #remove(Object)}}, this method does not notify
event listeners and cache writers.
Review comment:
Done.
##########
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)) {}
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]