org.apache.ignite.spi.discovery.tcp.messages

## Class TcpDiscoveryNodeAddedMessage

- java.lang.Object
- - org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage
  - - org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage

All Implemented Interfaces:
  Serializable

    @TcpDiscoveryEnsureDelivery
    @TcpDiscoveryRedirectToClient
    public class TcpDiscoveryNodeAddedMessage
    extends TcpDiscoveryAbstractMessage

Message telling nodes that new node should be added to topology. When newly added node receives the message it connects to its next and finishes join process.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage

`CLIENT_ACK_FLAG_POS, CLIENT_FLAG_POS, CLIENT_RECON_SUCCESS_FLAG_POS, RESPONDED_FLAG_POS`

### Constructor Summary

Constructors
Constructor and Description
`TcpDiscoveryNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg)`
`TcpDiscoveryNodeAddedMessage(UUID creatorNodeId, TcpDiscoveryNode node, Map<Integer,byte[]> newNodeDiscoData, long gridStartTime)` Constructor.

### Method Summary

Methods
`void` `addDiscoveryData(UUID nodeId, Map<Integer,byte[]> discoData)`
`void` `clearDiscoveryData()` Clears discovery data to minimize message size.
`Collection<TcpDiscoveryNode>` `clientTopology()`
`void` `clientTopology(Collection<TcpDiscoveryNode> top)`
`IgniteUuid` `discardedCustomMessageId()` Gets discarded custom message ID.
`IgniteUuid` `discardedMessageId()` Gets discarded message ID.
`long` `gridStartTime()`
`Collection<TcpDiscoveryAbstractMessage>` `messages()` Gets pending messages sent to new node by its previous.
`void` `messages(Collection<TcpDiscoveryAbstractMessage> msgs, IgniteUuid discardMsgId, IgniteUuid discardCustomMsgId)` Sets pending messages to send to new node.
`Map<Integer,byte[]>` `newNodeDiscoveryData()`
`TcpDiscoveryNode` `node()` Gets newly added node.
`Map<UUID,Map<Integer,byte[]>>` `oldNodesDiscoveryData()`
`Collection<TcpDiscoveryNode>` `topology()` Gets topology.
`void` `topology(Collection<TcpDiscoveryNode> top)` Sets topology.
`Map<Long,Collection<ClusterNode>>` `topologyHistory()` Gets topology snapshots history.
`void` `topologyHistory(Map<Long,Collection<ClusterNode>> topHist)` Sets topology snapshots history.
`String` `toString()`

### Methods inherited from class org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage

`addFailedNode, client, client, creatorNodeId, equals, failedNodes, failedNodes, getFlag, hashCode, highPriority, id, pendingIndex, pendingIndex, senderNodeId, senderNodeId, setFlag, topologyVersion, topologyVersion, verified, verifierNodeId, verify`

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

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

### Constructor Detail

#### TcpDiscoveryNodeAddedMessage

    public TcpDiscoveryNodeAddedMessage(UUID creatorNodeId,
                                TcpDiscoveryNode node,
                                Map<Integer,byte[]> newNodeDiscoData,
                                long gridStartTime)

Constructor.

Parameters:
  `creatorNodeId` - Creator node ID.
  `node` - Node to add to topology.
  `newNodeDiscoData` - New Node discovery data.
  `gridStartTime` - Start time of the first grid node.

#### TcpDiscoveryNodeAddedMessage

    public TcpDiscoveryNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg)

Parameters:
  `msg` - Message.

### Method Detail

#### node

    public TcpDiscoveryNode node()

Gets newly added node.

Returns:
  New node.

#### messages

    @Nullable
    public Collection<TcpDiscoveryAbstractMessage> messages()

Gets pending messages sent to new node by its previous.

Returns:
  Pending messages from previous node.

#### discardedMessageId

    @Nullable
    public IgniteUuid discardedMessageId()

Gets discarded message ID.

Returns:
  Discarded message ID.

#### discardedCustomMessageId

    @Nullable
    public IgniteUuid discardedCustomMessageId()

Gets discarded custom message ID.

Returns:
  Discarded message ID.

#### messages

    public void messages(@Nullable
                Collection<TcpDiscoveryAbstractMessage> msgs,
                @Nullable
                IgniteUuid discardMsgId,
                @Nullable
                IgniteUuid discardCustomMsgId)

Sets pending messages to send to new node.

Parameters:
  `msgs` - Pending messages to send to new node.
  `discardMsgId` - Discarded message ID.
  `discardCustomMsgId` - Discarded custom message ID.

#### topology

    @Nullable
    public Collection<TcpDiscoveryNode> topology()

Gets topology.

Returns:
  Current topology.

#### topology

    public void topology(@Nullable
                Collection<TcpDiscoveryNode> top)

Sets topology.

Parameters:
  `top` - Current topology.

#### clientTopology

    public void clientTopology(Collection<TcpDiscoveryNode> top)

Parameters:
  `top` - Topology at the moment when client joined.

#### clientTopology

    public Collection<TcpDiscoveryNode> clientTopology()

Returns:
  Topology at the moment when client joined.

#### topologyHistory

    public Map<Long,Collection<ClusterNode>> topologyHistory()

Gets topology snapshots history.

Returns:
  Map with topology snapshots history.

#### topologyHistory

    public void topologyHistory(@Nullable
                       Map<Long,Collection<ClusterNode>> topHist)

Sets topology snapshots history.

Parameters:
  `topHist` - Map with topology snapshots history.

#### newNodeDiscoveryData

    public Map<Integer,byte[]> newNodeDiscoveryData()

Returns:
  Discovery data from new node.

#### oldNodesDiscoveryData

    public Map<UUID,Map<Integer,byte[]>> oldNodesDiscoveryData()

Returns:
  Discovery data from old nodes.

#### addDiscoveryData

    public void addDiscoveryData(UUID nodeId,
                        Map<Integer,byte[]> discoData)

Parameters:
  `nodeId` - Node ID.
  `discoData` - Discovery data to add.

#### clearDiscoveryData

    public void clearDiscoveryData()

Clears discovery data to minimize message size.

#### gridStartTime

    public long gridStartTime()

Returns:
  First grid node start time.

#### toString

    public String toString()

Overrides:
  `toString` in class `TcpDiscoveryAbstractMessage`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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