You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/03 21:32:47 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #9441: Improve OvershadowableManager performance

suneet-s commented on a change in pull request #9441: Improve OvershadowableManager performance
URL: https://github.com/apache/druid/pull/9441#discussion_r387246293
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
 ##########
 @@ -482,7 +483,12 @@ public boolean isOvershadowed(Interval interval, VersionType version, ObjectType
         if (versionCompare > 0) {
           return false;
         } else if (versionCompare == 0) {
-          if (timelineEntry.partitionHolder.stream().noneMatch(chunk -> chunk.getObject().overshadows(object))) {
+          // Intentionally use the Iterators API instead of the stream API for performance.
+          //noinspection ConstantConditions
+          final boolean nonOvershadowedObject = Iterators.all(
+              timelineEntry.partitionHolder.iterator(), chunk -> !chunk.getObject().overshadows(object)
 
 Review comment:
   Are we guaranteed that `chunk.getObject` will never be null?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org