sanpwc commented on a change in pull request #642:
URL: https://github.com/apache/ignite-3/pull/642#discussion_r829150588
##########
File path:
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -415,6 +325,110 @@ private void
onTableCreateInternal(ConfigurationNotificationEvent<TableView> ctx
defaultDataRegion.start();
}
+ /**
+ * Internal method to create a schema.
+ *
+ * @param schemasCtx Create schema configuration event.
+ */
+ private void
createSchemaInternal(ConfigurationNotificationEvent<SchemaView> schemasCtx) {
+ ExtendedTableConfiguration tblCfg = (ExtendedTableConfiguration)
schemasCtx.config(TableConfiguration.class);
+
+ UUID tblId = tblCfg.id().value();
+
+ long causalityToken = schemasCtx.storageRevision();
+
+ SchemaDescriptor schemaDescriptor =
SchemaSerializerImpl.INSTANCE.deserialize((schemasCtx.newValue().schema()));
+
+ tablesByIdVv.update(causalityToken, tablesById -> {
+ TableImpl table = tablesById.get(tblId);
+
+ ((SchemaRegistryImpl)
table.schemaView()).onSchemaRegistered(schemaDescriptor);
+
+ if (schemaDescriptor.version() != INITIAL_SCHEMA_VERSION) {
+ fireEvent(TableEvent.ALTER, new
TableEventParameters(causalityToken, table), null);
+ }
+
+ return tablesById;
+ }, th -> {
+ throw new
IgniteInternalException(IgniteStringFormatter.format("Cannot create a schema
for table"
+ + " [tableId={}, schemaVer={}]", tblId,
schemaDescriptor.version()), th);
+ });
+ }
+
+ /**
+ * Updates or creates partition raft groups.
+ *
+ * @param assignmentsCtx Change assignment event.
+ */
+ private void
updateAssignmentInternal(ConfigurationNotificationEvent<byte[]> assignmentsCtx)
{
Review comment:
Well, rebalance will change given logic, so let's consider it's fine for
now.
--
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]