use of org.apache.flink.table.connector.ProviderContext in project flink by apache.
the class ExternalDynamicSource method getScanRuntimeProvider.
@Override
public ScanRuntimeProvider getScanRuntimeProvider(ScanContext runtimeProviderContext) {
final DataStructureConverter physicalConverter = runtimeProviderContext.createDataStructureConverter(physicalDataType);
final Transformation<E> externalTransformation = dataStream.getTransformation();
final boolean isBounded = !isUnboundedSource(externalTransformation) && externalTransformation.getTransitivePredecessors().stream().noneMatch(this::isUnboundedSource);
return new TransformationScanProvider() {
@Override
public Transformation<RowData> createTransformation(ProviderContext providerContext) {
return ExecNodeUtil.createOneInputTransformation(externalTransformation, providerContext.generateUid(EXTERNAL_DATASTREAM_TRANSFORMATION).map(uid -> new TransformationMetadata(uid, generateOperatorName(), generateOperatorDesc())).orElseGet(() -> new TransformationMetadata(generateOperatorName(), generateOperatorDesc())), new InputConversionOperator<>(physicalConverter, !isTopLevelRecord, produceRowtimeMetadata, propagateWatermark, changelogMode.containsOnly(RowKind.INSERT)), // will be filled by the framework
null, externalTransformation.getParallelism());
}
@Override
public boolean isBounded() {
return isBounded;
}
};
}
Aggregations