tkalkirill commented on code in PR #1462:
URL: https://github.com/apache/ignite-3/pull/1462#discussion_r1055581634
##########
modules/transactions/src/testFixtures/java/org/apache/ignite/internal/tx/storage/state/test/TestTxStateStorage.java:
##########
@@ -100,11 +100,31 @@ public void remove(UUID txId) {
public Cursor<IgniteBiTuple<UUID, TxMeta>> scan() {
checkFullRebalanceInProgress();
- List<IgniteBiTuple<UUID, TxMeta>> copy = storage.entrySet().stream()
+ Iterator<IgniteBiTuple<UUID, TxMeta>> iterator =
storage.entrySet().stream()
.map(e -> new IgniteBiTuple<>(e.getKey(), e.getValue()))
- .collect(toList());
+ .collect(toList())
+ .iterator();
- return Cursor.fromIterable(copy);
+ return new Cursor<>() {
+ @Override
+ public void close() {
+ // No-op.
+ }
+
+ @Override
+ public boolean hasNext() {
+ assert fullRebalanceFutureReference.get() == null;
Review Comment:
Just make sure that after the start of the rebalance, the cursor will no
longer be used.
--
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]