tkalkirill commented on code in PR #2143:
URL: https://github.com/apache/ignite-3/pull/2143#discussion_r1220960858


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -436,31 +436,39 @@ private CompletableFuture<?> 
onIndexCreate(ConfigurationNotificationEvent<TableI
         }
 
         try {
-            return createIndexLocally(evt.storageRevision(), tableId, 
evt.newValue(), evt.newValue(TablesView.class));
+            TablesView tablesView = evt.newValue(TablesView.class);
+
+            TableView tableView = findTableView(tableId, 
(NamedListView<TableView>) tablesView.tables());
+
+            org.apache.ignite.internal.catalog.descriptors.TableDescriptor 
catalogTableDescriptor = toTableDescriptor(tableView);
+            org.apache.ignite.internal.catalog.descriptors.IndexDescriptor 
catalogIndexDescriptor = toIndexDescriptor(indexConfig);
+
+            return createIndexLocally(evt.storageRevision(), 
catalogTableDescriptor, catalogIndexDescriptor);
         } finally {
             busyLock.leaveBusy();
         }
     }
 
     private CompletableFuture<?> createIndexLocally(
             long causalityToken,
-            int tableId,
-            TableIndexView tableIndexView,
-            TablesView tablesView
+            org.apache.ignite.internal.catalog.descriptors.TableDescriptor 
catalogTableDescriptor,
+            org.apache.ignite.internal.catalog.descriptors.IndexDescriptor 
catalogIndexDescriptor
     ) {
-        assert tableIndexView != null;
-
-        int indexId = tableIndexView.id();
+        int tableId = catalogTableDescriptor.id();
+        int indexId = catalogIndexDescriptor.id();
 
         LOG.trace("Creating local index: name={}, id={}, tableId={}, token={}",
-                tableIndexView.name(), indexId, tableId, causalityToken);
+                catalogIndexDescriptor.name(), indexId, tableId, 
causalityToken);
 
-        IndexDescriptor descriptor = newDescriptor(tableIndexView);
+        IndexDescriptor eventIndexDescriptor = 
toEventIndexDescriptor(catalogIndexDescriptor);

Review Comment:
   Yes, we all need them in one class and they are not quite compatible with 
each other if we redo it in a separate task.



-- 
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]

Reply via email to