org.apache.ignite.internal.processors.cache

## Class CacheAffinitySharedManager<K,V>

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

All Implemented Interfaces:
  GridCacheSharedManager<K,V>

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

### Field Summary

Fields
`static IgniteProductVersion` `LATE_AFF_ASSIGN_SINCE`

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

`cctx, log`

### Constructor Summary

Constructors
Constructor and Description
`CacheAffinitySharedManager()`

### Method Summary

Methods
`void` `addDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)`
`void` `checkRebalanceState(GridDhtPartitionTopology top, Integer checkCacheId)`
`void` `dumpDebugInfo()`
`IgniteInternalFuture<Map<Integer,Map<Integer,List<UUID>>>>` `initAffinityOnNodeLeft(GridDhtPartitionsExchangeFuture fut)`
`Map<Integer,Map<Integer,List<UUID>>>` `initAffinityOnNodeLeft0(GridDhtPartitionsExchangeFuture fut)`
`void` `initStartedCaches(boolean crd, GridDhtPartitionsExchangeFuture fut, Collection<DynamicCacheDescriptor> descs)` Initialized affinity started on this exchange.
`boolean` `onCacheChangeRequest(GridDhtPartitionsExchangeFuture fut, boolean crd, Collection<DynamicCacheChangeRequest> reqs)` Called on exchange initiated for cache start/stop request.
`void` `onCacheCreated(GridCacheContext cctx)`
`void` `onChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut, boolean crd, CacheAffinityChangeMessage msg)` Called on exchange initiated by `CacheAffinityChangeMessage` which sent after rebalance finished.
`void` `onClientEvent(GridDhtPartitionsExchangeFuture fut, boolean crd)` Called on exchange initiated by client node join/fail.
`boolean` `onCustomEvent(CacheAffinityChangeMessage msg)` Callback invoked from discovery thread when discovery custom message is received.
`void` `onDiscoveryEvent(int type, ClusterNode node, AffinityTopologyVersion topVer)` Callback invoked from discovery thread when discovery message is received.
`void` `onExchangeChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut, boolean crd, CacheAffinityChangeMessage msg)` Called when received `CacheAffinityChangeMessage` which should complete exchange.
`void` `onServerJoin(GridDhtPartitionsExchangeFuture fut, boolean crd)` Called on exchange initiated by server node join.
`boolean` `onServerLeft(GridDhtPartitionsExchangeFuture fut)` Called on exchange initiated by server node leave.
`void` `removeDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)`
`protected void` `start0()`

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

`context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, printMemoryStats, start, startInfo, stop, stop0, stopInfo, toString`

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

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

### Field Detail

#### LATE_AFF_ASSIGN_SINCE

    public static final IgniteProductVersion LATE_AFF_ASSIGN_SINCE

### Constructor Detail

#### CacheAffinitySharedManager

    public CacheAffinitySharedManager()

### Method Detail

#### start0

    protected void start0()
                   throws IgniteCheckedException

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

#### onDiscoveryEvent

    public void onDiscoveryEvent(int type,
                        ClusterNode node,
                        AffinityTopologyVersion topVer)

Callback invoked from discovery thread when discovery message is received.

Parameters:
  `type` - Event type.
  `node` - Event node.
  `topVer` - Topology version.

#### onCustomEvent

    public boolean onCustomEvent(CacheAffinityChangeMessage msg)

Callback invoked from discovery thread when discovery custom message is received.

Parameters:
  `msg` - Customer message.
Returns:
  `True` if minor topology version should be increased.

#### checkRebalanceState

    public void checkRebalanceState(GridDhtPartitionTopology top,
                           Integer checkCacheId)

Parameters:
  `top` - Topology.
  `checkCacheId` - Cache ID.

#### onCacheCreated

    public void onCacheCreated(GridCacheContext cctx)

Parameters:
  `cctx` - Cache context.

#### onCacheChangeRequest

    public boolean onCacheChangeRequest(GridDhtPartitionsExchangeFuture fut,
                               boolean crd,
                               Collection<DynamicCacheChangeRequest> reqs)
                                 throws IgniteCheckedException

Called on exchange initiated for cache start/stop request.

Parameters:
  `fut` - Exchange future.
  `crd` - Coordinator flag.
  `reqs` - Cache change requests.
Returns:
  `True` if client-only exchange is needed.
Throws:
  `IgniteCheckedException` - If failed.

#### onExchangeChangeAffinityMessage

    public void onExchangeChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut,
                                       boolean crd,
                                       CacheAffinityChangeMessage msg)

Called when received `CacheAffinityChangeMessage` which should complete exchange.

Parameters:
  `exchFut` - Exchange future.
  `crd` - Coordinator flag.
  `msg` - Affinity change message.

#### onChangeAffinityMessage

    public void onChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut,
                               boolean crd,
                               CacheAffinityChangeMessage msg)
                                 throws IgniteCheckedException

Called on exchange initiated by `CacheAffinityChangeMessage` which sent after rebalance finished.

Parameters:
  `exchFut` - Exchange future.
  `crd` - Coordinator flag.
  `msg` - Message.
Throws:
  `IgniteCheckedException` - If failed.

#### onClientEvent

    public void onClientEvent(GridDhtPartitionsExchangeFuture fut,
                     boolean crd)
                       throws IgniteCheckedException

Called on exchange initiated by client node join/fail.

Parameters:
  `fut` - Exchange future.
  `crd` - Coordinator flag.
Throws:
  `IgniteCheckedException` - If failed.

#### addDhtAssignmentFetchFuture

    public void addDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)

Parameters:
  `fut` - Future to add.

#### removeDhtAssignmentFetchFuture

    public void removeDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)

Parameters:
  `fut` - Future to remove.

#### initStartedCaches

    public void initStartedCaches(boolean crd,
                         GridDhtPartitionsExchangeFuture fut,
                         @Nullable
                         Collection<DynamicCacheDescriptor> descs)
                           throws IgniteCheckedException

Initialized affinity started on this exchange.

Parameters:
  `crd` - Coordinator flag.
  `fut` - Exchange future.
  `descs` - Cache descriptors.
Throws:
  `IgniteCheckedException` - If failed.

#### onServerJoin

    public void onServerJoin(GridDhtPartitionsExchangeFuture fut,
                    boolean crd)
                      throws IgniteCheckedException

Called on exchange initiated by server node join.

Parameters:
  `fut` - Exchange future.
  `crd` - Coordinator flag.
Throws:
  `IgniteCheckedException` - If failed.

#### onServerLeft

    public boolean onServerLeft(GridDhtPartitionsExchangeFuture fut)
                         throws IgniteCheckedException

Called on exchange initiated by server node leave.

Parameters:
  `fut` - Exchange future.
Returns:
  `True` if affinity should be assigned by coordinator.
Throws:
  `IgniteCheckedException` - If failed.

#### initAffinityOnNodeLeft

    public IgniteInternalFuture<Map<Integer,Map<Integer,List<UUID>>>> initAffinityOnNodeLeft(GridDhtPartitionsExchangeFuture fut)
                                                                                      throws IgniteCheckedException

Parameters:
  `fut` - Exchange future.
Returns:
  Affinity assignment.
Throws:
  `IgniteCheckedException` - If failed.

#### initAffinityOnNodeLeft0

    public Map<Integer,Map<Integer,List<UUID>>> initAffinityOnNodeLeft0(GridDhtPartitionsExchangeFuture fut)
                                                                 throws IgniteCheckedException

Parameters:
  `fut` - Exchange future.
Returns:
  Affinity assignment.
Throws:
  `IgniteCheckedException` - If failed.

#### dumpDebugInfo

    public void dumpDebugInfo()

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016