org.apache.ignite.internal.processors.cache

## Class GridCachePartitionExchangeManager<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager<K,V>

All Implemented Interfaces:
  GridCacheSharedManager<K,V>

    public class GridCachePartitionExchangeManager<K,V>
    extends GridCacheSharedManagerAdapter<K,V>

Partition exchange manager.

### Field Summary

Fields
`static int` `EXCH_FUT_CLEANUP_HISTORY_SIZE` Cleanup history size.

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`cctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCachePartitionExchangeManager()`

### Method Summary

Methods
`IgniteInternalFuture<?>` `affinityReadyFuture(AffinityTopologyVersion ver)`
`GridClientPartitionTopology` `clearClientTopology(int cacheId)`
`Collection<GridClientPartitionTopology>` `clientTopologies()`
`GridDhtPartitionTopology` `clientTopology(int cacheId, GridDhtPartitionsExchangeFuture exchFut)`
`List<GridDhtPartitionsExchangeFuture>` `exchangeFutures()`
`void` `forceDummyExchange(boolean reassign, GridDhtPartitionsExchangeFuture exchFut)`
`void` `forcePreloadExchange(GridDhtPartitionsExchangeFuture exchFut)` Forces preload exchange.
`boolean` `hasPendingExchange()`
`GridDhtTopologyFuture` `lastTopologyFuture()`
`void` `onExchangeDone(GridDhtPartitionsExchangeFuture exchFut, Throwable err)`
`protected void` `onKernalStart0()`
`protected void` `onKernalStop0(boolean cancel)`
`AffinityTopologyVersion` `readyAffinityVersion()`
`void` `scheduleResendPartitions()` Schedules next full partitions update.
`protected void` `start0()`
`protected void` `stop0(boolean cancel)`
`boolean` `topologyChanged()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version of last partition exchange, it is possible that last partition exchange is not completed yet.

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, printMemoryStats, start, startInfo, stop, stopInfo, toString`

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

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

### Field Detail

#### EXCH_FUT_CLEANUP_HISTORY_SIZE

    public static final int EXCH_FUT_CLEANUP_HISTORY_SIZE

Cleanup history size.

### Constructor Detail

#### GridCachePartitionExchangeManager

    public GridCachePartitionExchangeManager()

### Method Detail

#### start0

    protected void start0()
                   throws IgniteCheckedException

Overrides:
  `start0` in class `GridCacheSharedManagerAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStart0

    protected void onKernalStart0()
                           throws IgniteCheckedException

Overrides:
  `onKernalStart0` in class `GridCacheSharedManagerAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridCacheSharedManagerAdapter<K,V>`
Parameters:
  `cancel` - Cancel flag.

#### stop0

    protected void stop0(boolean cancel)

Overrides:
  `stop0` in class `GridCacheSharedManagerAdapter<K,V>`
Parameters:
  `cancel` - Cancel flag.

#### clientTopology

    public GridDhtPartitionTopology clientTopology(int cacheId,
                                          GridDhtPartitionsExchangeFuture exchFut)

Parameters:
  `cacheId` - Cache ID.
  `exchFut` - Exchange future.
Returns:
  Topology.

#### clientTopologies

    public Collection<GridClientPartitionTopology> clientTopologies()

Returns:
  Collection of client topologies.

#### clearClientTopology

    public GridClientPartitionTopology clearClientTopology(int cacheId)

Parameters:
  `cacheId` - Cache ID.
Returns:
  Client partition topology.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Gets topology version of last partition exchange, it is possible that last partition exchange is not completed yet.

Returns:
  Topology version.

#### readyAffinityVersion

    public AffinityTopologyVersion readyAffinityVersion()

Returns:
  Topology version of latest completed partition exchange.

#### lastTopologyFuture

    public GridDhtTopologyFuture lastTopologyFuture()

Returns:
  Last completed topology future.

#### affinityReadyFuture

    @Nullable
    public IgniteInternalFuture<?> affinityReadyFuture(AffinityTopologyVersion ver)

Parameters:
  `ver` - Topology version.
Returns:
  Future or `null` is future is already completed.

#### exchangeFutures

    public List<GridDhtPartitionsExchangeFuture> exchangeFutures()

Returns:
  Exchange futures.

#### hasPendingExchange

    public boolean hasPendingExchange()

Returns:
  `True` if pending future queue is empty.

#### topologyChanged

    public boolean topologyChanged()

Returns:
  `True` if topology has changed.

#### forceDummyExchange

    public void forceDummyExchange(boolean reassign,
                          GridDhtPartitionsExchangeFuture exchFut)

Parameters:
  `exchFut` - Exchange future.
  `reassign` - Dummy reassign flag.

#### forcePreloadExchange

    public void forcePreloadExchange(GridDhtPartitionsExchangeFuture exchFut)

Forces preload exchange.

Parameters:
  `exchFut` - Exchange future.

#### scheduleResendPartitions

    public void scheduleResendPartitions()

Schedules next full partitions update.

#### onExchangeDone

    public void onExchangeDone(GridDhtPartitionsExchangeFuture exchFut,
                      @Nullable
                      Throwable err)

Parameters:
  `exchFut` - Exchange.
  `err` - Error.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.2.0-incubating
Release Date | : June 16 2015