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
    Modifier and Type | Class and Description
    --- | ---
    `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
    Modifier and Type | Method and Description
    --- | ---
    `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()`
    `@Nullable Map<Integer,Serializable>` | `localNodeSpecificData()`
    `DiscoveryDataBag.JoiningNodeDiscoveryData` | `newJoinerDiscoveryData(int cmpId)`
    `void` | `nodeSpecificData(Map<UUID,Map<Integer,Serializable>> nodeSpecData)`
    `String` | `toString()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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()

      Returns:
        Discovery data for each Ignite component that is sent to the cluster nodes by joining node.

    - #### commonData

          public Map<Integer,Serializable> commonData()

      Returns:
        Discovery data for each Ignite component that is aggregated from the cluster nodes and sent to the joining node.

    - #### localNodeSpecificData

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

      Returns:
        Discovery data that belongs to the current cluster node and is sent to the joining node.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022