Class DefaultFilenamePolicy

java.lang.Object
org.apache.beam.sdk.io.FileBasedSink.FilenamePolicy
org.apache.beam.sdk.io.DefaultFilenamePolicy
All Implemented Interfaces:
Serializable

public final class DefaultFilenamePolicy extends FileBasedSink.FilenamePolicy
A default FileBasedSink.FilenamePolicy for windowed and unwindowed files. This policy is constructed using three parameters that together define the output name of a sharded file, in conjunction with the number of shards, index of the particular file, current window and pane information, using constructName(org.apache.beam.sdk.io.fs.ResourceId, java.lang.String, java.lang.String, int, int, java.lang.String, java.lang.String).

Most users will use this DefaultFilenamePolicy. For more advanced uses in generating different files for each window and other sharding controls, see the WriteOneFilePerWindow example pipeline.

See Also:
  • Field Details

    • DEFAULT_UNWINDOWED_SHARD_TEMPLATE

      public static final String DEFAULT_UNWINDOWED_SHARD_TEMPLATE
      The default sharding name template.
      See Also:
    • DEFAULT_WINDOWED_SHARD_TEMPLATE

      public static final String DEFAULT_WINDOWED_SHARD_TEMPLATE
      The default windowed sharding name template used when writing windowed files. This is used as default in cases when user did not specify shard template to be used and there is a need to write windowed files. In cases when user does specify shard template to be used then provided template will be used for both windowed and non-windowed file names.
      See Also:
  • Method Details