leventov commented on a change in pull request #8059: Refactoring to use
`CollectionUtils.mapValues`
URL: https://github.com/apache/incubator-druid/pull/8059#discussion_r303090847
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java
##########
@@ -444,8 +445,7 @@ public TaskStatus run(final TaskToolbox toolbox)
toolbox.getTaskActionClient(),
intervals
);
- versions = locks.entrySet().stream()
- .collect(Collectors.toMap(Entry::getKey, entry ->
entry.getValue().getVersion()));
+ versions = CollectionUtils.mapValues(locks, v -> v.getVersion());
Review comment:
It's more readable to use method references in such cases because it makes
evident the type of the value: `versions = CollectionUtils.mapValues(locks,
TaskLock::getVersion);`. Or, it's better to choose more descriptive lambda
param names (e. g. `taskLock`) than just `v`.
Same applies to many other places in this PR.
----------------------------------------------------------------
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]