Package org.apache.beam.sdk.io
Class FileBasedSink.FilenamePolicy
java.lang.Object
org.apache.beam.sdk.io.FileBasedSink.FilenamePolicy
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultFilenamePolicy
- Enclosing class:
FileBasedSink<UserT,DestinationT, OutputT>
A naming policy for output files.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpopulateDisplayData(DisplayData.Builder builder) Populates the display data.abstract @Nullable ResourceIdunwindowedFilename(int shardNumber, int numShards, FileBasedSink.OutputFileHints outputFileHints) When a sink has not requested windowed or triggered output, this method will be invoked to return the fileresourceto be created given the base output directory and aFileBasedSink.OutputFileHintscontaining information about the file, including a suggested (e.g.abstract ResourceIdwindowedFilename(int shardNumber, int numShards, BoundedWindow window, PaneInfo paneInfo, FileBasedSink.OutputFileHints outputFileHints) When a sink has requested windowed or triggered output, this method will be invoked to return the fileresourceto be created given the base output directory and aFileBasedSink.OutputFileHintscontaining information about the file, including a suggested extension (e.g.
-
Constructor Details
-
FilenamePolicy
public FilenamePolicy()
-
-
Method Details
-
windowedFilename
public abstract ResourceId windowedFilename(int shardNumber, int numShards, BoundedWindow window, PaneInfo paneInfo, FileBasedSink.OutputFileHints outputFileHints) When a sink has requested windowed or triggered output, this method will be invoked to return the fileresourceto be created given the base output directory and aFileBasedSink.OutputFileHintscontaining information about the file, including a suggested extension (e.g. coming fromCompression).The policy must return unique and consistent filenames for different windows and panes.
-
unwindowedFilename
public abstract @Nullable ResourceId unwindowedFilename(int shardNumber, int numShards, FileBasedSink.OutputFileHints outputFileHints) When a sink has not requested windowed or triggered output, this method will be invoked to return the fileresourceto be created given the base output directory and aFileBasedSink.OutputFileHintscontaining information about the file, including a suggested (e.g. coming fromCompression).The shardNumber and numShards parameters, should be used by the policy to generate unique and consistent filenames.
-
populateDisplayData
Populates the display data.
-