sijie commented on a change in pull request #3168: Refactor api commands
URL: https://github.com/apache/pulsar/pull/3168#discussion_r243461567
 
 

 ##########
 File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/v2/SinkApiV2Resource.java
 ##########
 @@ -49,54 +50,51 @@ public SinkApiV2Resource() {
         this.sink = new SinkImpl(this);
     }
 
-
     @POST
     @Path("/{tenant}/{namespace}/{sinkName}")
     @Consumes(MediaType.MULTIPART_FORM_DATA)
-    public Response registerSink(final @PathParam("tenant") String tenant,
-                                 final @PathParam("namespace") String 
namespace,
-                                 final @PathParam("sinkName") String sinkName,
-                                 final @FormDataParam("data") InputStream 
uploadedInputStream,
-                                 final @FormDataParam("data") 
FormDataContentDisposition fileDetail,
-                                 final @FormDataParam("url") String 
functionPkgUrl,
-                                 final @FormDataParam("sinkConfig") String 
sinkConfigJson) {
-
-        return sink.registerFunction(tenant, namespace, sinkName, 
uploadedInputStream, fileDetail,
+    public void registerSink(final @PathParam("tenant") String tenant,
+                             final @PathParam("namespace") String namespace,
+                             final @PathParam("sinkName") String sinkName,
+                             final @FormDataParam("data") InputStream 
uploadedInputStream,
+                             final @FormDataParam("data") 
FormDataContentDisposition fileDetail,
+                             final @FormDataParam("url") String functionPkgUrl,
+                             final @FormDataParam("sinkConfig") String 
sinkConfigJson) {
+
+        sink.registerFunction(tenant, namespace, sinkName, 
uploadedInputStream, fileDetail,
                 functionPkgUrl, null, sinkConfigJson, clientAppId());
-
     }
 
     @PUT
     @Path("/{tenant}/{namespace}/{sinkName}")
     @Consumes(MediaType.MULTIPART_FORM_DATA)
-    public Response updateSink(final @PathParam("tenant") String tenant,
-                               final @PathParam("namespace") String namespace,
-                               final @PathParam("sinkName") String sinkName,
-                               final @FormDataParam("data") InputStream 
uploadedInputStream,
-                               final @FormDataParam("data") 
FormDataContentDisposition fileDetail,
-                               final @FormDataParam("url") String 
functionPkgUrl,
-                               final @FormDataParam("sinkConfig") String 
sinkConfigJson) {
-
-        return sink.updateFunction(tenant, namespace, sinkName, 
uploadedInputStream, fileDetail,
+    public void updateSink(final @PathParam("tenant") String tenant,
+                           final @PathParam("namespace") String namespace,
+                           final @PathParam("sinkName") String sinkName,
+                           final @FormDataParam("data") InputStream 
uploadedInputStream,
+                           final @FormDataParam("data") 
FormDataContentDisposition fileDetail,
+                           final @FormDataParam("url") String functionPkgUrl,
+                           final @FormDataParam("sinkConfig") String 
sinkConfigJson) {
+
+        sink.updateFunction(tenant, namespace, sinkName, uploadedInputStream, 
fileDetail,
                 functionPkgUrl, null, sinkConfigJson, clientAppId());
-
     }
 
-
     @DELETE
     @Path("/{tenant}/{namespace}/{sinkName}")
-    public Response deregisterSink(final @PathParam("tenant") String tenant,
-            final @PathParam("namespace") String namespace, final 
@PathParam("sinkName") String sinkName) {
-        return sink.deregisterFunction(tenant, namespace, sinkName, 
clientAppId());
+    public void deregisterSink(final @PathParam("tenant") String tenant,
+                               final @PathParam("namespace") String namespace,
+                               final @PathParam("sinkName") String sinkName) {
+        sink.deregisterFunction(tenant, namespace, sinkName, clientAppId());
     }
 
     @GET
     @Path("/{tenant}/{namespace}/{sinkName}")
-    public Response getSinkInfo(final @PathParam("tenant") String tenant,
-                                final @PathParam("namespace") String namespace,
-                                final @PathParam("sinkName") String sinkName)
+    public SinkConfig getSinkInfo(final @PathParam("tenant") String tenant,
 
 Review comment:
   This is changing from Response to SinkConfig, doesn't it break the BC?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to