diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java index bba9b1f82f5b..a8d7fd8fcb24 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java @@ -905,15 +905,15 @@ public abstract static class Writer { private final WriteOperation writeOperation; /** Unique id for this output bundle. */ - private @Nullable String id; + private volatile @Nullable String id; - private @Nullable DestinationT destination; + private volatile @Nullable DestinationT destination; /** The output file for this bundle. May be null if opening failed. */ - private @Nullable ResourceId outputFile; + private volatile @Nullable ResourceId outputFile; /** The channel to write to. */ - private @Nullable WritableByteChannel channel; + private volatile @Nullable WritableByteChannel channel; /** * The MIME type used in the creation of the output channel (if the file system supports it).