use of org.talend.sdk.component.runtime.di.beam.DelegatingUnBoundedSource in project component-runtime by Talend.
the class DIPipeline method wrapTransformIfNeeded.
private <PT extends POutput> PTransform<? super PBegin, PT> wrapTransformIfNeeded(final PTransform<? super PBegin, PT> root) {
if (Read.Bounded.class.isInstance(root)) {
final BoundedSource source = Read.Bounded.class.cast(root).getSource();
final DelegatingBoundedSource boundedSource = new DelegatingBoundedSource(source, null);
setState(boundedSource);
return Read.from(boundedSource);
}
if (Read.Unbounded.class.isInstance(root)) {
final UnboundedSource source = Read.Unbounded.class.cast(root).getSource();
if (InMemoryQueueIO.UnboundedQueuedInput.class.isInstance(source)) {
return root;
}
final DelegatingUnBoundedSource unBoundedSource = new DelegatingUnBoundedSource(source, null);
setState(unBoundedSource);
return Read.from(unBoundedSource);
}
return root;
}
Aggregations