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


##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/index/impl/TestSortedIndexStorage.java:
##########
@@ -237,6 +238,38 @@ public IndexRow next() {
             return new IndexRowImpl(new 
BinaryTuple(descriptor.binaryTupleSchema(), indexMapEntry.getKey()), rowId);
         }
 
+        @Override
+        public @Nullable IndexRow peek() {
+            if (hasNext != null && !hasNext) {

Review Comment:
   Yes, they are similar, `advanceIfNeeded` can change the state of both 
`TestSortedIndexStorage.ScanCursor#indexMapEntry` and 
`TestSortedIndexStorage.ScanCursor#row`, which makes it a little difficult to 
highlight the common parts.



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##########
@@ -337,6 +338,31 @@ public IndexRow next() {
             }
         }
 
+        @Override
+        public @Nullable IndexRow peek() {
+            if (hasNext != null && !hasNext) {
+                return null;
+            }
+
+            try {
+                SortedIndexRow nextTreeRow;
+
+                if (treeRow == null) {
+                    nextTreeRow = lower == null ? sortedIndexTree.findFirst() 
: sortedIndexTree.findNext(lower, true);

Review Comment:
   Same here



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