sanpwc commented on a change in pull request #330:
URL: https://github.com/apache/ignite-3/pull/330#discussion_r709414143
##########
File path:
modules/client-common/src/main/java/org/apache/ignite/internal/client/proto/ClientMessagePacker.java
##########
@@ -325,6 +326,33 @@ public ClientMessagePacker packUuid(UUID val) {
return this;
}
+ /**
+ * Writes an {@link IgniteUuid}.
+ *
+ * @param val {@link IgniteUuid} value.
+ * @return This instance.
+ */
+ public ClientMessagePacker packIgniteUuid(IgniteUuid val) {
+ assert !closed : "Packer is closed";
+
+ packExtensionTypeHeader(ClientMsgPackType.IGNITE_UUID, 24);
+
+ // TODO: Pack directly to ByteBuf without allocating IGNITE-15234.
+ var bytes = new byte[24];
+ ByteBuffer bb = ByteBuffer.wrap(bytes);
+
+ UUID globalId = val.globalId();
+
+ bb.putLong(globalId.getMostSignificantBits());
+ bb.putLong(globalId.getLeastSignificantBits());
+
+ bb.putLong(val.localId());
+
+ writePayload(bytes);
+
+ return this;
Review comment:
Well, I still think it should be a part of some other ticket, cause we
have same similar logic for packing other data types. If it should be
refactored it should be refactored for all cases, WDYT?
--
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]