public class PostponeBucketWriter extends Object implements RecordWriter<KeyValue>
RecordWriter for bucket = -2 tables.| Constructor and Description |
|---|
PostponeBucketWriter(KeyValueFileWriterFactory writerFactory) |
| 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.
|
boolean |
compactNotCompleted()
Check if a compaction is in progress, or if a compaction result remains to be fetched, or if
a compaction should be triggered later.
|
Collection<DataFileMeta> |
dataFiles()
Get all data files maintained by this writer.
|
long |
maxSequenceNumber()
Get max sequence number of records written by this writer.
|
CommitIncrement |
prepareCommit(boolean waitCompaction)
Prepare for a commit.
|
void |
sync()
Sync the writer.
|
void |
withInsertOnly(boolean insertOnly)
This method is called when the insert only status of the records changes.
|
void |
write(KeyValue record)
Add a key-value element to the writer.
|
public PostponeBucketWriter(KeyValueFileWriterFactory writerFactory)
public void write(KeyValue record) throws Exception
RecordWriterwrite in interface RecordWriter<KeyValue>Exceptionpublic void compact(boolean fullCompaction)
throws Exception
RecordWritercompact in interface RecordWriter<KeyValue>fullCompaction - whether to trigger full compaction or just normal compactionExceptionpublic void addNewFiles(List<DataFileMeta> files)
RecordWriterCompactManager.addNewFiles in interface RecordWriter<KeyValue>files - files to addpublic Collection<DataFileMeta> dataFiles()
RecordWriterdataFiles in interface RecordWriter<KeyValue>public long maxSequenceNumber()
RecordWritermaxSequenceNumber in interface RecordWriter<KeyValue>public CommitIncrement prepareCommit(boolean waitCompaction) throws Exception
RecordWriterprepareCommit in interface RecordWriter<KeyValue>waitCompaction - if this method need to wait for current compaction to completeExceptionpublic boolean compactNotCompleted()
RecordWritercompactNotCompleted in interface RecordWriter<KeyValue>public void sync()
throws Exception
RecordWritersync in interface RecordWriter<KeyValue>Exceptionpublic void withInsertOnly(boolean insertOnly)
RecordWriterwithInsertOnly in interface RecordWriter<KeyValue>insertOnly - If true, all the following records would be of RowKind.INSERT, and no two records would have the same primary
key.public void close()
throws Exception
RecordWriterclose in interface RecordWriter<KeyValue>ExceptionCopyright © 2023–2025 The Apache Software Foundation. All rights reserved.