public class IgniteServiceProcessor extends ServiceProcessorAdapter implements IgniteChangeGlobalStateSupport
DiscoverySpi
and
CommunicationSpi
messages.ServiceDeploymentManager
,
ServiceDeploymentTask
,
ServiceDeploymentActions
,
ServiceChangeBatchRequest
GridComponent.DiscoveryDataExchangeType
Modifier and Type | Field and Description |
---|---|
static String |
SVCS_VIEW |
static String |
SVCS_VIEW_DESC |
ctx, diagnosticLog, log
Constructor and Description |
---|
IgniteServiceProcessor(GridKernalContext ctx) |
Modifier and Type | Method and Description |
---|---|
IgniteInternalFuture<?> |
cancel(String name) |
IgniteInternalFuture<?> |
cancelAll() |
IgniteInternalFuture<?> |
cancelAll(@NotNull Collection<String> servicesNames) |
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. |
IgniteInternalFuture<?> |
deployAll(ClusterGroup prj,
Collection<ServiceConfiguration> cfgs) |
IgniteInternalFuture<?> |
deployClusterSingleton(ClusterGroup prj,
String name,
Service srvc) |
IgniteInternalFuture<?> |
deployKeyAffinitySingleton(String name,
Service srvc,
String cacheName,
Object affKey) |
ServiceDeploymentManager |
deployment() |
IgniteInternalFuture<?> |
deployMultiple(ClusterGroup prj,
String name,
Service srvc,
int totalCnt,
int maxPerNodeCnt) |
IgniteInternalFuture<?> |
deployNodeSingleton(ClusterGroup prj,
String name,
Service srvc) |
@Nullable GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
void |
onActivate(GridKernalContext kctx)
Called when cluster performing activation.
|
void |
onDeActivate(GridKernalContext kctx)
Invokes from services deployment worker.
|
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.
|
void |
onLocalJoin(DiscoveryEvent evt,
DiscoCache discoCache)
Callback for local join events for which the regular events are not generated.
|
IgniteInternalFuture<?> |
onReconnected(boolean active)
Client reconnected callback.
|
<T> T |
service(String name) |
ServiceContextImpl |
serviceContext(String name) |
Collection<ServiceDescriptor> |
serviceDescriptors() |
<T> T |
serviceProxy(ClusterGroup prj,
String name,
Class<? super T> srvcCls,
boolean sticky,
long timeout) |
<T> Collection<T> |
services(String name) |
Map<UUID,Integer> |
serviceTopology(String name,
long timeout) |
void |
start()
Starts grid component.
|
assertParameter, printMemoryStats, stop, toString, validateNode, validateNode
public static final String SVCS_VIEW
public static final String SVCS_VIEW_DESC
public IgniteServiceProcessor(GridKernalContext ctx)
ctx
- Kernal context.public void start() throws IgniteCheckedException
start
in interface GridComponent
start
in class GridProcessorAdapter
IgniteCheckedException
- Throws in case of any errors.public void onKernalStart(boolean active) throws IgniteCheckedException
onKernalStart
in interface GridComponent
onKernalStart
in class GridProcessorAdapter
active
- Cluster active flag (note: should be used carefully since state can
change concurrently).IgniteCheckedException
- Thrown in case of any errors.public void onKernalStop(boolean cancel)
onKernalStop
in interface GridComponent
onKernalStop
in class GridProcessorAdapter
cancel
- Flag indicating whether jobs should be canceled.public void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage
.collectGridNodeData
in interface GridComponent
collectGridNodeData
in class GridProcessorAdapter
dataBag
- container object to store discovery data in.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived
in interface GridComponent
onGridDataReceived
in class GridProcessorAdapter
data
- DiscoveryDataBag.GridDiscoveryData
interface to retrieve discovery data collected on remote nodes
(data common for all nodes in grid and specific for each node).public void collectJoiningNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryJoinRequestMessage
request.collectJoiningNodeData
in interface GridComponent
collectJoiningNodeData
in class GridProcessorAdapter
dataBag
- container object to store discovery data in.public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
onJoiningNodeDataReceived
in interface GridComponent
onJoiningNodeDataReceived
in class GridProcessorAdapter
data
- DiscoveryDataBag.JoiningNodeDiscoveryData
interface to retrieve discovery data of joining node.@Nullable public @Nullable GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectJoiningNodeData(DiscoveryDataBag)
or GridComponent.collectGridNodeData(DiscoveryDataBag)
.discoveryDataType
in interface GridComponent
discoveryDataType
in class GridProcessorAdapter
public void onActivate(GridKernalContext kctx)
onActivate
in interface IgniteChangeGlobalStateSupport
kctx
- Kernal context.public void onDeActivate(GridKernalContext kctx)
onDeActivate
in interface IgniteChangeGlobalStateSupport
kctx
- Kernal context.public void onDisconnected(IgniteFuture<?> reconnectFut)
onDisconnected
in interface GridComponent
onDisconnected
in class GridProcessorAdapter
reconnectFut
- Reconnect future.public IgniteInternalFuture<?> onReconnected(boolean active) throws IgniteCheckedException
onReconnected
in interface GridComponent
onReconnected
in class GridProcessorAdapter
active
- Cluster restarted flag.IgniteCheckedException
- If failed.public IgniteInternalFuture<?> deployNodeSingleton(ClusterGroup prj, String name, Service srvc)
deployNodeSingleton
in class ServiceProcessorAdapter
prj
- Grid projection.name
- Service name.srvc
- Service.public IgniteInternalFuture<?> deployClusterSingleton(ClusterGroup prj, String name, Service srvc)
deployClusterSingleton
in class ServiceProcessorAdapter
name
- Service name.srvc
- Service instance.public IgniteInternalFuture<?> deployMultiple(ClusterGroup prj, String name, Service srvc, int totalCnt, int maxPerNodeCnt)
deployMultiple
in class ServiceProcessorAdapter
name
- Service name.srvc
- Service.totalCnt
- Total count.maxPerNodeCnt
- Max per-node count.public IgniteInternalFuture<?> deployKeyAffinitySingleton(String name, Service srvc, String cacheName, Object affKey)
deployKeyAffinitySingleton
in class ServiceProcessorAdapter
name
- Service name.srvc
- Service.cacheName
- Cache name.affKey
- Affinity key.public IgniteInternalFuture<?> deployAll(ClusterGroup prj, Collection<ServiceConfiguration> cfgs)
deployAll
in class ServiceProcessorAdapter
prj
- Grid projection.cfgs
- Service configurations.public IgniteInternalFuture<?> cancel(String name)
cancel
in class ServiceProcessorAdapter
name
- Service name.public IgniteInternalFuture<?> cancelAll()
cancelAll
in class ServiceProcessorAdapter
public IgniteInternalFuture<?> cancelAll(@NotNull @NotNull Collection<String> servicesNames)
cancelAll
in class ServiceProcessorAdapter
servicesNames
- Name of services to deploy.public Map<UUID,Integer> serviceTopology(String name, long timeout) throws IgniteCheckedException
serviceTopology
in class ServiceProcessorAdapter
name
- Service name.timeout
- If greater than 0 limits task execution time. Cannot be negative.IgniteCheckedException
- On error.public Collection<ServiceDescriptor> serviceDescriptors()
serviceDescriptors
in class ServiceProcessorAdapter
public <T> T service(String name)
service
in class ServiceProcessorAdapter
T
- Service type.name
- Service name.public ServiceContextImpl serviceContext(String name)
serviceContext
in class ServiceProcessorAdapter
name
- Service name.public <T> T serviceProxy(ClusterGroup prj, String name, Class<? super T> srvcCls, boolean sticky, long timeout) throws IgniteException
serviceProxy
in class ServiceProcessorAdapter
T
- Service interface type.prj
- Grid projection.name
- Service name.srvcCls
- Service class.sticky
- Whether multi-node request should be done.timeout
- If greater than 0 limits service acquire time. Cannot be negative.IgniteException
- If failed to create proxy.public <T> Collection<T> services(String name)
services
in class ServiceProcessorAdapter
T
- Service type.name
- Service name.public void onLocalJoin(DiscoveryEvent evt, DiscoCache discoCache)
onLocalJoin
in class ServiceProcessorAdapter
evt
- Discovery event.discoCache
- Discovery cache.public ServiceDeploymentManager deployment()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021