EricJoy2048 commented on code in PR #3353:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3353#discussion_r1022349526


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/factory/TableSinkFactory.java:
##########
@@ -32,11 +33,28 @@
 
     /**
      * We will never use this method now. So gave a default implement and 
return null.
+     *
      * @param context TableFactoryContext
      * @return
      */
     default TableSink<IN, StateT, CommitInfoT, AggregatedCommitInfoT> 
createSink(TableFactoryContext context) {
         throw new UnsupportedOperationException("unsupported now");
     }
 
+    /**
+     * This method is called by SeaTunnel Web to get the full option rule of a 
sink.
+     * Please don't overwrite this method.
+     * @return
+     */
+    default OptionRule fullOptionRule() {
+        OptionRule optionRule = optionRule();
+        if (optionRule == null) {
+            throw new FactoryException("OptionRule can not be null");
+        }
+
+        OptionRule sinkCommonOptionRule =
+            OptionRule.builder().optional(SinkCommonOptions.SOURCE_TABLE_NAME, 
SinkCommonOptions.PARALLELISM).build();
+        
optionRule.getOptionalOptions().addAll(sinkCommonOptionRule.getOptionalOptions());
+        return optionRule;
+    }

Review Comment:
   > IMO, move this code snippet to the Util class
   
   Ok, I will do it after we removed V1 code from branch dev.



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