You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/06 14:02:17 UTC

[GitHub] [ignite] xtern opened a new pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

xtern opened a new pull request #9629:
URL: https://github.com/apache/ignite/pull/9629


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r770748143



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? ((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       > What if the user implements and passes to method their own `ServiceCallContext` implementation? We should check it and throw an error with reasonable message, or introduce some kind of `attributeNames()` method in public interface, to get all possible attributes for this context.
   
   Added explicit validation for user-supplied argument.
   
   > Also, should not write anything (including `null`) if `ProtocolBitmaskFeature.SERVICE_INVOKE_CALLCTX` is not supported.
   
   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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r770677405



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -119,8 +143,10 @@ private ServiceInvocationHandler(String name, long timeout, ClientClusterGroupIm
                 if (nodeIds != null && nodeIds.isEmpty())
                     throw new ClientException("Cluster group is empty.");
 
-                return ch.service(ClientOperation.SERVICE_INVOKE,
-                    req -> writeServiceInvokeRequest(req, nodeIds, method, args),
+                boolean withCallCtx = callCtx != null;
+
+                return ch.service(withCallCtx ? ClientOperation.SERVICE_INVOKE_CALLCTX : ClientOperation.SERVICE_INVOKE,

Review comment:
       Done, thanks!




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r776591172



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
##########
@@ -491,7 +490,8 @@ public ClientListenerRequest decode(BinaryReaderExImpl reader) {
                 return new ClientExecuteTaskRequest(reader);
 
             case OP_SERVICE_INVOKE:
-                return new ClientServiceInvokeRequest(reader);
+                return new ClientServiceInvokeRequest(reader,

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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r776591135



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
##########
@@ -277,7 +277,6 @@
     private static final short OP_SERVICE_GET_DESCRIPTOR = 7002;
 
     /** Data streamers. */
-    /** */

Review comment:
       thanks, 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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r769663127



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? ((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       Also, should not write anything (including `null`) if `ProtocolBitmaskFeature.SERVICE_INVOKE_CALLCTX` is not supported.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? ((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       What if the user implements and passes to method their own `ServiceCallContext` implementation? We should check it and throw an error with reasonable message, or introduce some kind of `attributeNames()` method in public interface, to get all possible attributes for this context.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -119,8 +143,10 @@ private ServiceInvocationHandler(String name, long timeout, ClientClusterGroupIm
                 if (nodeIds != null && nodeIds.isEmpty())
                     throw new ClientException("Cluster group is empty.");
 
-                return ch.service(ClientOperation.SERVICE_INVOKE,
-                    req -> writeServiceInvokeRequest(req, nodeIds, method, args),
+                boolean withCallCtx = callCtx != null;
+
+                return ch.service(withCallCtx ? ClientOperation.SERVICE_INVOKE_CALLCTX : ClientOperation.SERVICE_INVOKE,

Review comment:
       Lets' extend `ClientOperation.SERVICE_INVOKE`, it's redundant to introduce a new client operation type.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] xtern commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r770748143



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? ((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       > What if the user implements and passes to method their own `ServiceCallContext` implementation? We should check it and throw an error with reasonable message, or introduce some kind of `attributeNames()` method in public interface, to get all possible attributes for this context.
   
   Added explicit user arguments check.
   
   > Also, should not write anything (including `null`) if `ProtocolBitmaskFeature.SERVICE_INVOKE_CALLCTX` is not supported.
   
   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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r776575006



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
##########
@@ -277,7 +277,6 @@
     private static final short OP_SERVICE_GET_DESCRIPTOR = 7002;
 
     /** Data streamers. */
-    /** */

Review comment:
       Return this

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
##########
@@ -491,7 +490,8 @@ public ClientListenerRequest decode(BinaryReaderExImpl reader) {
                 return new ClientExecuteTaskRequest(reader);
 
             case OP_SERVICE_INVOKE:
-                return new ClientServiceInvokeRequest(reader);
+                return new ClientServiceInvokeRequest(reader,

Review comment:
       Let's pass `protocolCtx` to `ClientServiceInvokeRequest` (see other requests as example `ClientCacheGetConfigurationRequest`, `ClientCacheSqlFieldsQueryRequest`)




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] asfgit closed pull request #9629: IGNITE-15829 Request attributes for a service in thin clients.

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #9629:
URL: https://github.com/apache/ignite/pull/9629


   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org