T
- type of record to write.public interface RecordWriter<T>
RecordWriter
is responsible for writing data and handling in-progress files used to
write yet un-staged data. The incremental files ready to commit is returned to the system by the
prepareCommit(boolean)
.Modifier and Type | Interface and Description |
---|---|
static interface |
RecordWriter.CommitIncrement
Changes to commit.
|
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(T record)
Add a key-value element to the writer.
|
void write(T record) throws Exception
Exception
void compact(boolean fullCompaction) throws Exception
fullCompaction
- whether to trigger full compaction or just normal compactionException
void addNewFiles(List<DataFileMeta> files)
CompactManager
.files
- files to addRecordWriter.CommitIncrement prepareCommit(boolean blocking) throws Exception
blocking
- if this method need to wait for current compaction to completeException
void sync() throws Exception
Exception
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.