org.apache.ignite.internal

## Interface GridComponent

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

All Known Implementing Classes:
  CacheObjectBinaryProcessorImpl, ClusterProcessor, DataStreamProcessor, DataStructuresProcessor, GridAffinityProcessor, GridCacheProcessor, GridCheckpointManager, GridClockSyncProcessor, GridClosureProcessor, GridCollisionManager, GridContinuousProcessor, GridDeploymentManager, GridDiscoveryManager, GridEventStorageManager, GridFailoverManager, GridIndexingManager, GridIoManager, GridJobMetricsProcessor, GridJobProcessor, GridLoadBalancerManager, GridManagerAdapter, GridOffHeapProcessor, GridOsSecurityProcessor, GridOsSegmentationProcessor, GridPluginComponent, GridPortProcessor, GridProcessorAdapter, GridQueryProcessor, GridResourceProcessor, GridRestProcessor, GridServiceProcessor, GridSwapSpaceManager, GridTaskProcessor, GridTaskSessionProcessor, GridTimeoutProcessor, HadoopNoopProcessor, HadoopProcessorAdapter, IgfsNoopProcessor, IgfsProcessor, IgfsProcessorAdapter, IgniteCacheObjectProcessorImpl, IgniteNoopScheduleProcessor, IgnitePluginProcessor, IgniteScheduleProcessorAdapter, OdbcProcessor, OsDiscoveryNodeValidationProcessor, PlatformNoopProcessor, PlatformProcessorImpl

    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

Methods
`Serializable` `collectDiscoveryData(UUID nodeId)` Gets discovery data object that will be sent to new node during discovery process.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Serializable data)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `onKernalStart()` 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.

### 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()
                       throws IgniteCheckedException

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

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.

#### collectDiscoveryData

    @Nullable
    Serializable collectDiscoveryData(UUID nodeId)

Gets discovery data object that will be sent to new node during discovery process.

Parameters:
  `nodeId` - ID of new node that joins topology.
Returns:
  Discovery data object or `null` if there is nothing to send for this component.

#### onDiscoveryDataReceived

    void onDiscoveryDataReceived(UUID joiningNodeId,
                               UUID rmtNodeId,
                               Serializable data)

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

Parameters:
  `joiningNodeId` - Joining node ID.
  `rmtNodeId` - Remote node ID for which data is provided.
  `data` - Discovery data object or `null` if nothing was

#### 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.

#### discoveryDataType

    @Nullable
    GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements method `collectDiscoveryData(UUID)`.

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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016