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/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 6ddc2ad Improve the documentation about publish function (#2422)
6ddc2ad is described below
commit 6ddc2add9402cdb2ec5b57646ca08812ca00bd51
Author: Sanjeev Kulkarni <[email protected]>
AuthorDate: Tue Aug 21 20:18:28 2018 -0700
Improve the documentation about publish function (#2422)
---
.../src/main/java/org/apache/pulsar/functions/api/Context.java | 4 ++--
.../main/java/org/apache/pulsar/functions/instance/ContextImpl.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java
b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java
index fba82a7..2856b7c 100644
---
a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java
+++
b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java
@@ -166,11 +166,11 @@ public interface Context {
* The name of the topic for publishing
* @param object
* The object that needs to be published
- * @param topicsPattern
+ * @param schemaOrSerdeClassName
* Either a builtin schema type (eg: "avro", "json",
"protobuf") or the class name of the custom schema class
* @return A future that completes when the framework is done publishing
the message
*/
- <O> CompletableFuture<Void> publish(String topicName, O object, String
schemaType);
+ <O> CompletableFuture<Void> publish(String topicName, O object, String
schemaOrSerdeClassName);
/**
* Publish an object to the topic using default schemas
diff --git
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
index 18e1fe3..7265e45 100644
---
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
+++
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
@@ -259,8 +259,8 @@ class ContextImpl implements Context, SinkContext,
SourceContext {
@SuppressWarnings("unchecked")
@Override
- public <O> CompletableFuture<Void> publish(String topicName, O object,
String serDeClassName) {
- return publish(topicName, object, (Schema<O>)
topicSchema.getSchema(topicName, object, serDeClassName));
+ public <O> CompletableFuture<Void> publish(String topicName, O object,
String schemaOrSerdeClassName) {
+ return publish(topicName, object, (Schema<O>)
topicSchema.getSchema(topicName, object, schemaOrSerdeClassName));
}
@SuppressWarnings("unchecked")