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.
|
Collection<DataFileMeta> |
dataFiles()
Get all data files maintained by this writer.
|
boolean |
isCompacting()
Check if a compaction is in progress, or if a compaction result remains to be fetched.
|
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
RecordWriter
write
in interface RecordWriter<KeyValue>
Exception
public void compact(boolean fullCompaction) throws Exception
RecordWriter
compact
in interface RecordWriter<KeyValue>
fullCompaction
- whether to trigger full compaction or just normal compactionException
public void addNewFiles(List<DataFileMeta> files)
RecordWriter
CompactManager
.addNewFiles
in interface RecordWriter<KeyValue>
files
- files to addpublic Collection<DataFileMeta> dataFiles()
RecordWriter
dataFiles
in interface RecordWriter<KeyValue>
public long maxSequenceNumber()
RecordWriter
maxSequenceNumber
in interface RecordWriter<KeyValue>
public CommitIncrement prepareCommit(boolean waitCompaction) throws Exception
RecordWriter
prepareCommit
in interface RecordWriter<KeyValue>
waitCompaction
- if this method need to wait for current compaction to completeException
public boolean isCompacting()
RecordWriter
isCompacting
in interface RecordWriter<KeyValue>
public void sync() throws Exception
RecordWriter
sync
in interface RecordWriter<KeyValue>
Exception
public void withInsertOnly(boolean insertOnly)
RecordWriter
withInsertOnly
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
RecordWriter
close
in interface RecordWriter<KeyValue>
Exception
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.