public class BootstrapOperator<I,O extends HoodieRecord<?>>
extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<O>
implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<I,O>
Each subtask of the function triggers the index bootstrap when the first element came in, the record cannot be sent until all the index records have been sent.
The output records should then shuffle by the recordKey and thus do scalable write.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.configuration.Configuration |
conf |
protected org.apache.hadoop.conf.Configuration |
hadoopConf |
protected HoodieTable<?,?,?,?> |
hoodieTable |
protected HoodieWriteConfig |
writeConfig |
| Constructor and Description |
|---|
BootstrapOperator(org.apache.flink.configuration.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
static HoodieRecord |
generateHoodieRecord(HoodieKey hoodieKey,
FileSlice fileSlice) |
void |
initializeState(org.apache.flink.runtime.state.StateInitializationContext context) |
boolean |
isAlreadyBootstrap() |
protected void |
loadRecords(String partitionPath)
Loads all the indices of give partition path into the backup state.
|
protected void |
preLoadIndexRecords()
Load the index records before
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<I>). |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<I> element) |
protected boolean |
shouldLoadFile(String fileId,
int maxParallelism,
int parallelism,
int taskID) |
void |
snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context) |
close, finish, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetKeyContextElementclose, finish, getMetricGroup, getOperatorID, initializeState, open, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompletegetCurrentKey, setCurrentKeyprotected HoodieTable<?,?,?,?> hoodieTable
protected final org.apache.flink.configuration.Configuration conf
protected transient org.apache.hadoop.conf.Configuration hadoopConf
protected transient HoodieWriteConfig writeConfig
public BootstrapOperator(org.apache.flink.configuration.Configuration conf)
public void snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)
throws Exception
snapshotState in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorsnapshotState in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<O extends HoodieRecord<?>>Exceptionpublic void initializeState(org.apache.flink.runtime.state.StateInitializationContext context)
throws Exception
initializeState in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorinitializeState in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<O extends HoodieRecord<?>>Exceptionprotected void preLoadIndexRecords()
throws Exception
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<I>).Exceptionpublic void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<I> element) throws Exception
protected void loadRecords(String partitionPath) throws Exception
partitionPath - The partition pathExceptionpublic static HoodieRecord generateHoodieRecord(HoodieKey hoodieKey, FileSlice fileSlice)
protected boolean shouldLoadFile(String fileId, int maxParallelism, int parallelism, int taskID)
Copyright © 2023 The Apache Software Foundation. All rights reserved.