Skip to content

Commit

Permalink
FixFix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Sizov committed Nov 29, 2024
1 parent 47b7b15 commit 27ca60f
Showing 1 changed file with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1065,20 +1065,23 @@ private boolean stableKeySwitchMessage(NetworkMessage msg, int partId, Assignmen
private void waitForPartitionState(IgniteImpl node0, int partId, GlobalPartitionStateEnum expectedState, int... nodeIndexes)
throws InterruptedException {
assertTrue(waitForCondition(() -> {
CompletableFuture<Map<TablePartitionId, GlobalPartitionState>> statesFuture = node0.disasterRecoveryManager()
.globalPartitionStates(Set.of(zoneName), emptySet());
CompletableFuture<Map<TablePartitionId, GlobalPartitionState>> statesFuture = node0.disasterRecoveryManager()
.globalPartitionStates(Set.of(zoneName), emptySet());

assertThat(statesFuture, willCompleteSuccessfully());
assertThat(statesFuture, willCompleteSuccessfully());

Map<TablePartitionId, GlobalPartitionState> map = statesFuture.join();
Map<TablePartitionId, GlobalPartitionState> map = statesFuture.join();

GlobalPartitionState state = map.get(new TablePartitionId(tableId, partId));
GlobalPartitionState state = map.get(new TablePartitionId(tableId, partId));

return state != null && state.state == expectedState;
}, 500, SECONDS.toMillis(20)),
return state != null && state.state == expectedState;
},
500,
SECONDS.toMillis(20)
),
() -> "Expected state: " + expectedState
+ ", actual: " + node0.disasterRecoveryManager().globalPartitionStates(Set.of(zoneName), emptySet()).join()
+ ",\n nodes states: \n" +nodeStates(node0, partId, nodeIndexes)
+ ",\n nodes states: \n" + nodeStates(node0, partId, nodeIndexes)
);
}

Expand Down Expand Up @@ -1140,20 +1143,23 @@ private void assertRaftPartitionState(
@Nullable LocalPartitionStateEnum expected
) throws InterruptedException {
assertTrue(waitForCondition(() -> {
Map<TablePartitionId, LocalPartitionStateByNode> states = raftPartitionStateOnNode(node, targetNodeIdx);
Map<TablePartitionId, LocalPartitionStateByNode> states = raftPartitionStateOnNode(node, targetNodeIdx);

if (expected == null) {
return states.isEmpty();
}
if (expected == null) {
return states.isEmpty();
}

if (states.isEmpty()) {
return false;
}
if (states.isEmpty()) {
return false;
}

LocalPartitionStateByNode localPartitionStateByNode = states.get(new TablePartitionId(tableId, partId));
LocalPartitionStateByNode localPartitionStateByNode = states.get(new TablePartitionId(tableId, partId));

return expected == localPartitionStateByNode.values().iterator().next().state;
}, 250, SECONDS.toMillis(20)),
return expected == localPartitionStateByNode.values().iterator().next().state;
},
250,
SECONDS.toMillis(20)
),
() -> "Expected state: " + expected + ", actual: " + raftPartitionStateOnNode(node, targetNodeIdx)
);
}
Expand Down

0 comments on commit 27ca60f

Please sign in to comment.