Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejava
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]));

    }

}

 

 

Streamer Lifecycle

 

Implementation Tips

...