sandynz commented on code in PR #24798:
URL: https://github.com/apache/shardingsphere/pull/24798#discussion_r1147245620


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/cdc/CDCBackendHandler.java:
##########
@@ -131,17 +130,17 @@ public String getDatabaseNameByJobId(final String jobId) {
     /**
      * Start streaming.
      *
-     * @param requestId request id
      * @param jobId job id
      * @param channel channel
      * @param connectionContext connection context
-     * @return CDC response
      */
-    // TODO not return CDCResponse
-    public CDCResponse startStreaming(final String requestId, final String 
jobId, final CDCConnectionContext connectionContext, final Channel channel) {
+    public void startStreaming(final String jobId, final CDCConnectionContext 
connectionContext, final Channel channel) {
         CDCJobConfiguration cdcJobConfig = jobAPI.getJobConfiguration(jobId);
         if (null == cdcJobConfig) {
-            return CDCResponseGenerator.failed(jobId, 
CDCResponseErrorCode.ILLEGAL_REQUEST_ERROR, String.format("the %s job config 
doesn't exist", jobId));
+            throw new PipelineJobNotFoundException(jobId);
+        }
+        if (PipelineJobCenter.isJobExisting(jobId)) {
+            throw new PipelineJobHasAlreadyStartedException(jobId);
         }

Review Comment:
   Need to stop and then start it.
   
   And it will be improved in another PR. Since it's common requirement to wait 
job stopping synchronously.



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