org.apache.ignite.spi.discovery

## Class DiscoveryDataBag

- java.lang.Object
- - org.apache.ignite.spi.discovery.DiscoveryDataBag

    public class DiscoveryDataBag
    extends Object

Provides interface for `GridComponent` to collect and exchange discovery data both on joining node and on cluster nodes. It only organizes interaction with components and doesn't provide any capabilities of converting collected data into formats eligible for transmitting over media (like marshalling, compressing and so on).

### Nested Class Summary

Nested Classes
`static interface` `DiscoveryDataBag.GridDiscoveryData` Facade interface representing `DiscoveryDataBag` object with discovery data collected in the grid.
`static interface` `DiscoveryDataBag.JoiningNodeDiscoveryData` Facade interface representing `DiscoveryDataBag` object with discovery data from joining node.

### Constructor Summary

Constructors
Constructor and Description
`DiscoveryDataBag(UUID joiningNodeId, boolean isJoiningNodeClient)`
`DiscoveryDataBag(UUID joiningNodeId, Set<Integer> cmnDataInitializedCmps, boolean isJoiningNodeClient)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addGridCommonData(Integer cmpId, Serializable data)`
`void` `addJoiningNodeData(Integer cmpId, Serializable data)`
`void` `addNodeSpecificData(Integer cmpId, Serializable data)`
`Map<Integer,Serializable>` `commonData()`
`void` `commonData(Map<Integer,Serializable> cmnData)`
`boolean` `commonDataCollectedFor(Integer cmpId)`
`DiscoveryDataBag.GridDiscoveryData` `gridDiscoveryData(int cmpId)`
`boolean` `isJoiningNodeClient()`
`Map<Integer,Serializable>` `joiningNodeData()`
`void` `joiningNodeData(Map<Integer,Serializable> joinNodeData)`
`UUID` `joiningNodeId()`
`Map<Integer,Serializable>` `localNodeSpecificData()`
`DiscoveryDataBag.JoiningNodeDiscoveryData` `newJoinerDiscoveryData(int cmpId)`
`void` `nodeSpecificData(Map<UUID,Map<Integer,Serializable>> nodeSpecData)`

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

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

### Constructor Detail

#### DiscoveryDataBag

    public DiscoveryDataBag(UUID joiningNodeId,
                            boolean isJoiningNodeClient)

Parameters:
  `joiningNodeId` - Joining node id.
  `isJoiningNodeClient` - Flag indicates the joining node is client.

#### DiscoveryDataBag

    public DiscoveryDataBag(UUID joiningNodeId,
                            Set<Integer> cmnDataInitializedCmps,
                            boolean isJoiningNodeClient)

Parameters:
  `joiningNodeId` - Joining node id.
  `cmnDataInitializedCmps` - Component IDs with already initialized common discovery data.
  `isJoiningNodeClient` - Flag indicates the joining node is client.

### Method Detail

#### joiningNodeId

    public UUID joiningNodeId()

Returns:
  ID of joining node.

#### isJoiningNodeClient

    public boolean isJoiningNodeClient()

Returns:
  `true` if the joining node is client node. Return `false` otherwise.

#### gridDiscoveryData

    public DiscoveryDataBag.GridDiscoveryData gridDiscoveryData(int cmpId)

Parameters:
  `cmpId` - Component ID.
Returns:
  Discovery data for given component.

#### newJoinerDiscoveryData

    public DiscoveryDataBag.JoiningNodeDiscoveryData newJoinerDiscoveryData(int cmpId)

Parameters:
  `cmpId` - Component ID.
Returns:
  Joining node discovery data.

#### addJoiningNodeData

    public void addJoiningNodeData(Integer cmpId,
                                   Serializable data)

Parameters:
  `cmpId` - Component ID.
  `data` - Data.

#### addGridCommonData

    public void addGridCommonData(Integer cmpId,
                                  Serializable data)

Parameters:
  `cmpId` - Component ID.
  `data` - Data.

#### addNodeSpecificData

    public void addNodeSpecificData(Integer cmpId,
                                    Serializable data)

Parameters:
  `cmpId` - Component ID.
  `data` - Data.

#### commonDataCollectedFor

    public boolean commonDataCollectedFor(Integer cmpId)

Parameters:
  `cmpId` - Component ID.
Returns:
  `True` if common data collected for given component.

#### joiningNodeData

    public void joiningNodeData(Map<Integer,Serializable> joinNodeData)

Parameters:
  `joinNodeData` - Joining node data.

#### commonData

    public void commonData(Map<Integer,Serializable> cmnData)

Parameters:
  `cmnData` - Cmn data.

#### nodeSpecificData

    public void nodeSpecificData(Map<UUID,Map<Integer,Serializable>> nodeSpecData)

Parameters:
  `nodeSpecData` - Node specific data.

#### joiningNodeData

    public Map<Integer,Serializable> joiningNodeData()

#### commonData

    public Map<Integer,Serializable> commonData()

#### localNodeSpecificData

    @Nullable
    public Map<Integer,Serializable> localNodeSpecificData()

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018