IGNITE-13033 Java thin client: Service invocation#7908
IGNITE-13033 Java thin client: Service invocation#7908alex-plekhanov wants to merge 4 commits intoapache:masterfrom
Conversation
866970b to
51dbfab
Compare
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Outdated
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Outdated
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Show resolved
Hide resolved
modules/core/src/test/java/org/apache/ignite/internal/client/thin/ServicesTest.java
Show resolved
Hide resolved
| writer.writeInt(nodeIds.size()); | ||
|
|
||
| for (UUID nodeId : nodeIds) | ||
| writer.writeUuid(nodeId); |
There was a problem hiding this comment.
writeUuid supports null values - it writes an additional byte which is not needed here. See ClientClusterGroupGetNodeIdsResponse, for example: we usually write UUIDs as 8 bytes when null does not make sense.
There was a problem hiding this comment.
On the other hand, we have UUIDs with an extra byte in compute, partition awareness, and even handshake requests/responses. I think it should be somehow unified. At least with compute until it released (both should write nodeIds in the same format). WDYT?
Should we change compute as well? Or should we leave services as is?
There was a problem hiding this comment.
I would prefer to avoid redundant data. Not because 1 byte matters for performance (in this case it does not), but because it makes things confusing for the client-side code: If there is a leading byte with uuid, it means that the value is potentially null. How should the client handle nulls here? Does not make sense.
Unfortunately, it is very tempting to use writeUuid, so these things keep showing up. Let's not change existing code, dealing with compat is hard.
There was a problem hiding this comment.
I've fixed it.
But it seems inconsistent now to use different formats for writing the same entity for compute and services.
Let's fix compute the same way (by another ticket of course)? It's not released yet, so there will be no compatibility issues.
ptupitsyn
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Please see a couple minor comments.
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Outdated
Show resolved
Hide resolved
...rg/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Aleksey Plekhanov <plehanov.alex@gmail.com>
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
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-12407: Add Cluster API support to Java thin client(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.