org.apache.ignite.internal.processors.datastreamer

## 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
`static interface` `DataStreamerCacheUpdaters.InternalUpdater` Marker interface for updaters which do not need to unwrap cache objects.

### Constructor Summary

Constructors
Constructor and Description
`DataStreamerCacheUpdaters()`

### Method Summary

Methods
`static <K,V> StreamReceiver<K,V>` `batched()` Updates cache using batched methods `IgniteCache.putAll(Map)`and `IgniteCache.removeAll()`.
`static <K extends Comparable<?>,V> StreamReceiver<K,V>` `batchedSorted()` Updates cache using batched methods `IgniteCache.putAll(Map)` and `IgniteCache.removeAll(Set)`.
`static <K,V> StreamReceiver<K,V>` `individual()` Updates cache using independent `IgniteCache.put(Object, Object)`and `IgniteCache.remove(Object)` operations.
`protected static <K,V> void` `updateAll(IgniteCache<K,V> cache, Set<K> rmvCol, Map<K,V> putMap)` Updates cache.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DataStreamerCacheUpdaters

    public DataStreamerCacheUpdaters()

### Method Detail

#### individual

    public static <K,V> StreamReceiver<K,V> individual()

Updates cache using independent `IgniteCache.put(Object, Object)`and `IgniteCache.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 methods `IgniteCache.putAll(Map)`and `IgniteCache.removeAll()`. Can cause deadlocks if the same keys are getting updated concurrently. Performance is generally better than in `individual()`.

Returns:
  Batched updater.

#### batchedSorted

    public static <K extends Comparable<?>,V> StreamReceiver<K,V> batchedSorted()

Updates cache using batched methods `IgniteCache.putAll(Map)` and `IgniteCache.removeAll(Set)`. Keys are sorted in natural order and if all updates use the same rule deadlock can not happen. Performance is generally better than in `individual()`.

Returns:
  Batched sorted updater.

#### updateAll

    protected static <K,V> void updateAll(IgniteCache<K,V> cache,
                       @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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016