Class MaxSizeSplitHintSpec

java.lang.Object
org.apache.druid.data.input.MaxSizeSplitHintSpec
All Implemented Interfaces:
SplitHintSpec

public class MaxSizeSplitHintSpec extends Object implements SplitHintSpec
A SplitHintSpec that can create splits of multiple files. A split created by this class can have one or more input files. If there is only one file in the split, its size can be larger than maxSplitSize. If there are two or more files in the split, their total size cannot be larger than maxSplitSize.
  • Field Details

  • Constructor Details

    • MaxSizeSplitHintSpec

      public MaxSizeSplitHintSpec(@Nullable HumanReadableBytes maxSplitSize, @Nullable Integer maxNumFiles)
    • MaxSizeSplitHintSpec

      public MaxSizeSplitHintSpec(long maxSplitSize, @Nullable Integer maxNumFiles)
  • Method Details

    • getMaxSplitSize

      public HumanReadableBytes getMaxSplitSize()
    • getMaxNumFiles

      public int getMaxNumFiles()
    • split

      public <T> Iterator<List<T>> split(Iterator<T> inputIterator, Function<T,InputFileAttribute> inputAttributeExtractor)
      Description copied from interface: SplitHintSpec
      Returns an iterator of splits. A split has a list of files of the type SplitHintSpec.
      Specified by:
      split in interface SplitHintSpec
      Parameters:
      inputIterator - that returns input files.
      inputAttributeExtractor - to create InputFileAttribute for each input file. This may involve a network call, so implementations of SplitHintSpec should use it only if needed, and reuse results if appropriate.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object