public static final class FileSinkProgram.KeyBucketAssigner extends Object implements BucketAssigner<Tuple2<Integer,Integer>,String>
BucketAssigner.Context
Constructor and Description |
---|
KeyBucketAssigner() |
Modifier and Type | Method and Description |
---|---|
String |
getBucketId(Tuple2<Integer,Integer> element,
BucketAssigner.Context context)
Returns the identifier of the bucket the provided element should be put into.
|
SimpleVersionedSerializer<String> |
getSerializer() |
public String getBucketId(Tuple2<Integer,Integer> element, BucketAssigner.Context context)
BucketAssigner
getBucketId
in interface BucketAssigner<Tuple2<Integer,Integer>,String>
element
- The current element being processed.context
- The context used by the current bucket assigner.base path
provided during the initialization of the file sink.public SimpleVersionedSerializer<String> getSerializer()
getSerializer
in interface BucketAssigner<Tuple2<Integer,Integer>,String>
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)
.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.