THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
StreamTupleExtractor
interface expose the extract(T msg)
method that returns a cache entry as Map.Entry<K, V>
instance. For example, if message represents a string with two values that separated by '=' symbol where left part is a word and right one - integer number, then extractor could be implemented as:
Code Block | ||
---|---|---|
| ||
public class WordCountTupleExtractor implements StreamTupleExtractor<String, String, Integer> {
@Override public Map.Entry<String, Integer> extract(String msg) {
String[] tokens = msg.split("=");
return new IgniteBiTuple<>(tokens[0], Integer.valueOf(tokens[1]));
}
}
|
...