Class BasePathBucketAssigner<T>
- 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>
ABucketAssignerthat does not perform any bucketing of files. All files are written to the base path.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner
BucketAssigner.Context
-
-
Constructor Summary
Constructors Constructor Description BasePathBucketAssigner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBucketId(T element, BucketAssigner.Context context)Returns the identifier of the bucket the provided element should be put into.org.apache.flink.core.io.SimpleVersionedSerializer<String>getSerializer()StringtoString()
-
-
-
Method Detail
-
getBucketId
public String getBucketId(T element, BucketAssigner.Context context)
Description copied from interface:BucketAssignerReturns the identifier of the bucket the provided element should be put into.- Specified by:
getBucketIdin interfaceBucketAssigner<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 pathprovided during the initialization of the file sink.
-
getSerializer
public org.apache.flink.core.io.SimpleVersionedSerializer<String> getSerializer()
- Specified by:
getSerializerin interfaceBucketAssigner<T,String>- Returns:
- A
SimpleVersionedSerializercapable of serializing/deserializing the elements of typeBucketID. That is the type of the objects returned by theBucketAssigner.getBucketId(Object, BucketAssigner.Context).
-
-