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 2018/03/24 04:22:51 UTC

[GitHub] merlimat closed pull request #1421: Fix Python example class name

merlimat closed pull request #1421: Fix Python example class name
URL: https://github.com/apache/incubator-pulsar/pull/1421
 
 
   

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/submit-python-function.sh b/pulsar-functions/submit-python-function.sh
index ed625a5a1..bc2cfbf8a 100755
--- a/pulsar-functions/submit-python-function.sh
+++ b/pulsar-functions/submit-python-function.sh
@@ -20,9 +20,7 @@
 
 
 bin/pulsar-functions functions create \
-    --function-config conf/example.yml \
-    --output-topic persistent://sample/standalone/ns1/test_result \
-    --input-topics persistent://sample/standalone/ns1/test_src \
-    --output-serde-classname pulsarfunction.serde.IdentitySerDe \
+    --output persistent://sample/standalone/ns1/test_result \
+    --inputs persistent://sample/standalone/ns1/test_src \
     --py python-examples/exclamation.py \
-    --function-classname exclamation.Exclamation
+    --className exclamation.Exclamation
diff --git a/site/docs/latest/functions/quickstart.md b/site/docs/latest/functions/quickstart.md
index a973ab78a..7a0143b24 100644
--- a/site/docs/latest/functions/quickstart.md
+++ b/site/docs/latest/functions/quickstart.md
@@ -212,13 +212,7 @@ $ touch reverse.py
 In that file, add the following:
 
 ```python
-from pulsarfunction import pulsar_function
-
-class Reverse(pulsar_function.PulsarFunction):
-  def __init__(self):
-    pass
-
-  def process(self, input):
+def process(input):
     return input[::-1]
 ```
 
@@ -227,9 +221,9 @@ Here, the `process` method defines the processing logic of the Pulsar Function.
 ```bash
 $ bin/pulsar-admin functions create \
   --py reverse.py \
-  --className reverse.Reverse \
-  --inputs persistent://sample/standalone/ns1/forwards \
-  --output persistent://sample/standalone/ns1/backwards \
+  --className reverse \
+  --inputs persistent://sample/standalone/ns1/input \
+  --output persistent://sample/standalone/ns1/output \
   --tenant sample \
   --namespace ns1 \
   --name reverse 
@@ -238,7 +232,7 @@ $ bin/pulsar-admin functions create \
 If you see `Created successfully`, the function is ready to accept incoming messages. Let's publish a string to the input topic:
 
 ```bash
-$ bin/pulsar-client produce persistent://sample/standalone/ns1/forwards \
+$ bin/pulsar-client produce persistent://sample/standalone/ns1/input \
   --num-produce 1 \
   --messages "sdrawrof won si tub sdrawkcab saw gnirts sihT"
 ```
@@ -246,7 +240,7 @@ $ bin/pulsar-client produce persistent://sample/standalone/ns1/forwards \
 Now, let's pull in a message from the output topic:
 
 ```bash
-$ bin/pulsar-client consume persistent://sample/standalone/ns1/backwards \
+$ bin/pulsar-client consume persistent://sample/standalone/ns1/output \
   --subscription-name my-subscription \
   --num-messages 1
 ```
@@ -258,4 +252,4 @@ You should see the reversed string in the log output:
 This string was backwards but is now forwards
 ```
 
-Once again, success! We created a brand new Pulsar Function, deployed it in our Pulsar standalone cluster, and successfully published to the function's input topic and consumed from its output topic.
\ No newline at end of file
+Once again, success! We created a brand new Pulsar Function, deployed it in our Pulsar standalone cluster, and successfully published to the function's input topic and consumed from its output topic.


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services