narendly commented on a change in pull request #883: Support enableCompression
in workflow and job configs
URL: https://github.com/apache/helix/pull/883#discussion_r391799625
##########
File path: helix-core/src/main/java/org/apache/helix/task/JobConfig.java
##########
@@ -553,8 +556,11 @@ public static Builder fromMap(Map<String, String> cfg) {
}
if (cfg.containsKey(JobConfigProperty.RebalanceRunningTask.name())) {
b.setRebalanceRunningTask(
-
Boolean.valueOf(cfg.get(JobConfigProperty.RebalanceRunningTask.name())));
+
Boolean.parseBoolean(cfg.get(JobConfigProperty.RebalanceRunningTask.name())));
}
+ // If not set, parseBoolean returns false for null
+ b.setEnableCompression(
Review comment:
@dasahcc
This is the implementation for parseBoolean() if the comment wasn't clear:
```
public static boolean parseBoolean(String s) {
return ((s != null) && s.equalsIgnoreCase("true"));
}
```
Do you see why the null check is not necessary?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]