leventov commented on a change in pull request #7653: Refactor 
SQLMetadataSegmentManager; Change contract of REST methods in 
DataSourcesResource
URL: https://github.com/apache/incubator-druid/pull/7653#discussion_r300857063
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/client/ImmutableDruidServer.java
 ##########
 @@ -128,23 +128,26 @@ public ImmutableDruidDataSource getDataSource(String 
name)
   }
 
   /**
-   * Returns a lazy collection with all segments in all data sources, stored 
on this ImmutableDruidServer. The order
-   * of segments in this collection is unspecified.
-   *
-   * Calling {@link Collection#size()} on the returned collection is cheap, 
O(1).
+   * Returns a lazy collection with all segments in all data sources stored on 
this ImmutableDruidServer to be used for
+   * iteration or {@link Collection#stream()} transformation. The order of 
segments 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<DataSegment> getLazyAllSegments()
+  public Collection<DataSegment> iterateAllSegments()
 
 Review comment:
   This is intentional: collections returned from all methods whose names start 
with `iterate-` are not expected to be stored anywhere. They are only expected 
to be consumed immediately in a for-each statement, `forEach()` call or a 
Stream pipeline.

----------------------------------------------------------------
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