public class MergeTreeCompactRewriter extends AbstractCompactRewriter
CompactRewriter
for merge trees.Modifier and Type | Field and Description |
---|---|
protected Comparator<InternalRow> |
keyComparator |
protected MergeSorter |
mergeSorter |
protected MergeFunctionFactory<KeyValue> |
mfFactory |
protected FileReaderFactory<KeyValue> |
readerFactory |
protected FieldsComparator |
userDefinedSeqComparator |
protected KeyValueFileWriterFactory |
writerFactory |
Constructor and Description |
---|
MergeTreeCompactRewriter(FileReaderFactory<KeyValue> readerFactory,
KeyValueFileWriterFactory writerFactory,
Comparator<InternalRow> keyComparator,
FieldsComparator userDefinedSeqComparator,
MergeFunctionFactory<KeyValue> mfFactory,
MergeSorter mergeSorter) |
Modifier and Type | Method and Description |
---|---|
protected void |
notifyRewriteCompactBefore(List<DataFileMeta> files) |
protected <T> RecordReader<T> |
readerForMergeTree(List<List<SortedRun>> sections,
MergeFunctionWrapper<T> mergeFunctionWrapper) |
CompactResult |
rewrite(int outputLevel,
boolean dropDelete,
List<List<SortedRun>> sections)
Rewrite sections to new level.
|
protected CompactResult |
rewriteCompaction(int outputLevel,
boolean dropDelete,
List<List<SortedRun>> sections) |
close, extractFilesFromSections, upgrade
protected final FileReaderFactory<KeyValue> readerFactory
protected final KeyValueFileWriterFactory writerFactory
protected final Comparator<InternalRow> keyComparator
@Nullable protected final FieldsComparator userDefinedSeqComparator
protected final MergeFunctionFactory<KeyValue> mfFactory
protected final MergeSorter mergeSorter
public MergeTreeCompactRewriter(FileReaderFactory<KeyValue> readerFactory, KeyValueFileWriterFactory writerFactory, Comparator<InternalRow> keyComparator, @Nullable FieldsComparator userDefinedSeqComparator, MergeFunctionFactory<KeyValue> mfFactory, MergeSorter mergeSorter)
public CompactResult rewrite(int outputLevel, boolean dropDelete, List<List<SortedRun>> sections) throws Exception
CompactRewriter
outputLevel
- new leveldropDelete
- whether to drop the deletion, see MergeTreeCompactManager.triggerCompaction(boolean)
sections
- list of sections (section is a list of SortedRun
s, and key intervals
between sections do not overlap)Exception
- exceptionprotected CompactResult rewriteCompaction(int outputLevel, boolean dropDelete, List<List<SortedRun>> sections) throws Exception
Exception
protected <T> RecordReader<T> readerForMergeTree(List<List<SortedRun>> sections, MergeFunctionWrapper<T> mergeFunctionWrapper) throws IOException
IOException
protected void notifyRewriteCompactBefore(List<DataFileMeta> files)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.