ibessonov commented on code in PR #1800:
URL: https://github.com/apache/ignite-3/pull/1800#discussion_r1153396016
##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/raft/PartitionCommandListenerTest.java:
##########
@@ -462,6 +464,48 @@ public void testSafeTime() {
applySafeTimeCommand(SafeTimeSyncCommand.class, testClock.now());
}
+ @Test
+ void testBuildIndexCommand() {
+ UUID indexId = UUID.randomUUID();
+
+ doNothing().when(storageUpdateHandler).buildIndex(eq(indexId),
any(List.class), anyBoolean());
+
+ List<UUID> rowUuids0 = List.of(UUID.randomUUID());
+ List<UUID> rowUuids1 = List.of(UUID.randomUUID());
+ List<UUID> rowUuids2 = List.of(UUID.randomUUID());
+
+ InOrder inOrder = inOrder(partitionDataStorage, storageUpdateHandler);
+
+
commandListener.handleBuildIndexCommand(createBuildIndexCommand(indexId,
rowUuids0, false), 10, 1);
+
+ inOrder.verify(partitionDataStorage).lastApplied(10, 1);
+ inOrder.verify(storageUpdateHandler).buildIndex(indexId, rowUuids0,
false);
+
+
commandListener.handleBuildIndexCommand(createBuildIndexCommand(indexId,
rowUuids1, true), 20, 2);
+
+ inOrder.verify(partitionDataStorage).lastApplied(20, 2);
+ inOrder.verify(storageUpdateHandler).buildIndex(indexId, rowUuids1,
true);
+
+
commandListener.handleBuildIndexCommand(createBuildIndexCommand(indexId,
rowUuids2, false), 5, 1);
Review Comment:
Why do you pass smaller values here? Shouldn't such command be ignored?
--
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]