tkalkirill commented on code in PR #1471:
URL: https://github.com/apache/ignite-3/pull/1471#discussion_r1057185707
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -378,19 +381,59 @@ private static ReadResult walkVersionChain(VersionChain
chainHead, HybridTimesta
@Override
public Cursor<ReadResult> scanVersions(RowId rowId) throws
StorageException {
- checkClosed();
+ checkStorageClosedOrInProcessFullRebalance();
+
+ return new Cursor<>() {
+ @Nullable
+ private Boolean hasNext;
+
+ @Nullable
+ private VersionChain versionChain;
+
+ @Override
+ public void close() {
+ // No-op.
+ }
+
+ @Override
+ public boolean hasNext() {
+ checkStorageClosedOrInProcessFullRebalance();
- return Cursor.fromBareIterator(
- Stream.iterate(map.get(rowId), Objects::nonNull, vc -> vc.next)
- .peek(versionChain -> checkClosed())
- .map((VersionChain versionChain) ->
versionChainToReadResult(versionChain, false))
- .iterator()
- );
+ advanceIfNeeded();
+
+ return hasNext;
+ }
+
+ @Override
+ public ReadResult next() {
+ checkStorageClosedOrInProcessFullRebalance();
Review Comment:
Fix it
--
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]