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


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/ScanVersionChainByTimestamp.java:
##########
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.storage.pagememory.mv;
+
+import org.apache.ignite.internal.pagememory.datapage.PageMemoryTraversal;
+import org.apache.ignite.internal.pagememory.io.DataPagePayload;
+import org.apache.ignite.internal.pagememory.util.PageIdUtils;
+import org.apache.ignite.internal.schema.ByteBufferRow;
+import org.apache.ignite.internal.tx.Timestamp;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Traversal that scans Version Chain until first version visible at the given 
timestamp is found; then the version
+ * is converted to {@link ByteBufferRow} and finally made available via {@link 
#result()}.
+ *
+ * <p>NB: this traversal first traverses starting data slots of the Version 
Chain one after another; when it finds the
+ * version it needs, it switches to traversing the slots comprising the 
version (because it might be fragmented).
+ */
+class ScanVersionChainByTimestamp implements PageMemoryTraversal<Timestamp> {
+    /**
+     * Contains the result when the traversal ends.
+     */
+    @Nullable
+    private ByteBufferRow result;
+
+    /**
+     * First it's {@code true} (this means that we traverse first slots of 
versions of the Version Chain using NextLink);
+     * then it's {@code false} (when we found the version we need and we read 
its value).
+     */
+    private boolean lookingForVersion = true;
+
+    private final ReadRowVersionValue readRowVersionValue = new 
ReadRowVersionValue();
+
+    {

Review Comment:
   Removed the calls, they are not needed now



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