java.lang.Object
org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.BasePathBucketAssigner<T>
All Implemented Interfaces:
Serializable, BucketAssigner<T,String>

@PublicEvolving public class BasePathBucketAssigner<T> extends Object implements BucketAssigner<T,String>
A BucketAssigner that does not perform any bucketing of files. All files are written to the base path.
See Also:
  • Constructor Details

    • BasePathBucketAssigner

      public BasePathBucketAssigner()
  • Method Details

    • getBucketId

      public String getBucketId(T element, BucketAssigner.Context context)
      Description copied from interface: BucketAssigner
      Returns the identifier of the bucket the provided element should be put into.
      Specified by:
      getBucketId in interface BucketAssigner<T,String>
      Parameters:
      element - The current element being processed.
      context - The context used by the current bucket assigner.
      Returns:
      A string representing the identifier of the bucket the element should be put into. The actual path to the bucket will result from the concatenation of the returned string and the base path provided during the initialization of the file sink.
    • getSerializer

      public org.apache.flink.core.io.SimpleVersionedSerializer<String> getSerializer()
      Specified by:
      getSerializer in interface BucketAssigner<T,String>
      Returns:
      A SimpleVersionedSerializer capable of serializing/deserializing the elements of type BucketID. That is the type of the objects returned by the BucketAssigner.getBucketId(Object, BucketAssigner.Context).
    • toString

      public String toString()
      Overrides:
      toString in class Object