Package org.apache.druid.data.input
Class SegmentsSplitHintSpec
- java.lang.Object
-
- org.apache.druid.data.input.SegmentsSplitHintSpec
-
- All Implemented Interfaces:
SplitHintSpec
public class SegmentsSplitHintSpec extends Object implements SplitHintSpec
SplitHintSpecfor IngestSegmentFirehoseFactory and DruidInputSource. In DruidInputSource, this spec is converted intoMaxSizeSplitHintSpec. As a result, itssplit(java.util.Iterator<T>, java.util.function.Function<T, org.apache.druid.data.input.InputFileAttribute>)method is never called (IngestSegmentFirehoseFactory creates splits on its own instead of calling thesplit()method). This doesn't necessarily mean this class is deprecated in favor of the MaxSizeSplitHintSpec. We may want to create more optimized splits in the future. For example, segments can be split to maximize the rollup ratio if the segments have different sets of columns or even different value ranges of columns.
-
-
Constructor Summary
Constructors Constructor Description SegmentsSplitHintSpec(HumanReadableBytes maxInputSegmentBytesPerTask, Integer maxNumSegments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)HumanReadableBytesgetMaxInputSegmentBytesPerTask()intgetMaxNumSegments()inthashCode()<T> Iterator<List<T>>split(Iterator<T> inputIterator, Function<T,InputFileAttribute> inputAttributeExtractor)Returns an iterator of splits.StringtoString()
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SegmentsSplitHintSpec
public SegmentsSplitHintSpec(@Nullable HumanReadableBytes maxInputSegmentBytesPerTask, @Nullable Integer maxNumSegments)
-
-
Method Detail
-
getMaxInputSegmentBytesPerTask
public HumanReadableBytes getMaxInputSegmentBytesPerTask()
-
getMaxNumSegments
public int getMaxNumSegments()
-
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.
-
-