RocMarshal commented on code in PR #2268:
URL: 
https://github.com/apache/incubator-streampark/pull/2268#discussion_r1103628964


##########
streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/FlinkClientHandler.scala:
##########
@@ -36,6 +36,19 @@ object FlinkClientHandler {
     }
   }
 
+  def triggerSavepoint(savepointRequest: TriggerSavepointRequest): 
SavepointResponse = {
+    savepointRequest.executionMode match {
+      case ExecutionMode.LOCAL => 
LocalSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.REMOTE => 
RemoteSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.YARN_APPLICATION => 
YarnApplicationSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.YARN_SESSION => 
YarnSessionSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.YARN_PER_JOB | ExecutionMode.YARN_SESSION => 
YarnPerJobSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.KUBERNETES_NATIVE_SESSION => 
KubernetesNativeSessionSubmit.triggerSavepoint(savepointRequest)
+      case ExecutionMode.KUBERNETES_NATIVE_APPLICATION => 
KubernetesNativeApplicationSubmit.triggerSavepoint(savepointRequest)
+      case _ => throw new UnsupportedOperationException(s"Unsupported 
${savepointRequest.executionMode} Submit ")
+    }
+  }
+

Review Comment:
   Indeed, as @1996fanrui you said. The current design logic makes the code 
inevitably bloated.
   We can start with a new Issue to sort out the desired effect of the 
refactoring, the problems at this stage, and the best way to refactor.
   CC @wolfboys 



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