code: public Iterable<DataSegment> iterateAllSegments()
    {
      return () -> dataSources.values().stream().flatMap(dataSource -> dataSource.getSegments().stream()).iterator();
    }
docs: Returns an iterable to go over all segments in all data sources, stored on this DruidServer. The order in which
  segments are iterated is unspecified.
  
  Since this DruidServer can be mutated concurrently, the set of segments observed during an iteration may _not_ be
  a momentary snapshot of the segments on the server, in other words, it may be that there was no moment when the
  DruidServer stored exactly the returned set of segments.
  
  Note: the iteration 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 iterable only once rather than several
  times.