Interface SegmentPruner

All Known Implementing Classes:
CompositeSegmentPruner, FilterSegmentPruner

public interface SegmentPruner
  • Method Details

    • include

      boolean include(DataSegment segment)
      Check if a DataSegment should be included or not. If this method returns false, the segment can be skipped during processing.
    • prune

      default <T> Collection<T> prune(Iterable<T> input, Function<T,DataSegment> converter)
      Filter the given Iterable of objects containing a DataSegment (obtained from the converter function), to reduce the overall working set which need to be processed.
      Type Parameters:
      T - This can be any type, as long as transform function is provided to extract a DataSegment
      Parameters:
      input - The iterable of objects to be filtered
      converter - The function to convert T to DataSegment to include(DataSegment)
      Returns:
      The set of pruned object, in the same order as input
    • combine

      SegmentPruner combine(SegmentPruner other)
      Returns:
      combined SegmentPruner, which if both are of the same type may be merged into a new pruner of the same type that contains the information of both, or if not directly combinable, implementors should create a CompositeSegmentPruner