org.apache.ignite.internal.managers.deployment

## Class GridDeploymentManager

- java.lang.Object
- - org.apache.ignite.internal.managers.GridManagerAdapter<DeploymentSpi>
  - - org.apache.ignite.internal.managers.deployment.GridDeploymentManager

All Implemented Interfaces:
  GridComponent, GridManager

    public class GridDeploymentManager
    extends GridManagerAdapter<DeploymentSpi>

Deployment manager.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.managers.GridManagerAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridDeploymentManager(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addCacheParticipants(Map<UUID,IgniteUuid> allParticipants, Map<UUID,IgniteUuid> addedParticipants)` Adds participants to all SHARED deployments.
`@Nullable GridDeployment` `deploy(Class<?> cls, ClassLoader clsLdr)`
`boolean` `enabled()`
`Map<String,Class<? extends ComputeTask<?,?>>>` `findAllTasks(IgnitePredicate<? super Class<? extends ComputeTask<?,?>>>... p)`
`@Nullable IgniteUuid` `getClassLoaderId(ClassLoader ldr)`
`@Nullable GridDeployment` `getDeployment(IgniteUuid ldrId)` Gets any deployment by loader ID.
`@Nullable GridDeployment` `getDeployment(String rsrcName)`
`@Nullable GridDeployment` `getGlobalDeployment(DeploymentMode depMode, String rsrcName, String clsName, String userVer, UUID sndNodeId, IgniteUuid clsLdrId, Map<UUID,IgniteUuid> participants, @Nullable IgnitePredicate<ClusterNode> nodeFilter)`
`@Nullable GridDeployment` `getLocalDeployment(String rsrcName)`
`boolean` `isGlobalLoader(ClassLoader ldr)`
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onKernalStart0()`
`void` `onKernalStop0(boolean cancel)`
`IgniteInternalFuture<?>` `onReconnected(boolean clusterRestarted)` Client reconnected callback.
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`void` `undeployTask(String taskName, boolean locUndeploy, Collection<ClusterNode> rmtNodes)`

### Methods inherited from class org.apache.ignite.internal.managers.GridManagerAdapter

`assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, getSpi, getSpi, getSpis, inject, onAfterSpiStart, onBeforeSpiStart, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNode, validateNode`

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

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

### Constructor Detail

#### GridDeploymentManager

    public GridDeploymentManager(GridKernalContext ctx)

Parameters:
  `ctx` - Grid kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

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

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)
                        throws IgniteCheckedException

Client disconnected callback.

Specified by:
  `onDisconnected` in interface `GridComponent`
Overrides:
  `onDisconnected` in class `GridManagerAdapter<DeploymentSpi>`
Parameters:
  `reconnectFut` - Reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### onReconnected

    public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted)
                                          throws IgniteCheckedException

Client reconnected callback.

Specified by:
  `onReconnected` in interface `GridComponent`
Overrides:
  `onReconnected` in class `GridManagerAdapter<DeploymentSpi>`
Parameters:
  `clusterRestarted` - Cluster restarted flag.
Returns:
  Future to wait before completing reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### stop

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

#### onKernalStart0

    public void onKernalStart0()
                        throws IgniteCheckedException

Overrides:
  `onKernalStart0` in class `GridManagerAdapter<DeploymentSpi>`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    public void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridManagerAdapter<DeploymentSpi>`
Parameters:
  `cancel` - Cancel flag.

#### enabled

    public boolean enabled()

Specified by:
  `enabled` in interface `GridManager`
Overrides:
  `enabled` in class `GridManagerAdapter<DeploymentSpi>`
Returns:
  `true` if at least one SPI does not have a `NO-OP` implementation, `false` otherwise.

#### findAllTasks

    public Map<String,Class<? extends ComputeTask<?,?>>> findAllTasks(@Nullable
                                                                      IgnitePredicate<? super Class<? extends ComputeTask<?,?>>>... p)

Parameters:
  `p` - Filtering predicate.
Returns:
  All deployed tasks for given predicate.

#### undeployTask

    public void undeployTask(String taskName,
                             boolean locUndeploy,
                             Collection<ClusterNode> rmtNodes)

Parameters:
  `taskName` - Task name.
  `locUndeploy` - Local undeploy flag.
  `rmtNodes` - Nodes to send request to.

#### deploy

    @Nullable
    public @Nullable GridDeployment deploy(Class<?> cls,
                                                     ClassLoader clsLdr)
                                              throws IgniteCheckedException

Parameters:
  `cls` - Class to deploy.
  `clsLdr` - Class loader.
Returns:
  Grid deployment.
Throws:
  `IgniteCheckedException` - If deployment failed.

#### getDeployment

    @Nullable
    public @Nullable GridDeployment getDeployment(IgniteUuid ldrId)

Gets any deployment by loader ID.

Parameters:
  `ldrId` - Loader ID.
Returns:
  Deployment for given ID.

#### getDeployment

    @Nullable
    public @Nullable GridDeployment getDeployment(String rsrcName)

Parameters:
  `rsrcName` - Resource to find deployment for.
Returns:
  Found deployment or `null` if one was not found.

#### getLocalDeployment

    @Nullable
    public @Nullable GridDeployment getLocalDeployment(String rsrcName)

Parameters:
  `rsrcName` - Class name.
Returns:
  Grid cached task.

#### getGlobalDeployment

    @Nullable
    public @Nullable GridDeployment getGlobalDeployment(DeploymentMode depMode,
                                                                  String rsrcName,
                                                                  String clsName,
                                                                  String userVer,
                                                                  UUID sndNodeId,
                                                                  IgniteUuid clsLdrId,
                                                                  Map<UUID,IgniteUuid> participants,
                                                                  @Nullable
                                                                  @Nullable IgnitePredicate<ClusterNode> nodeFilter)

Parameters:
  `depMode` - Deployment mode.
  `rsrcName` - Resource name (could be task name).
  `clsName` - Class name.
  `userVer` - User version.
  `sndNodeId` - Sender node ID.
  `clsLdrId` - Class loader ID.
  `participants` - Node class loader participant map.
  `nodeFilter` - Node filter for class loader.
Returns:
  Deployment class if found.

#### addCacheParticipants

    public void addCacheParticipants(Map<UUID,IgniteUuid> allParticipants,
                                     Map<UUID,IgniteUuid> addedParticipants)

Adds participants to all SHARED deployments.

Parameters:
  `allParticipants` - All participants.
  `addedParticipants` - Added participants.

#### getClassLoaderId

    @Nullable
    public @Nullable IgniteUuid getClassLoaderId(ClassLoader ldr)

Parameters:
  `ldr` - Class loader to get ID for.
Returns:
  ID for given class loader or `null` if given loader is not grid deployment class loader.

#### isGlobalLoader

    public boolean isGlobalLoader(ClassLoader ldr)

Parameters:
  `ldr` - Loader to check.
Returns:
  `True` if P2P class loader.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021