srkukarni commented on a change in pull request #2266: Integrate functions and 
io with schema registry
URL: https://github.com/apache/incubator-pulsar/pull/2266#discussion_r206321695
 
 

 ##########
 File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
 ##########
 @@ -289,16 +301,31 @@ void processArguments() throws Exception {
             }
 
             if (null != inputs) {
-                List<String> inputTopics = Arrays.asList(inputs.split(","));
-                functionConfig.setInputs(inputTopics);
+                Arrays.asList(inputs.split(",")).forEach(topic -> {
+                    functionConfig.getTopicsSchema().put(topic, 
ConsumerConfig.builder()
+                            .schemaTypeOrClassName(schemaTypeOrClassName)
+                            .isRegexPattern(false)
+                            .build());
+                });
             }
             if (null != customSerdeInputString) {
                 Type type = new TypeToken<Map<String, String>>(){}.getType();
                 Map<String, String> customSerdeInputMap = new 
Gson().fromJson(customSerdeInputString, type);
-                functionConfig.setCustomSerdeInputs(customSerdeInputMap);
+
+                customSerdeInputMap.forEach((topic, serde) -> {
+                    functionConfig.getTopicsSchema().put(topic, 
ConsumerConfig.builder()
+                            .schemaTypeOrClassName(serde)
+                            .isRegexPattern(false)
+                            .build());
+                });
             }
             if (null != topicsPattern) {
-                functionConfig.setTopicsPattern(topicsPattern);
+                ConsumerConfig conf = 
functionConfig.getTopicsSchema().get(topicsPattern);
+                String schema = (conf != null) ? 
conf.getSchemaTypeOrClassName() : "";
+                functionConfig.getTopicsSchema().put(topicsPattern, 
ConsumerConfig.builder()
+                        .schemaTypeOrClassName(schema)
+                        .isRegexPattern(false)
 
 Review comment:
   true?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to