sashapolo commented on code in PR #1800:
URL: https://github.com/apache/ignite-3/pull/1800#discussion_r1145812197
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -534,32 +584,159 @@ public BinaryTuple convert(BinaryRow binaryRow) {
}
private class ConfigurationListener implements
ConfigurationNamedListListener<TableIndexView> {
- /** {@inheritDoc} */
@Override
- public @NotNull CompletableFuture<?> onCreate(@NotNull
ConfigurationNotificationEvent<TableIndexView> ctx) {
+ public CompletableFuture<?>
onCreate(ConfigurationNotificationEvent<TableIndexView> ctx) {
return onIndexCreate(ctx);
}
- /** {@inheritDoc} */
@Override
- public @NotNull CompletableFuture<?> onRename(
+ public CompletableFuture<?> onRename(
String oldName,
String newName,
ConfigurationNotificationEvent<TableIndexView> ctx
) {
return failedFuture(new
UnsupportedOperationException("https://issues.apache.org/jira/browse/IGNITE-16196"));
}
- /** {@inheritDoc} */
@Override
- public @NotNull CompletableFuture<?> onDelete(@NotNull
ConfigurationNotificationEvent<TableIndexView> ctx) {
+ public CompletableFuture<?>
onDelete(ConfigurationNotificationEvent<TableIndexView> ctx) {
return onIndexDrop(ctx);
}
- /** {@inheritDoc} */
@Override
- public @NotNull CompletableFuture<?> onUpdate(@NotNull
ConfigurationNotificationEvent<TableIndexView> ctx) {
+ public CompletableFuture<?>
onUpdate(ConfigurationNotificationEvent<TableIndexView> ctx) {
return failedFuture(new IllegalStateException("Should not be
called"));
}
}
+
+ /**
+ * Initializes the build of the index.
+ */
+ private void initIndexBuildIfNeeded(TableIndexView tableIndexView,
TableImpl table) {
+ for (int partitionId = 0; partitionId <
table.internalTable().partitions(); partitionId++) {
+ buildIndexExecutor.submit(new BuildIndexTask(table,
tableIndexView, partitionId, true));
Review Comment:
Do we have a test for this situation? I mean, when we start building an
index and in the middle of this process a leader changes? I have a feeling that
something will still break
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -729,6 +729,82 @@ void testDestroyStartedRebalance() {
assertThat(tableStorage.destroyPartition(PARTITION_ID),
willCompleteSuccessfully());
}
+ @Test
+ void testIndexLastBuildRowId() {
+ MvPartitionStorage mvPartitionStorage =
getOrCreateMvPartition(PARTITION_ID);
+
+ IndexStorage sortedIndexStorage =
tableStorage.getOrCreateIndex(PARTITION_ID, sortedIdx.id());
Review Comment:
okay
--
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]