Hi,
Your are creating new data streamer on each loop call...
[...]
for (int i = 0; i < 1000000; i++){
//
CacheManager.getInstallBaseCache().put(name+"-"+i, new
TestPojo());
CacheManager.getInstance().dataStreamer(CACHE).addData(name+"-"+i, new
TestPojo());
}
[...]
Ignite does this when you call dataStreamer(cache name) method...
[...]
/**
* @param cacheName Cache name ({@code null} for default cache).
* @return Data loader.
*/
public DataStreamerImpl<K, V> dataStreamer(@Nullable String cacheName) {
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to create data streamer
(grid is stopping).");
try {
final DataStreamerImpl<K, V> ldr = new DataStreamerImpl<>(ctx,
cacheName, flushQ);
ldrs.add(ldr);
[...]
So try create a data streamer instance only once.
[...]
*IgniteStream stream = CacheManager.getInstance().dataStreamer(CACHE);*
for (int i = 0; i < 1000000; i++){
stream.addData(name+"-"+i, new
TestPojo());
}
[...]
Another improvement is send data on a "buffered fashion", so you reduce
calls to cluster... try stream.addData(data); // where data buffer =
Map<Key,Value>
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Data-Streamer-tp8409p8427.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.