srkukarni commented on a change in pull request #1859: improving config
validation
URL: https://github.com/apache/incubator-pulsar/pull/1859#discussion_r191643829
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
##########
@@ -320,37 +310,12 @@ void processArguments() throws Exception {
functionConfig.setUserConfig(new HashMap<>());
}
- if (functionConfig.getInputs().isEmpty() &&
functionConfig.getCustomSerdeInputs().isEmpty()) {
- throw new RuntimeException("No input topic(s) specified for
the function");
- }
-
- // Ensure that topics aren't being used as both input and output
- verifyNoTopicClash(functionConfig.getInputs(),
functionConfig.getOutput());
-
- if (parallelism == null) {
- if (functionConfig.getParallelism() == 0) {
- functionConfig.setParallelism(1);
- }
- } else {
- int num = Integer.parseInt(parallelism);
- if (num <= 0) {
- throw new IllegalArgumentException("The parallelism factor
(the number of instances) for the function must be positive");
- }
- functionConfig.setParallelism(num);
+ if (parallelism != null) {
Review comment:
dont we need to check if parallelism < 0
----------------------------------------------------------------
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