T - The type of the input element.@Internal public class NullByteKeySelector<T> extends Object implements KeySelector<T,Byte>
KeySelector to allow using keyed operators
for non-keyed usecases. Essentially, it gives all incoming records
the same key, which is a (byte) 0 value.| Constructor and Description |
|---|
NullByteKeySelector() |
public Byte getKey(T value) throws Exception
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<T,Byte>value - The object to get the key from.Exception - Throwing an exception will cause the execution of the respective task to fail,
and trigger recovery or cancellation of the program.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.