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.TcpDiscoveryAbstractTraceableMessage
    - - org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage

All Implemented Interfaces:
  Serializable, TraceableMessage

    @TcpDiscoveryEnsureDelivery
     @TcpDiscoveryRedirectToClient
    public class TcpDiscoveryNodeAddedMessage
    extends TcpDiscoveryAbstractTraceableMessage

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

`CHANGE_TOPOLOGY_FLAG_POS, CLIENT_ACK_FLAG_POS, CLIENT_FLAG_POS, CLIENT_RECON_SUCCESS_FLAG_POS, COMPRESS_DATA_PACKET, FORCE_FAIL_FLAG_POS, RESPONDED_FLAG_POS`

### Constructor Summary

Constructors
Constructor and Description
`TcpDiscoveryNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg)`
`TcpDiscoveryNodeAddedMessage(UUID creatorNodeId, TcpDiscoveryNode node, DiscoveryDataPacket dataPacket, long gridStartTime)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearDiscoveryData()` Clears discovery data to minimize message size.
`void` `clearUnmarshalledDiscoveryData()` Clears unmarshalled discovery data to minimize message size.
`Collection<TcpDiscoveryNode>` `clientTopology()`
`void` `clientTopology(Collection<TcpDiscoveryNode> top)`
`@Nullable IgniteUuid` `discardedCustomMessageId()` Gets discarded custom message ID.
`@Nullable IgniteUuid` `discardedMessageId()` Gets discarded message ID.
`DiscoveryDataPacket` `gridDiscoveryData()`
`long` `gridStartTime()`
`@Nullable Collection<TcpDiscoveryAbstractMessage>` `messages()` Gets pending messages sent to new node by its previous.
`void` `messages(@Nullable Collection<TcpDiscoveryAbstractMessage> msgs, @Nullable IgniteUuid discardMsgId, @Nullable IgniteUuid discardCustomMsgId)` Sets pending messages to send to new node.
`TcpDiscoveryNode` `node()` Gets newly added node.
`@Nullable Collection<TcpDiscoveryNode>` `topology()` Gets topology.
`void` `topology(@Nullable Collection<TcpDiscoveryNode> top)` Sets topology.
`Map<Long,Collection<ClusterNode>>` `topologyHistory()` Gets topology snapshots history.
`void` `topologyHistory(@Nullable Map<Long,Collection<ClusterNode>> topHist)` Sets topology snapshots history.
`String` `toString()`

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

`readResolve, spanContainer`

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

`addFailedNode, client, client, creatorNodeId, equals, failedNodes, failedNodes, force, force, getFlag, hashCode, highPriority, id, pendingIndex, pendingIndex, senderNodeId, senderNodeId, setFlag, topologyVersion, topologyVersion, traceLogLevel, 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,
                                        DiscoveryDataPacket dataPacket,
                                        long gridStartTime)

Constructor.

Parameters:
  `creatorNodeId` - Creator node ID.
  `node` - Node to add to topology.
  `dataPacket` - container for collecting discovery data across the cluster.
  `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 @Nullable Collection<TcpDiscoveryAbstractMessage> messages()

Gets pending messages sent to new node by its previous.

Returns:
  Pending messages from previous node.

#### discardedMessageId

    @Nullable
    public @Nullable IgniteUuid discardedMessageId()

Gets discarded message ID.

Returns:
  Discarded message ID.

#### discardedCustomMessageId

    @Nullable
    public @Nullable IgniteUuid discardedCustomMessageId()

Gets discarded custom message ID.

Returns:
  Discarded message ID.

#### messages

    public void messages(@Nullable
                         @Nullable Collection<TcpDiscoveryAbstractMessage> msgs,
                         @Nullable
                         @Nullable IgniteUuid discardMsgId,
                         @Nullable
                         @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 @Nullable Collection<TcpDiscoveryNode> topology()

Gets topology.

Returns:
  Current topology.

#### topology

    public void topology(@Nullable
                         @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
                                @Nullable Map<Long,Collection<ClusterNode>> topHist)

Sets topology snapshots history.

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

#### gridDiscoveryData

    public DiscoveryDataPacket gridDiscoveryData()

Returns:
  `DiscoveryDataPacket` carried by this message.

#### clearDiscoveryData

    public void clearDiscoveryData()

Clears discovery data to minimize message size.

#### clearUnmarshalledDiscoveryData

    public void clearUnmarshalledDiscoveryData()

Clears unmarshalled discovery data to minimize message size. These data are used only on "collect" stage and are not part of persistent state.

#### gridStartTime

    public long gridStartTime()

Returns:
  First grid node start time.

#### toString

    public String toString()

Overrides:
  `toString` in class `TcpDiscoveryAbstractMessage`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021