T
- type of record to write.public interface FileStoreWrite<T> extends Restorable<List<FileStoreWrite.State<T>>>
Modifier and Type | Interface and Description |
---|---|
static class |
FileStoreWrite.State<T>
Recoverable state of
FileStoreWrite . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the writer.
|
void |
compact(BinaryRow partition,
int bucket,
boolean fullCompaction)
Compact data stored in given partition and bucket.
|
void |
notifyNewFiles(long snapshotId,
BinaryRow partition,
int bucket,
List<DataFileMeta> files)
Notify that some new files are created at given snapshot in given bucket.
|
List<CommitMessage> |
prepareCommit(boolean waitCompaction,
long commitIdentifier)
Prepare commit in the write.
|
void |
withCompactExecutor(ExecutorService compactExecutor) |
void |
withExecutionMode(boolean isStreamingMode)
We detect whether it is in batch mode, if so, we do some optimization.
|
void |
withIgnorePreviousFiles(boolean ignorePreviousFiles)
Set whether the write operation should ignore previously stored files.
|
void |
withInsertOnly(boolean insertOnly)
This method is called when the insert only status of the records changes.
|
FileStoreWrite<T> |
withIOManager(IOManager ioManager) |
default FileStoreWrite<T> |
withMemoryPool(MemorySegmentPool memoryPool)
With memory pool for the current file store write.
|
FileStoreWrite<T> |
withMemoryPoolFactory(MemoryPoolFactory memoryPoolFactory)
With memory pool factory for the current file store write.
|
FileStoreWrite<T> |
withMetricRegistry(MetricRegistry metricRegistry)
With metrics to measure compaction.
|
void |
write(BinaryRow partition,
int bucket,
T data)
Write the data to the store according to the partition and bucket.
|
checkpoint, restore
FileStoreWrite<T> withIOManager(IOManager ioManager)
default FileStoreWrite<T> withMemoryPool(MemorySegmentPool memoryPool)
memoryPool
- the given memory pool.FileStoreWrite<T> withMemoryPoolFactory(MemoryPoolFactory memoryPoolFactory)
memoryPoolFactory
- the given memory pool factory.void withIgnorePreviousFiles(boolean ignorePreviousFiles)
ignorePreviousFiles
- whether the write operation should ignore previously stored files.void withExecutionMode(boolean isStreamingMode)
isStreamingMode
- whether in streaming modeFileStoreWrite<T> withMetricRegistry(MetricRegistry metricRegistry)
void withCompactExecutor(ExecutorService compactExecutor)
void withInsertOnly(boolean insertOnly)
insertOnly
- If true, all the following records would be of RowKind.INSERT
, and no two records would have the same primary
key.void write(BinaryRow partition, int bucket, T data) throws Exception
partition
- the partition of the databucket
- the bucket id of the datadata
- the given dataException
- the thrown exception when writing the recordvoid compact(BinaryRow partition, int bucket, boolean fullCompaction) throws Exception
partition
- the partition to compactbucket
- the bucket to compactfullCompaction
- whether to trigger full compaction or just normal compactionException
- the thrown exception when compacting the recordsvoid notifyNewFiles(long snapshotId, BinaryRow partition, int bucket, List<DataFileMeta> files)
Most probably, these files are created by another job. Currently this method is only used by the dedicated compact job to see files created by writer jobs.
snapshotId
- the snapshot id where new files are createdpartition
- the partition where new files are createdbucket
- the bucket where new files are createdfiles
- the new files themselvesList<CommitMessage> prepareCommit(boolean waitCompaction, long commitIdentifier) throws Exception
waitCompaction
- if this method need to wait for current compaction to completecommitIdentifier
- identifier of the commit being preparedException
- the thrown exceptionCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.