@Experimental(value=FILESYSTEM) public abstract static class FileBasedSink.DynamicDestinations<UserT,DestinationT,OutputT> extends java.lang.Object implements HasDisplayData, java.io.Serializable
FileBasedSink.
Users can define a custom type to represent destinations, and provide a mapping to turn this
destination type into an instance of FileBasedSink.FilenamePolicy.
| Constructor and Description |
|---|
DynamicDestinations() |
| Modifier and Type | Method and Description |
|---|---|
abstract OutputT |
formatRecord(UserT record)
Convert an input record type into the output type.
|
abstract DestinationT |
getDefaultDestination()
Returns the default destination.
|
abstract DestinationT |
getDestination(UserT element)
Returns an object that represents at a high level the destination being written to.
|
Coder<DestinationT> |
getDestinationCoder()
Returns the coder for
DestinationT. |
abstract FileBasedSink.FilenamePolicy |
getFilenamePolicy(DestinationT destination)
Converts a destination into a
FileBasedSink.FilenamePolicy. |
java.util.List<PCollectionView<?>> |
getSideInputs()
Override to specify that this object needs access to one or more side inputs.
|
void |
populateDisplayData(DisplayData.Builder builder)
Populates the display data.
|
protected <SideInputT> |
sideInput(PCollectionView<SideInputT> view)
Returns the value of a given side input.
|
public java.util.List<PCollectionView<?>> getSideInputs()
protected final <SideInputT> SideInputT sideInput(PCollectionView<SideInputT> view)
getSideInputs().public abstract OutputT formatRecord(UserT record)
public abstract DestinationT getDestination(UserT element)
public abstract DestinationT getDefaultDestination()
@Nullable public Coder<DestinationT> getDestinationCoder()
DestinationT. If this is not overridden, then the coder
registry will be use to find a suitable coder. This must be a deterministic coder, as DestinationT will be used as a key type in a GroupByKey.public abstract FileBasedSink.FilenamePolicy getFilenamePolicy(DestinationT destination)
FileBasedSink.FilenamePolicy. May not return null.public void populateDisplayData(DisplayData.Builder builder)
populateDisplayData in interface HasDisplayDatabuilder - The builder to populate with display data.HasDisplayData