alex-plekhanov commented on code in PR #11176:
URL: https://github.com/apache/ignite/pull/11176#discussion_r1481507587


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDataRequest.java:
##########
@@ -48,4 +54,23 @@ public int txId() {
     @Override public boolean isTransactional() {
         return super.isTransactional();
     }
+
+    /** Chain cache operation future to return response when operation is 
completed. */
+    protected <T> IgniteInternalFuture<ClientResponse> chainFuture(

Review Comment:
   > seems weird to have it in one of the request handlers
   
   Why not? It's a helper method and related only to cache data requests. This 
class is effectively abstract, and method is supposed to be used in children 
handlers. We have a lot of similar methods in code (for example, 
`ClientCacheRequest#cacheDescriptor`) and for me it looks absolutely normal.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheKeyRequest.java:
##########
@@ -47,6 +50,28 @@ public abstract class ClientCacheKeyRequest extends 
ClientCacheDataRequest imple
 
     /** {@inheritDoc} */
     @Override public final ClientResponse process(ClientConnectionContext ctx) 
{
+        updateMetrics(ctx);
+
+        // Process request in overriden method.
+        return process0(ctx);
+    }
+
+    /** {@inheritDoc} */
+    @Override public final IgniteInternalFuture<ClientResponse> 
processAsync(ClientConnectionContext ctx) {
+        updateMetrics(ctx);
+
+        // Process request in overriden method.
+        return processAsync0(ctx);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isAsync(ClientConnectionContext ctx) {
+        // Every cache data request on the transactional cache can lock the 
thread, even with implicit transaction.
+        return cacheDescriptor(ctx).cacheConfiguration().getAtomicityMode() == 
CacheAtomicityMode.TRANSACTIONAL;

Review Comment:
   I'm not sure. Async operations add some overhead (at least extra objects are 
created to handle async requests), so, perhaps it will have negative impact on 
performance. 
   I found that implicit operations on transactional caches are performed in 
OPTIMISTIC transactions, so, threads are not blocked and I propose, on the 
contrary, use async operations only for requests under explicit transactions. 
What do you think?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to