DanielLeens commented on code in PR #13238:
URL: https://github.com/apache/seatunnel/pull/13238#discussion_r4666814562


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSink.java:
##########
@@ -90,11 +90,7 @@ public MultiTableSink(MultiTableFactoryContext context) {
         this.sinks = context.getSinks();
         this.replicaNum =
                 
context.getOptions().get(SinkConnectorCommonOptions.MULTI_TABLE_SINK_REPLICA);
-        // replicaNum is the writer count per subtask and becomes the queue 
count and the
-        // thread-pool size in MultiTableSinkWriter. Below 1 there is no 
writer to route a row
-        // to, and Executors.newFixedThreadPool rejects the size with a 
message-less
-        // IllegalArgumentException that names neither this option nor its 
value. Fail here
-        // instead, with both.
+        // Options can also come from callers that construct the sink directly.

Review Comment:
   Thanks for clarifying. I agree that the normal FactoryUtil creation path 
must be validated through MultiTableSinkFactory.optionRule, and the regression 
should exercise that actual factory path; a constructor-only assertion cannot 
prove it. At this unchanged head, FactoryUtil validates the composite rule 
immediately before new MultiTableSink, after connector preparation/save-mode 
work, so the claim should be limited to that boundary. The small constructor 
invariant covers the separate public direct-construction path used by 
MultiTableSinkFixture; retaining it is defense at that entry, not a substitute 
for factory-path validation. Whether to retain that duplicate guard is a 
maintainer design choice, but removing it should explicitly account for direct 
callers and tests. I am not claiming either path has gained earlier protection 
for all save-mode side effects, and I am not requesting an unrelated starter 
rewrite.



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