public class StreamWriteOperatorCoordinator extends Object implements org.apache.flink.runtime.operators.coordination.OperatorCoordinator
OperatorCoordinator for StreamWriteFunction.
This coordinator starts a new instant when a new checkpoint starts. It commits the instant when all the operator tasks write the buffer successfully for a round of checkpoint.
If there is no data for a round of checkpointing, it resets the events buffer and returns early.
for the work flow and semantics| Modifier and Type | Class and Description |
|---|---|
static class |
StreamWriteOperatorCoordinator.Provider
Provider for
StreamWriteOperatorCoordinator. |
| Constructor and Description |
|---|
StreamWriteOperatorCoordinator(org.apache.flink.configuration.Configuration conf,
org.apache.flink.runtime.operators.coordination.OperatorCoordinator.Context context)
Constructs a StreamingSinkOperatorCoordinator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkpointCoordinator(long checkpointId,
CompletableFuture<byte[]> result) |
void |
close() |
void |
doSyncHive()
Sync hoodie table metadata to Hive metastore.
|
org.apache.flink.runtime.operators.coordination.OperatorCoordinator.Context |
getContext() |
WriteMetadataEvent[] |
getEventBuffer() |
String |
getInstant() |
void |
handleEventFromOperator(int i,
org.apache.flink.runtime.operators.coordination.OperatorEvent operatorEvent) |
void |
notifyCheckpointComplete(long checkpointId) |
void |
resetToCheckpoint(long checkpointID,
byte[] checkpointData) |
void |
setExecutor(NonThrownExecutor executor) |
void |
start() |
void |
subtaskFailed(int i,
@Nullable Throwable throwable) |
void |
subtaskReady(int i,
org.apache.flink.runtime.operators.coordination.OperatorCoordinator.SubtaskGateway subtaskGateway) |
void |
subtaskReset(int i,
long l) |
public StreamWriteOperatorCoordinator(org.apache.flink.configuration.Configuration conf,
org.apache.flink.runtime.operators.coordination.OperatorCoordinator.Context context)
conf - The config optionscontext - The coordinator contextpublic void start()
throws Exception
start in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorExceptionpublic void close()
throws Exception
close in interface AutoCloseableclose in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorExceptionpublic void checkpointCoordinator(long checkpointId,
CompletableFuture<byte[]> result)
checkpointCoordinator in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void notifyCheckpointComplete(long checkpointId)
notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListenernotifyCheckpointComplete in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void resetToCheckpoint(long checkpointID,
byte[] checkpointData)
resetToCheckpoint in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void handleEventFromOperator(int i,
org.apache.flink.runtime.operators.coordination.OperatorEvent operatorEvent)
handleEventFromOperator in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void subtaskFailed(int i,
@Nullable
@Nullable Throwable throwable)
subtaskFailed in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void subtaskReset(int i,
long l)
subtaskReset in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void subtaskReady(int i,
org.apache.flink.runtime.operators.coordination.OperatorCoordinator.SubtaskGateway subtaskGateway)
subtaskReady in interface org.apache.flink.runtime.operators.coordination.OperatorCoordinatorpublic void doSyncHive()
@VisibleForTesting public WriteMetadataEvent[] getEventBuffer()
@VisibleForTesting public String getInstant()
@VisibleForTesting public org.apache.flink.runtime.operators.coordination.OperatorCoordinator.Context getContext()
@VisibleForTesting public void setExecutor(NonThrownExecutor executor) throws Exception
ExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.