THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The following code snippet demonstrates correct data streamer initialization assuming that there is CustomStreamer
implementation with start
method:
Code Block | ||
---|---|---|
| ||
// Start Ignite node with default configuration.
Ignite ignite = Ignition.start();
// Create and start cache with default configuration and name "wordsCache".
IgniteCache<String, Integer> cache = ignite.getOrCreateCache("wordsCache");
// Get data streamer reference for cache with name "wordsCache".
IgniteDataStreamer<String, Integer> stmr = ignite.dataStreamer("wordsCache");
// Create custom data streamer implementation.
CustomStreamer customStmr = new CustomStreamer(stmr, new WordCountTupleExtractor());
// Start custom data streamer if it provides corresponding methods.
customStmr.start();
|
Ignite provides SocketStreamer
- reference custom data streamer implementation. SocketStreamer
is NIO-based TCP socket server that accepts client connections on configured port, receives data represented as bytes array, converts it to user defined type using SocketMessageConverter
and streams it into cache.
...