yxu-valleytider 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_r320162642
 
 

 ##########
 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:
   My bad.  Added back the `<ID>` type.  Is the main reason of overriding 
`BucketID` being both `forRowFormat` and `forBulkFormat` always assume `String` 
type bucketID ?   In that case my approach might have issues if the new `ID` 
cannot be casted to `BucketID`, and a newly constructed builder is needed.   

----------------------------------------------------------------
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

Reply via email to