code: public Collection<DataSegment> getLazyAllSegments()
    {
      return CollectionUtils.createLazyCollectionFromStream(
          () -> dataSources.values().stream().flatMap(dataSource -> dataSource.getSegments().stream()),
          totalSegments
      );
    }
docs: 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).
  
  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.