Class KeySelectorUtil.ComparableKeySelector<IN>
- java.lang.Object
-
- org.apache.flink.streaming.util.keys.KeySelectorUtil.ComparableKeySelector<IN>
-
- Type Parameters:
IN
- The type from which the key is extracted.
- All Implemented Interfaces:
Serializable
,Function
,KeySelector<IN,Tuple>
,ResultTypeQueryable<Tuple>
- Enclosing class:
- KeySelectorUtil
public static final class KeySelectorUtil.ComparableKeySelector<IN> extends Object implements KeySelector<IN,Tuple>, ResultTypeQueryable<Tuple>
A key selector for selecting key fields via a TypeComparator.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tuple
getKey(IN value)
User-defined function that deterministically extracts the key from an object.TypeInformation<Tuple>
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.
-
-
-
Method Detail
-
getKey
public Tuple getKey(IN value)
Description copied from interface:KeySelector
User-defined function that deterministically extracts the key from an object.For example for a class:
public class Word { String word; int count; }
The key extractor could return the word as a key to group all Word objects by the String they contain.
The code would look like this
public String getKey(Word w) { return w.word; }
- Specified by:
getKey
in interfaceKeySelector<IN,Tuple>
- Parameters:
value
- The object to get the key from.- Returns:
- The extracted key.
-
getProducedType
public TypeInformation<Tuple> getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable<IN>
- Returns:
- The data type produced by this function or input format.
-
-