AMashenkov commented on code in PR #1110:
URL: https://github.com/apache/ignite-3/pull/1110#discussion_r977611597


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1234,27 +1232,26 @@ private CompletableFuture<Void> 
dropTableAsyncInternal(String name) {
             if (tbl == null) {
                 dropTblFut.completeExceptionally(new 
TableNotFoundException(name));
             } else {
-                tablesCfg.tables()
-                        .change(change -> {
-                            TableView tableCfg = change.get(name);
+                tablesCfg.change(chg ->
+                        chg.changeTables(tblChg -> {
+                            TableView tableCfg = tblChg.get(name);
 
                             if (tableCfg == null) {
                                 throw new TableNotFoundException(name);
                             }
 
-                            NamedListView<TableIndexView> idxView = 
tablesCfg.indexes().value();
+                            tblChg.delete(name);
+                        }
+                        ).changeIndexes(idxChg -> {
+                            List<String> indicesNames = 
tablesCfg.indexes().value().namedListKeys();
 
-                            boolean idxFound = idxView.namedListKeys().stream()
-                                    .anyMatch(idx -> 
idxView.get(idx).tableId().equals(tbl.tableId()));
+                            List<String> indexes = 
indicesNames.stream().filter(idx ->
+                                    
tablesCfg.indexes().get(idx).tableId().value().equals(tbl.tableId())).collect(Collectors.toList());

Review Comment:
   ```suggestion
                               List<String> indexes = indicesNames.stream()
                                       .filter(idx -> 
tablesCfg.indexes().get(idx).tableId().value().equals(tbl.tableId()))
                                       .foreach(name -> idxChg.delete(name);
   ```
   there is no need to collect results.



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