public class StoreSinkWriteImpl extends Object implements StoreSinkWrite
StoreSinkWrite
. This writer does not have states.StoreSinkWrite.Provider, StoreSinkWrite.WithWriteBufferProvider
Modifier and Type | Field and Description |
---|---|
protected String |
commitUser |
protected StoreSinkWriteState |
state |
protected TableWriteImpl<?> |
write |
Constructor and Description |
---|
StoreSinkWriteImpl(FileStoreTable table,
String commitUser,
StoreSinkWriteState state,
org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
boolean ignorePreviousFiles,
boolean waitCompaction,
boolean isStreamingMode,
MemoryPoolFactory memoryPoolFactory,
org.apache.flink.metrics.MetricGroup metricGroup) |
StoreSinkWriteImpl(FileStoreTable table,
String commitUser,
StoreSinkWriteState state,
org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
boolean ignorePreviousFiles,
boolean waitCompaction,
boolean isStreamingMode,
MemorySegmentPool memoryPool,
org.apache.flink.metrics.MetricGroup metricGroup) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
compact(BinaryRow partition,
int bucket,
boolean fullCompaction) |
TableWriteImpl<?> |
getWrite() |
void |
notifyNewFiles(long snapshotId,
BinaryRow partition,
int bucket,
List<DataFileMeta> files) |
List<Committable> |
prepareCommit(boolean waitCompaction,
long checkpointId) |
void |
replace(FileStoreTable newTable)
Replace the internal
TableWriteImpl with the one provided by newWriteProvider . |
void |
snapshotState() |
boolean |
streamingMode() |
SinkRecord |
toLogRecord(SinkRecord record) |
void |
withCompactExecutor(ExecutorService compactExecutor) |
void |
withInsertOnly(boolean insertOnly)
This method is called when the insert only status of the records changes.
|
SinkRecord |
write(InternalRow rowData) |
SinkRecord |
write(InternalRow rowData,
int bucket) |
protected final String commitUser
protected final StoreSinkWriteState state
protected TableWriteImpl<?> write
public StoreSinkWriteImpl(FileStoreTable table, String commitUser, StoreSinkWriteState state, org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, boolean ignorePreviousFiles, boolean waitCompaction, boolean isStreamingMode, @Nullable MemorySegmentPool memoryPool, @Nullable org.apache.flink.metrics.MetricGroup metricGroup)
public StoreSinkWriteImpl(FileStoreTable table, String commitUser, StoreSinkWriteState state, org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, boolean ignorePreviousFiles, boolean waitCompaction, boolean isStreamingMode, MemoryPoolFactory memoryPoolFactory, @Nullable org.apache.flink.metrics.MetricGroup metricGroup)
public void withCompactExecutor(ExecutorService compactExecutor)
public void withInsertOnly(boolean insertOnly)
StoreSinkWrite
withInsertOnly
in interface StoreSinkWrite
insertOnly
- If true, all the following records would be of RowKind.INSERT
, and no two records would have the same primary
key.@Nullable public SinkRecord write(InternalRow rowData) throws Exception
write
in interface StoreSinkWrite
Exception
@Nullable public SinkRecord write(InternalRow rowData, int bucket) throws Exception
write
in interface StoreSinkWrite
Exception
public SinkRecord toLogRecord(SinkRecord record)
toLogRecord
in interface StoreSinkWrite
public void compact(BinaryRow partition, int bucket, boolean fullCompaction) throws Exception
compact
in interface StoreSinkWrite
Exception
public void notifyNewFiles(long snapshotId, BinaryRow partition, int bucket, List<DataFileMeta> files)
notifyNewFiles
in interface StoreSinkWrite
public List<Committable> prepareCommit(boolean waitCompaction, long checkpointId) throws IOException
prepareCommit
in interface StoreSinkWrite
IOException
public void snapshotState() throws Exception
snapshotState
in interface StoreSinkWrite
Exception
public boolean streamingMode()
streamingMode
in interface StoreSinkWrite
public void close() throws Exception
close
in interface StoreSinkWrite
Exception
public void replace(FileStoreTable newTable) throws Exception
StoreSinkWrite
TableWriteImpl
with the one provided by newWriteProvider
. The state of the old TableWriteImpl
will also be transferred to
the new TableWriteImpl
by TableWriteImpl.checkpoint()
and TableWriteImpl.restore(List)
.
Currently, this method is only used by CDC sinks because they need to deal with schema
changes. TableWriteImpl
with the new schema will be provided by newWriteProvider
.
replace
in interface StoreSinkWrite
Exception
@VisibleForTesting public TableWriteImpl<?> getWrite()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.