Entries, that are provided to the *receive()* method are immutable. But you can either do *cache.put() *inside the *receive() *method, just like *DataStreamerCacheUpdaters#Individual <https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java#L102> *does, or use *StreamTransformer *just like in StreamTransformerExample <https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java>
Denis пт, 29 июн. 2018 г. в 19:17, breischl <[email protected]>: > Hi Denis, > It was not clear to me that we could do the update from within the > StreamReceiver without some sort of cache operation. Would we just use the > CacheEntry.setValue() method to do that? Something roughly like the > following? > > Thanks! > > > public void receive(IgniteCache<TKey, TEntity> cache, > Collection<Map.Entry<TKey, TEntity>> newEntries) throws IgniteException > { > > for (val newEntry : newEntries) { > //Do our custom logic > newEntry.setValue(someNewValue); > } > } > > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
