tweise commented on pull request #15924:
URL: https://github.com/apache/flink/pull/15924#issuecomment-881989019
@StephanEwen thanks for taking a look!
> I generally like the API. I think we can improve the generics a bit on the
`HybridSourceBuilder` to make it more user-friendly.
>
> * If the Builder is instantiated directly with the first source, then we
don't force users to manually specify the types (record and enumerator) when
constructing the builder. For some sources, the enumerator types are internal
(private classes even), meaning users may need to manually but super types
there, which isn't something every developer solves easily.
There is no need to specify the types for the simple case (see added
example):
```
FileSource<String> fileSource = ...
KafkaSource<String> kafkaSource = ...
hybridSource =
HybridSource.builder(fileSource)
.addSource(kafkaSource)
.build();
```
> * The builder methods should probably use more generic bound, for example
accepting `? super FromEnumT` so that you can use a factory written against a
`FileSplitEnumerator` also in places that provide a `ContinuousFileEnumerator`
or so.
Yes, I will try to cover that with the unit test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]