yxu-valleytider commented on issue #9581: [FLINK-13864][streaming]: Modify the StreamingFileSink Builder interface to allow for easier subclassing of StreamingFileSink URL: https://github.com/apache/flink/pull/9581#issuecomment-527534328 > If you simply want to extend the `StreamingFileSink`, is it really necessary to also be able to extend the builders? The primary reason is our use case needs customized bucket assigner to construct the extended class, and we would like to follow the existing construction pattern. The application logic looks like: ``` CustomizedStreamingFileSink.forBulkFormat(...) .withBucketAssigner(new CustomizedBucketAssigner()) .build(); ``` If we don't override the builder in the way this PR does, `withBucketAssigner()` would return a `StreamingFileSink.BulkFormatBuilder` and `build()` would return a parent `StreamingFileSink` class but not the `CustomizedStreamingFileSink` class. The linked articles discussed how to perform subclassing for a parent class using the builder pattern. This PR follows suggestions there on the best practice.
---------------------------------------------------------------- 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
