rpuch commented on code in PR #4670:
URL: https://github.com/apache/ignite-3/pull/4670#discussion_r1828904774


##########
modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java:
##########
@@ -256,8 +268,21 @@ public HybridTimestamp roundUpToPhysicalTick() {
     /**
      * Returns a byte array representing this timestamp.
      */
+    @SuppressWarnings("NumericCastThatLosesPrecision")
     public byte[] toBytes() {
-        return ByteUtils.longToBytes(longValue());
+        long physical = getPhysical();
+        int logical = getLogical();
+
+        byte[] bytes = new byte[Integer.BYTES + Short.BYTES + 
VarIntUtils.varIntLength(logical)];
+
+        // Reversing bytes as ByteUtils works in BE, but we store in LE (as 
IgniteDataOutput uses LE and we want to be consistent between

Review Comment:
   Same thing, left the comment to help readers understand why reversing is made



-- 
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-unsubscr...@ignite.apache.org

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

Reply via email to