|
28 | 28 | import io.github.zhztheplayer.velox4j.plan.StatefulPlanNode; |
29 | 29 | import io.github.zhztheplayer.velox4j.query.Query; |
30 | 30 | import io.github.zhztheplayer.velox4j.query.SerialTask; |
| 31 | +import io.github.zhztheplayer.velox4j.stateful.NativeCallbackTarget; |
31 | 32 | import io.github.zhztheplayer.velox4j.stateful.StatefulElement; |
32 | 33 | import io.github.zhztheplayer.velox4j.stateful.StatefulRecord; |
33 | 34 | import io.github.zhztheplayer.velox4j.stateful.StatefulWatermark; |
|
50 | 51 | * instead of flink RowData. |
51 | 52 | */ |
52 | 53 | public class GlutenTwoInputOperator<IN, OUT> extends AbstractStreamOperator<OUT> |
53 | | - implements TwoInputStreamOperator<IN, IN, OUT>, GlutenOperator { |
| 54 | + implements TwoInputStreamOperator<IN, IN, OUT>, GlutenOperator, NativeCallbackTarget { |
54 | 55 |
|
55 | 56 | private static final Logger LOG = LoggerFactory.getLogger(GlutenTwoInputOperator.class); |
56 | 57 |
|
@@ -139,6 +140,11 @@ public void scheduleProcessElementOnMailbox() { |
139 | 140 | scheduleDrainOnMailbox(this::drainTaskOutput); |
140 | 141 | } |
141 | 142 |
|
| 143 | + @Override |
| 144 | + public void onProcessElement() { |
| 145 | + scheduleProcessElementOnMailbox(); |
| 146 | + } |
| 147 | + |
142 | 148 | @Override |
143 | 149 | public void processElement1(StreamRecord<IN> element) { |
144 | 150 | StatefulRecord statefulRecord = |
@@ -296,6 +302,7 @@ private void initSession() { |
296 | 302 | VeloxQueryConfig.getConfig(getRuntimeContext()), |
297 | 303 | VeloxConnectorConfig.getConfig(getRuntimeContext())); |
298 | 304 | task = sessionResource.getSession().queryOps().execute(query); |
| 305 | + task.bindNativeCallbackTarget(this); |
299 | 306 |
|
300 | 307 | ExternalStreamConnectorSplit leftSplit = |
301 | 308 | new ExternalStreamConnectorSplit("connector-external-stream", leftInputQueue.id()); |
|
0 commit comments