You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/20 04:50:00 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #4311: Added api for putting state via cli/rest

jerrypeng commented on a change in pull request #4311: Added api for putting state via cli/rest
URL: https://github.com/apache/pulsar/pull/4311#discussion_r285428055
 
 

 ##########
 File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
 ##########
 @@ -830,6 +831,20 @@ void runCmd() throws Exception {
         }
     }
 
+    @Parameters(commandDescription = "Put the state associated with a Pulsar Function")
+    class StatePutter extends FunctionCommand {
+
+        @Parameter(names = { "-s", "--state" }, description = "The FunctionState that needs to be put", required = true)
+        private String state = null;
+
+        @Override
+        void runCmd() throws Exception {
+            FunctionState stateRepr = new Gson().fromJson(state, FunctionState.class);
 
 Review comment:
   Lets ObjectMapperFactory.getThreadLocal() instead Gson() its more efficient

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services