jihoonson commented on a change in pull request #9441: Improve 
OvershadowableManager performance
URL: https://github.com/apache/druid/pull/9441#discussion_r389856246
 
 

 ##########
 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:
   If you are asking whether we guarantee that programmatically, then I don't 
think so. But the object in the chunk should 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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to