Hisoka-X commented on code in PR #6843:
URL: https://github.com/apache/seatunnel/pull/6843#discussion_r1634748955


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/master/JobMaster.java:
##########
@@ -333,6 +361,30 @@ public void run() {
         }
     }
 
+    public static void handleSaveMode(SeaTunnelSink sink) {
+        if (sink instanceof SupportSaveMode) {
+            Optional<SaveModeHandler> saveModeHandler =
+                    ((SupportSaveMode) sink).getSaveModeHandler();
+            if (saveModeHandler.isPresent()) {
+                try (SaveModeHandler handler = saveModeHandler.get()) {
+                    new SaveModeExecuteWrapper(handler).execute();
+                } catch (Exception e) {
+                    throw new 
SeaTunnelRuntimeException(HANDLE_SAVE_MODE_FAILED, e);
+                }
+            }
+        } else if (sink.getClass()
+                .getName()
+                .equals(
+                        
"org.apache.seatunnel.connectors.seatunnel.common.multitablesink.MultiTableSink"))
 {
+            // TODO we should not use class name to judge the sink type

Review Comment:
   It is difficult to perform some system-level operations at the connector 
level, such as create savemode-related events. I will solve this problem in the 
next PR.



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