Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Flow.Publisher;
import java.util.concurrent.Flow.Subscription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ public interface PeekCursor<T> extends Cursor<T> {
* up-to-date value in the storage.
*/
@Nullable T peek();

@Nullable default T getLastLocked() {
return null;
}

default void locked(T peekedRow) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ private class ScanCursor implements PeekCursor<IndexRow> {
@Nullable
private IndexRow currentRow;

@Nullable
private IndexRow lastLocked;

@Nullable
private IndexRow peekedRow = NO_PEEKED_ROW;

Expand Down Expand Up @@ -192,6 +195,20 @@ public IndexRow next() {

return peekedRow;
}

@Override
public @Nullable IndexRow getLastLocked() {
checkStorageClosedOrInProcessOfRebalance(true);

return lastLocked;
}

@Override
public void locked(IndexRow peekedRow) {
checkStorageClosedOrInProcessOfRebalance(true);

lastLocked = peekedRow;
}
}

/**
Expand Down
Loading