This is an automated email from the ASF dual-hosted git repository.
mmerli 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 03742b7 Added the --custom-schema-inputs cli arg to allow custom
schema input to functions (#2486)
03742b7 is described below
commit 03742b73b3ec0f391840f849041875621b47140f
Author: Sanjeev Kulkarni <[email protected]>
AuthorDate: Thu Aug 30 22:39:59 2018 -0700
Added the --custom-schema-inputs cli arg to allow custom schema input to
functions (#2486)
* Added the --custom-schema-inputs cli arg to allow custom schema input to
functions
* Update documentation regarding the same
---
.../src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java | 7 +++++++
site2/docs/reference-pulsar-admin.md | 3 +++
2 files changed, 10 insertions(+)
diff --git
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
index 18d483c..1ba7751 100644
---
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
+++
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
@@ -256,6 +256,8 @@ public class CmdFunctions extends CmdBase {
protected String DEPRECATED_customSerdeInputString;
@Parameter(names = "--custom-serde-inputs", description = "The map of
input topics to SerDe class names (as a JSON string)")
protected String customSerdeInputString;
+ @Parameter(names = "--custom-schema-inputs", description = "The map of
input topics to Schema class names (as a JSON string)")
+ protected String customSchemaInputString;
// for backwards compatibility purposes
@Parameter(names = "--outputSerdeClassName", description = "The SerDe
class to be used for messages output by the function", hidden = true)
protected String DEPRECATED_outputSerdeClassName;
@@ -377,6 +379,11 @@ public class CmdFunctions extends CmdBase {
Map<String, String> customSerdeInputMap = new
Gson().fromJson(customSerdeInputString, type);
functionConfig.setCustomSerdeInputs(customSerdeInputMap);
}
+ if (null != customSchemaInputString) {
+ Type type = new TypeToken<Map<String, String>>(){}.getType();
+ Map<String, String> customschemaInputMap = new
Gson().fromJson(customSchemaInputString, type);
+ functionConfig.setCustomSchemaInputs(customschemaInputMap);
+ }
if (null != topicsPattern) {
functionConfig.setTopicsPattern(topicsPattern);
}
diff --git a/site2/docs/reference-pulsar-admin.md
b/site2/docs/reference-pulsar-admin.md
index 459afce..53d33b1 100644
--- a/site2/docs/reference-pulsar-admin.md
+++ b/site2/docs/reference-pulsar-admin.md
@@ -310,6 +310,7 @@ Options
|`--broker-service-url `|The URL of the Pulsar broker||
|`--classname`|The name of the function’s class||
|`--custom-serde-inputs`|A map of the input topic to SerDe name||
+|`--custom-schema-inputs`|A map of the input topic to Schema class name||
|`--client-auth-params`|Client Authentication Params||
|`--function-config-file`|The path of the YAML config file used to configure
the function||
|`--hostname-verification-enabled`|Enable Hostname verification||
@@ -354,6 +355,7 @@ Options
|`--auto-ack`|Let the functions framework manage acking||
|`--classname`|The name of the function’s class||
|`--custom-serde-inputs`|A map of the input topic to SerDe name||
+|`--custom-schema-inputs`|A map of the input topic to Schema class name||
|`--function-config-file`|The path of the YAML config file used to configure
the function||
|`--inputs`|The input topics for the function (as a comma-separated list if
more than one topic is desired)||
|`--log-topic`|The topic to which logs from this function are published||
@@ -411,6 +413,7 @@ Options
|`--auto-ack`|Let the functions framework manage acking||
|`--classname`|The name of the function’s class||
|`--custom-serde-inputs`|A map of the input topic to SerDe name||
+|`--custom-schema-inputs`|A map of the input topic to Schema class name||
|`--function-config-file`|The path of the YAML config file used to configure
the function||
|`--inputs`|The input topics for the function (as a comma-separated list if
more than one topic is desired)||
|`--log-topic`|The topic to which logs from this function are published||