srkukarni closed pull request #2787: Uptated example scripts URL: https://github.com/apache/pulsar/pull/2787
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-functions/run-counter-examples.sh b/pulsar-functions/run-counter-function.sh similarity index 69% rename from pulsar-functions/run-counter-examples.sh rename to pulsar-functions/run-counter-function.sh index dfc9307c25..a65812a5cc 100755 --- a/pulsar-functions/run-counter-examples.sh +++ b/pulsar-functions/run-counter-function.sh @@ -17,10 +17,9 @@ # under the License. # -bin/pulsar-functions --admin-url http://localhost:8080 functions localrun \ - --functionConfig conf/example.yml \ - --output persistent://sample/standalone/ns1/test_result \ - --outputSerdeClassName org.apache.pulsar.functions.api.utils.DefaultSerDe \ - --functionClassName org.apache.pulsar.functions.api.examples.CounterFunction \ +bin/pulsar-admin functions localrun \ + --inputs input_topic \ + --output output_topic \ + --classname org.apache.pulsar.functions.api.examples.CounterFunction \ --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar \ - --stateStorageServiceUrl localhost:4182 + --state-storage-service-url localhost:4182 diff --git a/pulsar-functions/run-publish-example.sh b/pulsar-functions/run-exclamation-function.sh similarity index 81% rename from pulsar-functions/run-publish-example.sh rename to pulsar-functions/run-exclamation-function.sh index 7d15edde12..e97f7296cc 100755 --- a/pulsar-functions/run-publish-example.sh +++ b/pulsar-functions/run-exclamation-function.sh @@ -17,7 +17,8 @@ # under the License. # -bin/pulsar-functions --admin-url http://localhost:8080 functions localrun \ - --functionConfig conf/example.yml \ - --functionClassName org.apache.pulsar.functions.api.examples.LoggingFunction \ +bin/pulsar-admin functions localrun \ + --output output_topic \ + --inputs input_topic \ + --classname org.apache.pulsar.functions.api.examples.ExclamationFunction \ --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar diff --git a/pulsar-functions/run-examples.sh b/pulsar-functions/run-logtopic-function.sh similarity index 71% rename from pulsar-functions/run-examples.sh rename to pulsar-functions/run-logtopic-function.sh index c494bcd635..caefa3300a 100755 --- a/pulsar-functions/run-examples.sh +++ b/pulsar-functions/run-logtopic-function.sh @@ -17,9 +17,9 @@ # under the License. # -bin/pulsar-functions --admin-url http://localhost:8080 functions localrun \ - --functionConfigFile conf/example.yml \ - --output persistent://sample/standalone/ns1/test_result \ - --outputSerdeClassName org.apache.pulsar.functions.api.utils.DefaultSerDe \ - --className org.apache.pulsar.functions.api.examples.ExclamationFunction \ +bin/pulsar-admin --admin-url http://localhost:8080 functions localrun \ + --output output_topic \ + --inputs input_topic \ + --log-topic log_topic \ + --classname org.apache.pulsar.functions.api.examples.LoggingFunction \ --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar diff --git a/pulsar-functions/run-logging-examples.sh b/pulsar-functions/run-publish-function.sh similarity index 71% rename from pulsar-functions/run-logging-examples.sh rename to pulsar-functions/run-publish-function.sh index 00a083e298..47f0e104e1 100755 --- a/pulsar-functions/run-logging-examples.sh +++ b/pulsar-functions/run-publish-function.sh @@ -17,9 +17,8 @@ # under the License. # -bin/pulsar-functions --admin-url http://localhost:8080 functions localrun \ - --functionConfig conf/example.yml \ - --output persistent://sample/standalone/ns1/test_result \ - --outputSerdeClassName org.apache.pulsar.functions.api.utils.DefaultSerDe \ - --functionClassName org.apache.pulsar.functions.api.examples.LoggingFunction \ +bin/pulsar-admin functions localrun \ + --inputs input_topic \ + --classname org.apache.pulsar.functions.api.examples.PublishFunction \ --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar + --user-config '{"publish-topic" : "mytopic"}' diff --git a/pulsar-functions/submit-python-function.sh b/pulsar-functions/submit-python-function.sh index bc2cfbf8a3..f34ba01450 100755 --- a/pulsar-functions/submit-python-function.sh +++ b/pulsar-functions/submit-python-function.sh @@ -19,8 +19,8 @@ # -bin/pulsar-functions functions create \ - --output persistent://sample/standalone/ns1/test_result \ - --inputs persistent://sample/standalone/ns1/test_src \ +bin/pulsar-admin functions create \ + --output output_topic \ + --inputs input_topics \ --py python-examples/exclamation.py \ - --className exclamation.Exclamation + --classname exclamation.ExclamationFunction ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services