ibessonov commented on code in PR #1038:
URL: https://github.com/apache/ignite-3/pull/1038#discussion_r957402048


##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -807,14 +814,12 @@ private ByteBuffer prepareHeapKeyBuf(RowId rowId) {
     /**
      * Writes a timestamp into a byte buffer, in descending lexicographical 
bytes order.
      */
-    private static void putTimestamp(ByteBuffer buf, Timestamp ts) {
+    private static void putTimestamp(ByteBuffer buf, HybridTimestamp ts) {
         assert buf.order() == BIG_ENDIAN;
 
-        // Two things to note here:
-        //  - "xor" with a single sign bit makes long values comparable 
according to RocksDB convention, where bytes are unsigned.

Review Comment:
   Yes, we do rely on this fact right now. If anything changes, I'll bring them 
back.
   They used to confuse readers, you know



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/Timestamps.java:
##########
@@ -17,62 +17,72 @@
 
 package org.apache.ignite.internal.storage.pagememory.mv;
 
+import static org.apache.ignite.hlc.HybridTimestamp.HYBRID_TIMESTAMP_SIZE;
+import static org.apache.ignite.internal.pagememory.util.PageUtils.getInt;
 import static org.apache.ignite.internal.pagememory.util.PageUtils.getLong;
+import static org.apache.ignite.internal.pagememory.util.PageUtils.putInt;
 import static org.apache.ignite.internal.pagememory.util.PageUtils.putLong;
 
 import java.nio.ByteBuffer;
-import org.apache.ignite.internal.tx.Timestamp;
+import org.apache.ignite.hlc.HybridTimestamp;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Code to work with {@link Timestamp}s.
+ * Code to work with {@link HybridTimestamp}s.
  */
 public class Timestamps {
     /**
-     * Reads a {@link Timestamp} value from memory.
+     * Reads a {@link HybridTimestamp} value from memory.
      *
      * @param pageAddr Address where page data starts.
      * @param offset Offset to the timestamp value relative to pageAddr.
      */
-    static @Nullable Timestamp readTimestamp(long pageAddr, int offset) {
-        long nodeId = getLong(pageAddr, offset);
-        long localTimestamp = getLong(pageAddr, offset + Long.BYTES);
+    static @Nullable HybridTimestamp readTimestamp(long pageAddr, int offset) {
+        long physical = getLong(pageAddr, offset);
+        int logical = getInt(pageAddr, offset + Long.BYTES);
 
-        Timestamp timestamp = new Timestamp(localTimestamp, nodeId);
-        if (timestamp.equals(RowVersion.NULL_TIMESTAMP)) {
-            timestamp = null;
+        if (physical == 0L && logical == 0) {

Review Comment:
   Ok, although I don't think it's necessary. Not every 0 deserves a constant :)



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