|
29 | 29 | import org.apache.flink.cdc.common.schema.Schema;
|
30 | 30 | import org.apache.flink.runtime.jobgraph.OperatorID;
|
31 | 31 | import org.apache.flink.runtime.state.StateInitializationContext;
|
| 32 | +import org.apache.flink.runtime.state.StateSnapshotContext; |
32 | 33 | import org.apache.flink.streaming.api.connector.sink2.CommittableMessage;
|
33 | 34 | import org.apache.flink.streaming.api.graph.StreamConfig;
|
34 | 35 | import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
|
35 | 36 | import org.apache.flink.streaming.api.operators.BoundedOneInput;
|
36 | 37 | import org.apache.flink.streaming.api.operators.ChainingStrategy;
|
37 | 38 | import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
|
38 | 39 | import org.apache.flink.streaming.api.operators.Output;
|
| 40 | +import org.apache.flink.streaming.api.watermark.Watermark; |
39 | 41 | import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
|
40 | 42 | import org.apache.flink.streaming.runtime.tasks.ProcessingTimeService;
|
41 | 43 | import org.apache.flink.streaming.runtime.tasks.StreamTask;
|
| 44 | +import org.apache.flink.streaming.runtime.watermarkstatus.WatermarkStatus; |
42 | 45 |
|
43 | 46 | import java.lang.reflect.Constructor;
|
44 | 47 | import java.lang.reflect.Field;
|
@@ -123,6 +126,26 @@ public void initializeState(StateInitializationContext context) throws Exception
|
123 | 126 | .initializeState(context);
|
124 | 127 | }
|
125 | 128 |
|
| 129 | + @Override |
| 130 | + public void snapshotState(StateSnapshotContext context) throws Exception { |
| 131 | + this.<AbstractStreamOperator<CommittableMessage<CommT>>>getFlinkWriterOperator() |
| 132 | + .snapshotState(context); |
| 133 | + } |
| 134 | + |
| 135 | + @Override |
| 136 | + public void processWatermark(Watermark mark) throws Exception { |
| 137 | + super.processWatermark(mark); |
| 138 | + this.<AbstractStreamOperator<CommittableMessage<CommT>>>getFlinkWriterOperator() |
| 139 | + .processWatermark(mark); |
| 140 | + } |
| 141 | + |
| 142 | + @Override |
| 143 | + public void processWatermarkStatus(WatermarkStatus watermarkStatus) throws Exception { |
| 144 | + super.processWatermarkStatus(watermarkStatus); |
| 145 | + this.<AbstractStreamOperator<CommittableMessage<CommT>>>getFlinkWriterOperator() |
| 146 | + .processWatermarkStatus(watermarkStatus); |
| 147 | + } |
| 148 | + |
126 | 149 | @Override
|
127 | 150 | public void processElement(StreamRecord<Event> element) throws Exception {
|
128 | 151 | Event event = element.getValue();
|
|
0 commit comments