tkalkirill commented on code in PR #1652:
URL: https://github.com/apache/ignite-3/pull/1652#discussion_r1105699335


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AbstractPartitionTimestampCursor.java:
##########
@@ -164,28 +152,27 @@ public void close() {
     abstract ReadResult findRowVersion(VersionChain versionChain);
 
     private void createVersionChainCursorIfMissing() {
-        if (versionChainCursor != null) {
+        if (cursor != null) {
             return;
         }
 
         try {
-            versionChainCursor = storage.versionChainTree.find(null, null, 
(tree, io, pageAddr, idx) -> {
-                // Since the BplusTree cursor caches rows that are on the same 
page, we should try to get actual ReadResult for them in this
-                // filter so as not to get into a situation when we read the 
chain and the links in it are no longer valid.
-
-                VersionChain versionChain = tree.getRow(io, pageAddr, idx);
-
-                // TODO: IGNITE-18717 Perhaps add lock by rowId
-
-                ReadResult readResult = findRowVersion(versionChain);
-
-                if (!readResult.isEmpty()) {
-                    readResultByRowId.put(versionChain.rowId(), readResult);
+            cursor = storage.versionChainTree.find(null, null, new 
TreeRowClosure<>() {
+                @Override
+                public boolean apply(BplusTree<VersionChainKey, VersionChain> 
tree, BplusIo<VersionChainKey> io, long pageAddr, int idx) {
+                    return true;
                 }
 
-                return true;
+                @Override
+                public ReadResult map(VersionChain treeRow) {
+                    return findRowVersion(treeRow);
+                }
             }, null);
         } catch (IgniteInternalCheckedException e) {
+            if (e.getCause() instanceof StorageException) {
+                throw (StorageException) e.getCause();
+            }

Review Comment:
   Didn't understand you a bit.



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