use of org.apache.flink.table.runtime.operators.join.JoinConditionWithNullFilters in project flink by apache.
the class WindowJoinOperator method open.
@Override
public void open() throws Exception {
super.open();
this.collector = new TimestampedCollector<>(output);
collector.eraseTimestamp();
final LongSerializer windowSerializer = LongSerializer.INSTANCE;
InternalTimerService<Long> internalTimerService = getInternalTimerService("window-timers", windowSerializer, this);
this.windowTimerService = new WindowTimerServiceImpl(internalTimerService, shiftTimeZone);
// init join condition
JoinCondition condition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader());
this.joinCondition = new JoinConditionWithNullFilters(condition, filterNullKeys, this);
this.joinCondition.setRuntimeContext(getRuntimeContext());
this.joinCondition.open(new Configuration());
// init state
ListStateDescriptor<RowData> leftRecordStateDesc = new ListStateDescriptor<>(LEFT_RECORDS_STATE_NAME, leftSerializer);
ListState<RowData> leftListState = getOrCreateKeyedState(windowSerializer, leftRecordStateDesc);
this.leftWindowState = new WindowListState<>((InternalListState<RowData, Long, RowData>) leftListState);
ListStateDescriptor<RowData> rightRecordStateDesc = new ListStateDescriptor<>(RIGHT_RECORDS_STATE_NAME, rightSerializer);
ListState<RowData> rightListState = getOrCreateKeyedState(windowSerializer, rightRecordStateDesc);
this.rightWindowState = new WindowListState<>((InternalListState<RowData, Long, RowData>) rightListState);
// metrics
this.leftNumLateRecordsDropped = metrics.counter(LEFT_LATE_ELEMENTS_DROPPED_METRIC_NAME);
this.leftLateRecordsDroppedRate = metrics.meter(LEFT_LATE_ELEMENTS_DROPPED_RATE_METRIC_NAME, new MeterView(leftNumLateRecordsDropped));
this.rightNumLateRecordsDropped = metrics.counter(RIGHT_LATE_ELEMENTS_DROPPED_METRIC_NAME);
this.rightLateRecordsDroppedRate = metrics.meter(RIGHT_LATE_ELEMENTS_DROPPED_RATE_METRIC_NAME, new MeterView(rightNumLateRecordsDropped));
this.watermarkLatency = metrics.gauge(WATERMARK_LATENCY_METRIC_NAME, () -> {
long watermark = windowTimerService.currentWatermark();
if (watermark < 0) {
return 0L;
} else {
return windowTimerService.currentProcessingTime() - watermark;
}
});
}
use of org.apache.flink.table.runtime.operators.join.JoinConditionWithNullFilters in project flink by apache.
the class AbstractStreamingJoinOperator method open.
@Override
public void open() throws Exception {
super.open();
JoinCondition condition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader());
this.joinCondition = new JoinConditionWithNullFilters(condition, filterNullKeys, this);
this.joinCondition.setRuntimeContext(getRuntimeContext());
this.joinCondition.open(new Configuration());
this.collector = new TimestampedCollector<>(output);
}
Aggregations