Package org.apache.ignite.stream
Class StreamTransformer<K,V>
- java.lang.Object
-
- org.apache.ignite.stream.StreamTransformer<K,V>
-
- All Implemented Interfaces:
Serializable
,javax.cache.processor.EntryProcessor<K,V,Object>
,StreamReceiver<K,V>
public abstract class StreamTransformer<K,V> extends Object implements StreamReceiver<K,V>, javax.cache.processor.EntryProcessor<K,V,Object>
Convenience adapter to transform update existing values in streaming cache based on the previously cached value.This transformer implement
EntryProcessor
and internally will callIgniteCache.invoke(Object, EntryProcessor, Object...)
method. Note that the value received from the data streamer will be passed to the entry processor as an argument.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StreamTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
StreamTransformer<K,V>from(CacheEntryProcessor<K,V,Object> ep)
Creates a new transformer based on instance ofCacheEntryProcessor
.void
receive(IgniteCache<K,V> cache, Collection<Map.Entry<K,V>> entries)
Updates cache with batch of entries.
-
-
-
Method Detail
-
receive
public void receive(IgniteCache<K,V> cache, Collection<Map.Entry<K,V>> entries) throws IgniteException
Updates cache with batch of entries.- Specified by:
receive
in interfaceStreamReceiver<K,V>
- Parameters:
cache
- Cache.entries
- Collection of entries.- Throws:
IgniteException
- If failed.
-
from
public static <K,V> StreamTransformer<K,V> from(CacheEntryProcessor<K,V,Object> ep)
Creates a new transformer based on instance ofCacheEntryProcessor
.- Type Parameters:
K
- Cache key type.V
- Cache value type.- Parameters:
ep
- Entry processor.- Returns:
- Stream transformer.
-
-