You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/17 09:32:29 UTC
[GitHub] [ignite-3] denis-chudov commented on a diff in pull request #1006: IGNITE-17428 fixed race between creating table and getting table, between creating schema and getting schema
denis-chudov commented on code in PR #1006:
URL: https://github.com/apache/ignite-3/pull/1006#discussion_r947678576
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1294,37 +1295,17 @@ public CompletableFuture<TableImpl> tableAsyncInternal(UUID id, boolean checkCon
CompletableFuture<TableImpl> getTblFut = new CompletableFuture<>();
- EventListener<TableEventParameters> clo = new EventListener<>() {
- @Override
- public CompletableFuture<Boolean> notify(@NotNull TableEventParameters parameters, @Nullable Throwable e) {
- if (!id.equals(parameters.tableId())) {
- return completedFuture(false);
- }
-
- if (e == null) {
- tablesByIdVv.get(parameters.causalityToken()).thenRun(() -> getTblFut.complete(parameters.table()));
- } else {
- getTblFut.completeExceptionally(e);
- }
-
- return completedFuture(true);
- }
-
- @Override
- public void remove(@NotNull Throwable e) {
- getTblFut.completeExceptionally(e);
+ IgniteTriConsumer<Long, Map<UUID, TableImpl>, Throwable> tablesListener = (token, tables, th) -> {
+ if (th == null) {
+ tablesByIdVv.get(token).thenRun(() -> getTblFut.complete(tablesByIdVv.latest().get(id)));
Review Comment:
```suggestion
getTblFut.complete(tables.get(id));
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org