Package org.apache.druid.segment
Class IndexMergerV9
- java.lang.Object
-
- org.apache.druid.segment.IndexMergerV9
-
- All Implemented Interfaces:
IndexMerger
public class IndexMergerV9 extends Object implements IndexMerger
-
-
Field Summary
-
Fields inherited from interface org.apache.druid.segment.IndexMerger
INVALID_ROW, SERIALIZER_UTILS, UNLIMITED_MAX_COLUMNS_TO_MERGE
-
-
Constructor Summary
Constructors Constructor Description IndexMergerV9(com.fasterxml.jackson.databind.ObjectMapper mapper, IndexIO indexIO, SegmentWriteOutMediumFactory defaultSegmentWriteOutMediumFactory)This constructor is used only for Hadoop ingestion and Tranquility as they do not support storing empty columns yet.IndexMergerV9(com.fasterxml.jackson.databind.ObjectMapper mapper, IndexIO indexIO, SegmentWriteOutMediumFactory defaultSegmentWriteOutMediumFactory, boolean storeEmptyColumns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filemerge(List<IndexableAdapter> indexes, boolean rollup, AggregatorFactory[] metricAggs, File outDir, DimensionsSpec dimensionsSpec, IndexSpec indexSpec, int maxColumnsToMerge)Only used as a convenience method in tests.FilemergeQueryableIndex(List<QueryableIndex> indexes, boolean rollup, AggregatorFactory[] metricAggs, DimensionsSpec dimensionsSpec, File outDir, IndexSpec indexSpec, IndexSpec indexSpecForIntermediatePersists, ProgressIndicator progress, SegmentWriteOutMediumFactory segmentWriteOutMediumFactory, int maxColumnsToMerge)Merge a collection ofQueryableIndex.Filepersist(IncrementalIndex index, org.joda.time.Interval dataInterval, File outDir, IndexSpec indexSpec, ProgressIndicator progress, SegmentWriteOutMediumFactory segmentWriteOutMediumFactory)Persist an IncrementalIndex to disk in such a way that it can be loaded back up as aQueryableIndex.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.IndexMerger
mergeQueryableIndex, persist, persist
-
-
-
-
Constructor Detail
-
IndexMergerV9
public IndexMergerV9(com.fasterxml.jackson.databind.ObjectMapper mapper, IndexIO indexIO, SegmentWriteOutMediumFactory defaultSegmentWriteOutMediumFactory, boolean storeEmptyColumns)
-
IndexMergerV9
@Inject public IndexMergerV9(com.fasterxml.jackson.databind.ObjectMapper mapper, IndexIO indexIO, SegmentWriteOutMediumFactory defaultSegmentWriteOutMediumFactory)This constructor is used only for Hadoop ingestion and Tranquility as they do not support storing empty columns yet. SeeHadoopDruidIndexerConfigandPlumberSchoolfor hadoop ingestion and Tranquility, respectively.
-
-
Method Detail
-
persist
public File persist(IncrementalIndex index, org.joda.time.Interval dataInterval, File outDir, IndexSpec indexSpec, ProgressIndicator progress, @Nullable SegmentWriteOutMediumFactory segmentWriteOutMediumFactory) throws IOException
Description copied from interface:IndexMergerPersist an IncrementalIndex to disk in such a way that it can be loaded back up as aQueryableIndex. This is *not* thread-safe and havoc will ensue if this is called and writes are still occurring on the IncrementalIndex object.- Specified by:
persistin interfaceIndexMerger- Parameters:
index- the IncrementalIndex to persistdataInterval- the Interval that the data represents. Typically, this is the same as the interval from the correspondingSegmentId.outDir- the directory to persist the data toindexSpec- storage and compression optionsprogress- an object that will receive progress updatessegmentWriteOutMediumFactory- controls allocation of temporary data structures- Returns:
- the index output directory
- Throws:
IOException- if an IO error occurs persisting the index
-
mergeQueryableIndex
public File mergeQueryableIndex(List<QueryableIndex> indexes, boolean rollup, AggregatorFactory[] metricAggs, @Nullable DimensionsSpec dimensionsSpec, File outDir, IndexSpec indexSpec, IndexSpec indexSpecForIntermediatePersists, ProgressIndicator progress, @Nullable SegmentWriteOutMediumFactory segmentWriteOutMediumFactory, int maxColumnsToMerge) throws IOException
Description copied from interface:IndexMergerMerge a collection ofQueryableIndex.- Specified by:
mergeQueryableIndexin interfaceIndexMerger- Throws:
IOException
-
merge
public File merge(List<IndexableAdapter> indexes, boolean rollup, AggregatorFactory[] metricAggs, File outDir, DimensionsSpec dimensionsSpec, IndexSpec indexSpec, int maxColumnsToMerge) throws IOException
Description copied from interface:IndexMergerOnly used as a convenience method in tests. In production code, to merge multipleQueryableIndex, useIndexMerger.mergeQueryableIndex(List, boolean, AggregatorFactory[], DimensionsSpec, File, IndexSpec, IndexSpec, ProgressIndicator, SegmentWriteOutMediumFactory, int). To merge multipleIncrementalIndex, call one of theIndexMerger.persist(org.apache.druid.segment.incremental.IncrementalIndex, java.io.File, org.apache.druid.segment.IndexSpec, org.apache.druid.segment.writeout.SegmentWriteOutMediumFactory)methods and then merge the resultingQueryableIndex.- Specified by:
mergein interfaceIndexMerger- Throws:
IOException
-
-