Package org.apache.flink.sql.tests
Class StreamSQLTestProgram.KeyBucketAssigner
- java.lang.Object
-
- org.apache.flink.sql.tests.StreamSQLTestProgram.KeyBucketAssigner
-
- All Implemented Interfaces:
Serializable
,BucketAssigner<Row,String>
- Enclosing class:
- StreamSQLTestProgram
public static final class StreamSQLTestProgram.KeyBucketAssigner extends Object implements BucketAssigner<Row,String>
Use first field for buckets.- 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 KeyBucketAssigner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBucketId(Row element, BucketAssigner.Context context)
Returns the identifier of the bucket the provided element should be put into.SimpleVersionedSerializer<String>
getSerializer()
-
-
-
Method Detail
-
getBucketId
public String getBucketId(Row 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 interfaceBucketAssigner<Row,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 SimpleVersionedSerializer<String> getSerializer()
- Specified by:
getSerializer
in interfaceBucketAssigner<Row,String>
- Returns:
- A
SimpleVersionedSerializer
capable of serializing/deserializing the elements of typeBucketID
. That is the type of the objects returned by theBucketAssigner.getBucketId(Object, BucketAssigner.Context)
.
-
-