You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by sa...@apache.org on 2018/10/12 22:59:36 UTC

[pulsar] branch master updated: Uptated example scripts (#2787)

This is an automated email from the ASF dual-hosted git repository.

sanjeevrk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new f2f5f83  Uptated example scripts (#2787)
f2f5f83 is described below

commit f2f5f83a0600c25df32743fcf3c5a6177d96ecc2
Author: Sanjeev Kulkarni <sa...@gmail.com>
AuthorDate: Fri Oct 12 15:59:32 2018 -0700

    Uptated example scripts (#2787)
---
 pulsar-functions/run-counter-examples.sh           | 26 ----------------------
 ...-publish-example.sh => run-counter-function.sh} | 10 +++++----
 ...lish-example.sh => run-exclamation-function.sh} |  7 +++---
 .../{run-examples.sh => run-logtopic-function.sh}  | 10 ++++-----
 ...logging-examples.sh => run-publish-function.sh} |  9 ++++----
 pulsar-functions/submit-python-function.sh         |  8 +++----
 6 files changed, 23 insertions(+), 47 deletions(-)

diff --git a/pulsar-functions/run-counter-examples.sh b/pulsar-functions/run-counter-examples.sh
deleted file mode 100755
index dfc9307..0000000
--- a/pulsar-functions/run-counter-examples.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# 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 \
-    --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar \
-    --stateStorageServiceUrl localhost:4182
diff --git a/pulsar-functions/run-publish-example.sh b/pulsar-functions/run-counter-function.sh
similarity index 79%
copy from pulsar-functions/run-publish-example.sh
copy to pulsar-functions/run-counter-function.sh
index 7d15edd..a65812a 100755
--- a/pulsar-functions/run-publish-example.sh
+++ b/pulsar-functions/run-counter-function.sh
@@ -17,7 +17,9 @@
 # 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 \
-    --jar `pwd`/java-examples/target/pulsar-functions-api-examples.jar
+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 \
+    --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 7d15edd..e97f729 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 c494bcd..caefa33 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 00a083e..47f0e10 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 bc2cfbf..f34ba01 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