public abstract static class FileBasedSink.FilenamePolicy
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
FileBasedSink.FilenamePolicy.Context
Context used for generating a name based on shard number, and num shards.
|
static class |
FileBasedSink.FilenamePolicy.WindowedContext
Context used for generating a name based on window, pane, shard number, and num shards.
|
Constructor and Description |
---|
FilenamePolicy() |
Modifier and Type | Method and Description |
---|---|
void |
populateDisplayData(DisplayData.Builder builder)
Populates the display data.
|
abstract ResourceId |
unwindowedFilename(ResourceId outputDirectory,
FileBasedSink.FilenamePolicy.Context c,
java.lang.String extension)
When a sink has not requested windowed or triggered output, this method will be invoked to
return the file
resource to be created given the base output directory and
a (possibly empty) extension applied by additional FileBasedSink configuration
(e.g., FileBasedSink.CompressionType ). |
abstract ResourceId |
windowedFilename(ResourceId outputDirectory,
FileBasedSink.FilenamePolicy.WindowedContext c,
java.lang.String extension)
When a sink has requested windowed or triggered output, this method will be invoked to return
the file
resource to be created given the base output directory and a
(possibly empty) extension from FileBasedSink configuration
(e.g., FileBasedSink.CompressionType ). |
@Experimental(value=FILESYSTEM) public abstract ResourceId windowedFilename(ResourceId outputDirectory, FileBasedSink.FilenamePolicy.WindowedContext c, java.lang.String extension)
resource
to be created given the base output directory and a
(possibly empty) extension from FileBasedSink
configuration
(e.g., FileBasedSink.CompressionType
).
The FileBasedSink.FilenamePolicy.WindowedContext
object gives access to the window and pane,
as well as sharding information. The policy must return unique and consistent filenames
for different windows and panes.
@Experimental(value=FILESYSTEM) @Nullable public abstract ResourceId unwindowedFilename(ResourceId outputDirectory, FileBasedSink.FilenamePolicy.Context c, java.lang.String extension)
resource
to be created given the base output directory and
a (possibly empty) extension applied by additional FileBasedSink
configuration
(e.g., FileBasedSink.CompressionType
).
The FileBasedSink.FilenamePolicy.Context
object only provides sharding information, which is used by the policy
to generate unique and consistent filenames.
public void populateDisplayData(DisplayData.Builder builder)