Package org.apache.druid.data.input
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 thanmaxSplitSize. If there are two or more files in the split, their total size cannot be larger thanmaxSplitSize.
-
-
Constructor Summary
Constructors Constructor Description MaxSizeSplitHintSpec(long maxSplitSize, Integer maxNumFiles)MaxSizeSplitHintSpec(HumanReadableBytes maxSplitSize, Integer maxNumFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetMaxNumFiles()HumanReadableBytesgetMaxSplitSize()inthashCode()<T> Iterator<List<T>>split(Iterator<T> inputIterator, Function<T,InputFileAttribute> inputAttributeExtractor)Returns an iterator of splits.
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:SplitHintSpecReturns an iterator of splits. A split has a list of files of the typeSplitHintSpec.- Specified by:
splitin interfaceSplitHintSpec- Parameters:
inputIterator- that returns input files.inputAttributeExtractor- to createInputFileAttributefor each input file. This may involve a network call, so implementations of SplitHintSpec should use it only if needed, and reuse results if appropriate.
-
-