org.apache.ignite.internal

## Interface GridComponent

All Known Subinterfaces:
  CacheObjectBinaryProcessor, DiscoveryNodeValidationProcessor, GridManager, GridProcessor, GridSecurityProcessor, GridSegmentationProcessor, IgniteCacheObjectProcessor, IGridClusterStateProcessor, MvccProcessor, PlatformProcessor

All Known Implementing Classes:
  CacheObjectBinaryProcessorImpl, ClientListenerProcessor, ClusterProcessor, DataStreamProcessor, DataStructuresProcessor, FailureProcessor, GridAffinityProcessor, GridCacheProcessor, GridCheckpointManager, GridClosureProcessor, GridClusterStateProcessor, GridCollisionManager, GridContinuousProcessor, GridDeploymentManager, GridDiscoveryManager, GridEncryptionManager, GridEventStorageManager, GridFailoverManager, GridIndexingManager, GridInternalSubscriptionProcessor, GridIoManager, GridJobMetricsProcessor, GridJobProcessor, GridLoadBalancerManager, GridManagerAdapter, GridMarshallerMappingProcessor, GridOffHeapProcessor, GridOsSecurityProcessor, GridOsSegmentationProcessor, GridPluginComponent, GridPortProcessor, GridProcessorAdapter, GridQueryProcessor, GridResourceProcessor, GridRestProcessor, GridServiceProcessor, GridTaskProcessor, GridTaskSessionProcessor, GridTimeoutProcessor, HadoopNoopProcessor, HadoopProcessorAdapter, IgfsNoopProcessor, IgfsProcessor, IgfsProcessorAdapter, IgniteAuthenticationProcessor, IgniteCacheObjectProcessorImpl, IgniteNoopScheduleProcessor, IgnitePluginProcessor, IgniteScheduleProcessorAdapter, MvccProcessorImpl, OsDiscoveryNodeValidationProcessor, PdsConsistentIdProcessor, PlatformNoopProcessor, PlatformPluginProcessor, PlatformProcessorImpl, PoolProcessor

    public interface GridComponent

Interface for all main internal Ignite components (managers and processors).

### Nested Class Summary

Nested Classes
`static class` `GridComponent.DiscoveryDataExchangeType` Unique component type for discovery data exchange.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `collectGridNodeData(DiscoveryDataBag dataBag)` Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.
`void` `collectJoiningNodeData(DiscoveryDataBag dataBag)` Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)` Method is called on nodes that are already in grid (not on joining node).
`void` `onKernalStart(boolean active)` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`IgniteInternalFuture<?>` `onReconnected(boolean clusterRestarted)` Client reconnected callback.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`IgniteNodeValidationResult` `validateNode(ClusterNode node)` Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.
`IgniteNodeValidationResult` `validateNode(ClusterNode node, DiscoveryDataBag.JoiningNodeDiscoveryData discoData)`

### Method Detail

#### start

    void start()
        throws IgniteCheckedException

Starts grid component.

Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### stop

    void stop(boolean cancel)
       throws IgniteCheckedException

Stops grid component.

Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onKernalStart

    void onKernalStart(boolean active)
                throws IgniteCheckedException

Callback that notifies that kernal has successfully started, including all managers and processors.

Parameters:
  `active` - Cluster active flag (note: should be used carefully since state can change concurrently).
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onKernalStop

    void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### collectJoiningNodeData

    void collectJoiningNodeData(DiscoveryDataBag dataBag)

Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.

Parameters:
  `dataBag` - container object to store discovery data in.

#### collectGridNodeData

    void collectGridNodeData(DiscoveryDataBag dataBag)

Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.

Parameters:
  `dataBag` - container object to store discovery data in.

#### onGridDataReceived

    void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)

Receives discovery data object from remote nodes (called on new node during discovery process).

Parameters:
  `data` - `DiscoveryDataBag.GridDiscoveryData` interface to retrieve discovery data collected on remote nodes (data common for all nodes in grid and specific for each node).

#### onJoiningNodeDataReceived

    void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)

Method is called on nodes that are already in grid (not on joining node). It receives discovery data from joining node.

Parameters:
  `data` - `DiscoveryDataBag.JoiningNodeDiscoveryData` interface to retrieve discovery data of joining node.

#### printMemoryStats

    void printMemoryStats()

Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.

#### validateNode

    @Nullable
    IgniteNodeValidationResult validateNode(ClusterNode node)

Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.

Parameters:
  `node` - Joining node.
Returns:
  Validation result or `null` in case of success.

#### validateNode

    @Nullable
    IgniteNodeValidationResult validateNode(ClusterNode node,
                                                      DiscoveryDataBag.JoiningNodeDiscoveryData discoData)

#### discoveryDataType

    @Nullable
    GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements any of methods `collectJoiningNodeData(DiscoveryDataBag)` or `collectGridNodeData(DiscoveryDataBag)`.

Returns:
  Unique component type for discovery data exchange.

#### onDisconnected

    void onDisconnected(IgniteFuture<?> reconnectFut)
                 throws IgniteCheckedException

Client disconnected callback.

Parameters:
  `reconnectFut` - Reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### onReconnected

    @Nullable
    IgniteInternalFuture<?> onReconnected(boolean clusterRestarted)
                                             throws IgniteCheckedException

Client reconnected callback.

Parameters:
  `clusterRestarted` - Cluster restarted flag.
Returns:
  Future to wait before completing reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019