public class AppendOnlyWriter extends Object implements RecordWriter<org.apache.flink.table.data.RowData>
RecordWriter
implementation that only accepts records which are always insert
operations and don't have any unique keys or sort keys.RecordWriter.CommitIncrement
Constructor and Description |
---|
AppendOnlyWriter(long schemaId,
FileFormat fileFormat,
long targetFileSize,
org.apache.flink.table.types.logical.RowType writeSchema,
long maxSequenceNumber,
CompactManager compactManager,
boolean forceCompact,
DataFilePathFactory pathFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addNewFiles(List<DataFileMeta> files)
Add files to the internal
CompactManager . |
void |
close()
Close this writer, the call will delete newly generated but not committed files.
|
void |
compact(boolean fullCompaction)
Compact files related to the writer.
|
RecordWriter.CommitIncrement |
prepareCommit(boolean blocking)
Prepare for a commit.
|
void |
sync()
Sync the writer.
|
void |
write(org.apache.flink.table.data.RowData rowData)
Add a key-value element to the writer.
|
public AppendOnlyWriter(long schemaId, FileFormat fileFormat, long targetFileSize, org.apache.flink.table.types.logical.RowType writeSchema, long maxSequenceNumber, CompactManager compactManager, boolean forceCompact, DataFilePathFactory pathFactory)
public void write(org.apache.flink.table.data.RowData rowData) throws Exception
RecordWriter
write
in interface RecordWriter<org.apache.flink.table.data.RowData>
Exception
public void compact(boolean fullCompaction) throws Exception
RecordWriter
compact
in interface RecordWriter<org.apache.flink.table.data.RowData>
fullCompaction
- whether to trigger full compaction or just normal compactionException
public void addNewFiles(List<DataFileMeta> files)
RecordWriter
CompactManager
.addNewFiles
in interface RecordWriter<org.apache.flink.table.data.RowData>
files
- files to addpublic RecordWriter.CommitIncrement prepareCommit(boolean blocking) throws Exception
RecordWriter
prepareCommit
in interface RecordWriter<org.apache.flink.table.data.RowData>
blocking
- if this method need to wait for current compaction to completeException
public void sync() throws Exception
RecordWriter
sync
in interface RecordWriter<org.apache.flink.table.data.RowData>
Exception
public void close() throws Exception
RecordWriter
close
in interface RecordWriter<org.apache.flink.table.data.RowData>
Exception
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.