public static class GroupedProcessingTimeWindowExample.FirstFieldKeyExtractor<Type extends Tuple,Key> extends Object implements KeySelector<Type,Key>
Constructor and Description |
---|
FirstFieldKeyExtractor() |
Modifier and Type | Method and Description |
---|---|
Key |
getKey(Type value)
User-defined function that extracts the key from an arbitrary object.
|
public Key getKey(Type value)
KeySelector
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; }
getKey
in interface KeySelector<Type extends Tuple,Key>
value
- The object to get the key from.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.