Hi, 

I am using following code to read all the entries of a cache in map using
below code. 

IgniteCache<IgniteKey, OptionalDouble> cache = cache(cacheName, false); 
Map<IgniteKey, OptionalDouble> map1 = new HashMap<>(); 
cache.forEach(action ->map1.put(action.getKey(), action.getValue())); 

But when I try streamer to read using following code, map is not getting
populated with any entry : 

                                                Ignite ignite = 
Ignition.start("<config file>"); 
                        IgniteDataStreamer<IgniteKey, OptionalDouble>
streamer = 
                        ignite.dataStreamer(cacheName); 
                        Map<IgniteKey, OptionalDouble> map = new
HashMap<>(); 
                        try{ 
                                
                               
streamer.receiver(StreamVisitor.from((cache1, e) -> { 
                                        map.put(e.getKey(), e.getValue()); 
                                })); 
                                
                       
}catch(CacheException|IgniteInterruptedException|IllegalStateException|IgniteDataStreamerTimeoutException
e){ 
                                ignite.log().error("Entries not written to
Ignite Cache, please check the logs."); 
                                throw new IgniteException(e); 
                        } 

do you see any issue with the Streamer fetch code above  ? 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to