egor-ryashin commented on a change in pull request #7306: Reconcile terminology
and method naming to 'used/unused segments'; Rename MetadataSegmentManager to
MetadataSegments
URL: https://github.com/apache/incubator-druid/pull/7306#discussion_r272328362
##########
File path:
core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
##########
@@ -115,6 +122,32 @@ public static void addSegments(
return allTimelineEntries;
}
+ /**
+ * Returns a lazy collection with all objects in this
VersionedIntervalTimeline to be used for iteration or {@link
+ * Collection#stream()} transformation. The order of objects in this
collection is unspecified.
+ *
+ * Note: iteration over the returned collection may not be as trivially
cheap as, for example, iteration over an
+ * ArrayList. Try (to some reasonable extent) to organize the code so that
it iterates the returned collection only
+ * once rather than several times.
+ */
+ public Collection<ObjectType> iterateAllObjects()
+ {
+ return CollectionUtils.createLazyCollectionFromStream(
+ () -> allTimelineEntries
Review comment:
`allTimelineEntries` makes me think there's another collection with a subset
of "all", but it isn't.
----------------------------------------------------------------
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]