clintropolis commented on a change in pull request #8089: add
CachingClusteredClient benchmark, refactor some stuff
URL: https://github.com/apache/incubator-druid/pull/8089#discussion_r304648991
##########
File path:
core/src/main/java/org/apache/druid/collections/CombiningIterable.java
##########
@@ -51,37 +50,32 @@
return create(
new MergeIterable<InType>(comparator, (Iterable<Iterable<InType>>) in),
comparator,
- new BinaryFn<InType, InType, InType>()
- {
- @Override
- public InType apply(InType arg1, InType arg2)
- {
- if (arg1 == null) {
- return arg2;
- }
- return arg1;
+ (arg1, arg2) -> {
Review comment:
This pattern is in a lot of places, but this is the only place specifically
where it's done to just return one or the other, not as a mechanism to bail
early before doing some sort of combine. Is it still worth moving to
`GuavaUtils` or should it just be a private static method of this class?
Additionally, this method seems `@Nullable` which makes it have a different
contract than `Objects.firstNonNull`, which requires one of the 2 arguments not
be null. Prohibiting it on this functions behalf doesn't seem necessary, so are
we doing it for a reason in #6948?
----------------------------------------------------------------
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]