public class SegmentsSplitHintSpec extends Object implements SplitHintSpec
SplitHintSpec
for IngestSegmentFirehoseFactory and DruidInputSource.
In DruidInputSource, this spec is converted into MaxSizeSplitHintSpec
. As a result, its split(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 the
split()
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 and Description |
---|
SegmentsSplitHintSpec(HumanReadableBytes maxInputSegmentBytesPerTask,
Integer maxNumSegments) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
HumanReadableBytes |
getMaxInputSegmentBytesPerTask() |
int |
getMaxNumSegments() |
int |
hashCode() |
<T> Iterator<List<T>> |
split(Iterator<T> inputIterator,
Function<T,InputFileAttribute> inputAttributeExtractor)
Returns an iterator of splits.
|
String |
toString() |
public static final String TYPE
public SegmentsSplitHintSpec(@Nullable HumanReadableBytes maxInputSegmentBytesPerTask, @Nullable Integer maxNumSegments)
public HumanReadableBytes getMaxInputSegmentBytesPerTask()
public int getMaxNumSegments()
public <T> Iterator<List<T>> split(Iterator<T> inputIterator, Function<T,InputFileAttribute> inputAttributeExtractor)
SplitHintSpec
T
.split
in interface SplitHintSpec
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.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.