vldpyatkov commented on a change in pull request #678:
URL: https://github.com/apache/ignite-3/pull/678#discussion_r811383427
##########
File path:
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -540,16 +575,52 @@ private void createTableLocally(
schemaRegistry
);
- tables.put(name, table);
- tablesById.put(tblId, table);
+ tablesVv.update(causalityToken, previous -> {
+ var val = previous == null ? new HashMap() : new
HashMap<>(previous);
+
+ val.put(name, table);
+
+ return val;
+ }, th -> {
+ throw new
IgniteInternalException(IgniteStringFormatter.format("Cannot create a table
[name={}, id={}]", name, tblId),
+ th);
+ });
+
+ tablesByIdVv.update(causalityToken, previous -> {
+ var val = previous == null ? new HashMap() : new
HashMap<>(previous);
+
+ val.put(tblId, table);
+
+ return val;
+ }, th -> {
+ throw new
IgniteInternalException(IgniteStringFormatter.format("Cannot create a table
[name={}, id={}]", name, tblId),
+ th);
+ });
- fireEvent(TableEvent.CREATE, new TableEventParameters(table),
null);
+ completeApiCreateFuture(table);
Review comment:
I think, it might be implemented in a task of the update command.
Although we will even not finalize a token in the method, it will, should
complete in storage revision update.
--
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]