org.apache.ignite.internal.processors.cache

## Class CacheAffinityChangeMessage

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage

All Implemented Interfaces:
  Serializable, DiscoveryCustomMessage

    public class CacheAffinityChangeMessage
    extends Object
    implements DiscoveryCustomMessage

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`CacheAffinityChangeMessage(AffinityTopologyVersion topVer, Map<Integer,Map<Integer,List<UUID>>> assignmentChange, Map<Integer,IgniteUuid> cacheDeploymentIds)` Constructor used when message is created after cache rebalance finished.
`CacheAffinityChangeMessage(GridDhtPartitionExchangeId exchId, GridDhtPartitionsFullMessage partsMsg, Map<Integer,Map<Integer,List<UUID>>> assignmentChange)` Constructor used when message is created to finish exchange.

### Method Summary

Methods
`DiscoveryCustomMessage` `ackMessage()` Called when custom message has been handled by all nodes.
`Map<Integer,Map<Integer,List<UUID>>>` `assignmentChange()`
`Map<Integer,IgniteUuid>` `cacheDeploymentIds()`
`GridDhtPartitionExchangeId` `exchangeId()`
`boolean` `exchangeNeeded()`
`void` `exchangeNeeded(boolean exchangeNeeded)`
`IgniteUuid` `id()`
`boolean` `isMutable()`
`GridDhtPartitionsFullMessage` `partitionsMessage()`
`AffinityTopologyVersion` `topologyVersion()`
`String` `toString()`

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

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

### Constructor Detail

#### CacheAffinityChangeMessage

    public CacheAffinityChangeMessage(AffinityTopologyVersion topVer,
                              Map<Integer,Map<Integer,List<UUID>>> assignmentChange,
                              Map<Integer,IgniteUuid> cacheDeploymentIds)

Constructor used when message is created after cache rebalance finished.

Parameters:
  `topVer` - Topology version.
  `assignmentChange` - Assignment change.
  `cacheDeploymentIds` - Cache deployment ID.

#### CacheAffinityChangeMessage

    public CacheAffinityChangeMessage(GridDhtPartitionExchangeId exchId,
                              GridDhtPartitionsFullMessage partsMsg,
                              Map<Integer,Map<Integer,List<UUID>>> assignmentChange)

Constructor used when message is created to finish exchange.

Parameters:
  `exchId` - Exchange ID.
  `partsMsg` - Partitions messages.
  `assignmentChange` - Assignment change.

### Method Detail

#### cacheDeploymentIds

    public Map<Integer,IgniteUuid> cacheDeploymentIds()

Returns:
  Cache deployment IDs.

#### exchangeNeeded

    public boolean exchangeNeeded()

Returns:
  `True` if request should trigger partition exchange.

#### exchangeNeeded

    public void exchangeNeeded(boolean exchangeNeeded)

Parameters:
  `exchangeNeeded` - `True` if request should trigger partition exchange.

#### partitionsMessage

    public GridDhtPartitionsFullMessage partitionsMessage()

Returns:
  Partitions message.

#### assignmentChange

    @Nullable
    public Map<Integer,Map<Integer,List<UUID>>> assignmentChange()

Returns:
  Affinity assignments.

#### exchangeId

    @Nullable
    public GridDhtPartitionExchangeId exchangeId()

Returns:
  Exchange version.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Returns:
  Topology version.

#### id

    public IgniteUuid id()

Specified by:
  `id` in interface `DiscoveryCustomMessage`
Returns:
  Unique custom message ID.

#### ackMessage

    @Nullable
    public DiscoveryCustomMessage ackMessage()

Called when custom message has been handled by all nodes.

Specified by:
  `ackMessage` in interface `DiscoveryCustomMessage`
Returns:
  Ack message or `null` if ack is not required.

#### isMutable

    public boolean isMutable()

Specified by:
  `isMutable` in interface `DiscoveryCustomMessage`
Returns:
  `true` if message can be modified during listener notification. Changes will be send to next nodes.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017