platinumhamburg commented on code in PR #2161:
URL: https://github.com/apache/fluss/pull/2161#discussion_r2670556743


##########
fluss-server/src/main/java/org/apache/fluss/server/kv/autoinc/AutoIncProcessor.java:
##########
@@ -79,60 +90,51 @@ public AutoIncProcessor(
                             properties);
             sequenceGeneratorMap.put(autoIncColumnId, sequenceGenerator);
         }
-
-        if (autoIncColumnIds.length > 0) {
-            autoIncUpdater =
-                    new DefaultAutoIncUpdater(
-                            kvFormat,
-                            (short) schemaId,
-                            schema,
-                            autoIncColumnIds[0],
-                            sequenceGeneratorMap.get(autoIncColumnIds[0]));
-        } else {
-            autoIncUpdater = NO_OP_UPDATER;
-        }
+        autoIncUpdaters.put(schemaId, createAutoIncUpdater(schemaId));
     }
 
     // Supports removing or reordering columns; does NOT support adding an 
auto-increment column to
     // an existing table.
     public void configureSchema(int latestSchemaId) {
-        if (latestSchemaId != this.schemaId) {
-            Schema schema = schemaGetter.getSchema(latestSchemaId);
-            int[] autoIncColumnIds = schema.getAutoIncColumnIds();
-            if (autoIncColumnIds.length > 1) {
-                throw new IllegalStateException(
-                        "Only support one auto increment column for a table, 
but got "
-                                + autoIncColumnIds.length);
-            } else if (autoIncColumnIds.length == 1) {
-                int autoIncColumnId = autoIncColumnIds[0];
-                if (sequenceGeneratorMap.containsKey(autoIncColumnId)) {
-                    this.autoIncUpdater =
-                            new DefaultAutoIncUpdater(
-                                    kvFormat,
-                                    (short) latestSchemaId,
-                                    schemaGetter.getSchema(latestSchemaId),
-                                    autoIncColumnId,
-                                    sequenceGeneratorMap.get(autoIncColumnId));
-                } else {
-                    throw new IllegalStateException(
-                            "Not supported add auto increment column for a 
table.");
-                }
-            } else {
-                this.autoIncUpdater = NO_OP_UPDATER;
-                this.sequenceGeneratorMap.clear();
-            }
-            this.schemaId = latestSchemaId;
+        if (sequenceGeneratorMap.isEmpty()) {
+            currentAutoIncUpdater = NO_OP_UPDATER;

Review Comment:
   The assignment to currentAutoIncUpdater here will soon be overwritten by the 
next assignment.
   
   



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