kl0u commented on a change in pull request #9581: [FLINK-13864][streaming]:
Modify the StreamingFileSink Builder interface to allow for easier subclassing
of StreamingFileSink
URL: https://github.com/apache/flink/pull/9581#discussion_r320176447
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSink.java
##########
@@ -314,25 +332,30 @@ private BulkFormatBuilder(
this.partFileSuffix =
Preconditions.checkNotNull(partFileSuffix);
}
- public StreamingFileSink.BulkFormatBuilder<IN, BucketID>
withBucketCheckInterval(long interval) {
- return new BulkFormatBuilder<>(basePath, writerFactory,
bucketAssigner, interval, bucketFactory, partFilePrefix, partFileSuffix);
+ public T withBucketCheckInterval(long interval) {
+ this.bucketCheckInterval = interval;
+ return self();
}
- public <ID> StreamingFileSink.BulkFormatBuilder<IN, ID>
withBucketAssigner(BucketAssigner<IN, ID> assigner) {
- return new BulkFormatBuilder<>(basePath, writerFactory,
Preconditions.checkNotNull(assigner), bucketCheckInterval, new
DefaultBucketFactoryImpl<>(), partFilePrefix, partFileSuffix);
+ public T withBucketAssigner(BucketAssigner<IN, BucketID>
assigner) {
Review comment:
@yxu-valleytider Yes, this is why I am mentioned it here. The same holds
for the `rowFormat` builder above where you explicitly cast. I am not so sure
if this approach would work and we may need to investigate this further.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services