flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnowojski <...@git.apache.org>
Subject [GitHub] flink pull request #5811: [FLINK-9113] [connectors] Fix flushing behavior of...
Date Fri, 06 Apr 2018 13:18:25 GMT
Github user pnowojski commented on a diff in the pull request:

    --- Diff: flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSink.java
    @@ -366,6 +384,11 @@ public void initializeState(FunctionInitializationContext context)
throws Except
     			throw new RuntimeException("Error while creating FileSystem when initializing the
state of the BucketingSink.", e);
    +		// sync on flush for local file systems
    +		if (localSyncOnFlush && (fs instanceof LocalFileSystem) && (writerTemplate
instanceof StreamWriterBase)) {
    --- End diff --
    Shouldn't `(writerTemplate instanceof StreamWriterBase)` check be converted here into
`checState(writerTemplate instanceof StreamWriterBase)` inside the if branch, and the same
check be extracted and validated whenever user calls:
    `setWriter(...)` or `setLocalSyncOnFlush(...)`? So that non `StreamWriterBase` and `localSyncOnFlush
= true` would be invalid configuration? Otherwise users might experience `wtf` moments when
flag is being ignored after changing their writer.


View raw message