Class DataStreamerCacheUpdaters
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastreamer.DataStreamerCacheUpdaters
-
public class DataStreamerCacheUpdaters extends Object
Bundled factory for cache updaters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDataStreamerCacheUpdaters.InternalUpdaterMarker interface for updaters which do not need to unwrap cache objects.
-
Constructor Summary
Constructors Constructor Description DataStreamerCacheUpdaters()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
StreamReceiver<K,V>batched()Updates cache using batched methodsIgniteCache.putAll(Map)andIgniteCache.removeAll().static <K extends Comparable<?>,V>
StreamReceiver<K,V>batchedSorted()Updates cache using batched methodsIgniteCache.putAll(Map)andIgniteCache.removeAll(Set).static <K,V>
StreamReceiver<K,V>individual()Updates cache using independentIgniteCache.put(Object, Object)andIgniteCache.remove(Object)operations.protected static <K,V>
voidupdateAll(IgniteCache<K,V> cache, @Nullable Set<K> rmvCol, Map<K,V> putMap)Updates cache.
-
-
-
Method Detail
-
individual
public static <K,V> StreamReceiver<K,V> individual()
Updates cache using independentIgniteCache.put(Object, Object)andIgniteCache.remove(Object)operations. Thus, it is safe from deadlocks but performance is not the best.- Returns:
- Single updater.
-
batched
public static <K,V> StreamReceiver<K,V> batched()
Updates cache using batched methodsIgniteCache.putAll(Map)andIgniteCache.removeAll(). Can cause deadlocks with transactional caches if the same keys are getting updated concurrently. Performance is generally better than inindividual().- Returns:
- Batched updater.
-
batchedSorted
public static <K extends Comparable<?>,V> StreamReceiver<K,V> batchedSorted()
Updates cache using batched methodsIgniteCache.putAll(Map)andIgniteCache.removeAll(Set). Keys are sorted in natural order and if all updates use the same rule deadlock with transactional caches can not happen. Performance is generally better than inindividual().- Returns:
- Batched sorted updater.
-
updateAll
protected static <K,V> void updateAll(IgniteCache<K,V> cache, @Nullable @Nullable Set<K> rmvCol, Map<K,V> putMap)
Updates cache.- Parameters:
cache- Cache.rmvCol- Keys to remove.putMap- Entries to put.- Throws:
IgniteException- If failed.
-
-