public class IgniteServiceProcessor extends GridProcessorAdapter implements IgniteChangeGlobalStateSupport
DiscoverySpi and
CommunicationSpi messages.ServiceDeploymentManager,
ServiceDeploymentTask,
ServiceDeploymentActions,
ServiceChangeBatchRequestGridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
static long[] |
DEFAULT_INVOCATION_BOUNDS
Default bounds of invocation histogram in nanoseconds.
|
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() |
static String |
serviceMetricRegistryName(String srvcName)
Gives proper name for service metric registry.
|
<T> T |
serviceProxy(ClusterGroup prj,
String name,
Class<? super T> srvcCls,
boolean sticky,
@Nullable Supplier<Map<String,Object>> callAttrsProvider,
long timeout,
boolean keepBinary) |
<T> Collection<T> |
services(String name) |
Map<UUID,Integer> |
serviceTopology(String name,
long timeout) |
void |
start()
Starts grid component.
|
@Nullable IgniteNodeValidationResult |
validateNode(ClusterNode node,
DiscoveryDataBag.JoiningNodeDiscoveryData data)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
assertParameter, printMemoryStats, stop, toString, validateNodepublic static final String SVCS_VIEW
public static final String SVCS_VIEW_DESC
public static final long[] DEFAULT_INVOCATION_BOUNDS
public IgniteServiceProcessor(GridKernalContext ctx)
ctx - Kernal context.public void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.public void onKernalStart(boolean active)
throws IgniteCheckedException
onKernalStart in interface GridComponentonKernalStart in class GridProcessorAdapteractive - 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 GridComponentonKernalStop in class GridProcessorAdaptercancel - Flag indicating whether jobs should be canceled.public void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage.collectGridNodeData in interface GridComponentcollectGridNodeData in class GridProcessorAdapterdataBag - container object to store discovery data in.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived in interface GridComponentonGridDataReceived in class GridProcessorAdapterdata - 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 GridComponentcollectJoiningNodeData in class GridProcessorAdapterdataBag - container object to store discovery data in.@Nullable public @Nullable IgniteNodeValidationResult validateNode(ClusterNode node, DiscoveryDataBag.JoiningNodeDiscoveryData data)
validateNode in interface GridComponentvalidateNode in class GridProcessorAdapternode - Joining node.data - Joining node discovery data.null in case of success.public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
onJoiningNodeDataReceived in interface GridComponentonJoiningNodeDataReceived in class GridProcessorAdapterdata - 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 GridComponentdiscoveryDataType in class GridProcessorAdapterpublic void onActivate(GridKernalContext kctx)
onActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public void onDeActivate(GridKernalContext kctx)
onDeActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public void onDisconnected(IgniteFuture<?> reconnectFut)
onDisconnected in interface GridComponentonDisconnected in class GridProcessorAdapterreconnectFut - Reconnect future.public IgniteInternalFuture<?> onReconnected(boolean active) throws IgniteCheckedException
onReconnected in interface GridComponentonReconnected in class GridProcessorAdapteractive - Cluster restarted flag.IgniteCheckedException - If failed.public IgniteInternalFuture<?> deployNodeSingleton(ClusterGroup prj, String name, Service srvc)
prj - Grid projection.name - Service name.srvc - Service.public IgniteInternalFuture<?> deployClusterSingleton(ClusterGroup prj, String name, Service srvc)
name - Service name.srvc - Service instance.public IgniteInternalFuture<?> deployMultiple(ClusterGroup prj, String name, Service srvc, int totalCnt, int maxPerNodeCnt)
name - Service name.srvc - Service.totalCnt - Total count.maxPerNodeCnt - Max per-node count.public IgniteInternalFuture<?> deployKeyAffinitySingleton(String name, Service srvc, String cacheName, Object affKey)
name - Service name.srvc - Service.cacheName - Cache name.affKey - Affinity key.public IgniteInternalFuture<?> deployAll(ClusterGroup prj, Collection<ServiceConfiguration> cfgs)
prj - Grid projection.cfgs - Service configurations.public IgniteInternalFuture<?> cancel(String name)
name - Service name.public IgniteInternalFuture<?> cancelAll()
public IgniteInternalFuture<?> cancelAll(@NotNull @NotNull Collection<String> servicesNames)
servicesNames - Name of services to deploy.public Map<UUID,Integer> serviceTopology(String name, long timeout) throws IgniteCheckedException
name - Service name.timeout - If greater than 0 limits task execution time. Cannot be negative.IgniteCheckedException - On error.public Collection<ServiceDescriptor> serviceDescriptors()
public <T> T service(String name)
T - Service type.name - Service name.public ServiceContextImpl serviceContext(String name)
name - Service name.public <T> T serviceProxy(ClusterGroup prj, String name, Class<? super T> srvcCls, boolean sticky, @Nullable @Nullable Supplier<Map<String,Object>> callAttrsProvider, long timeout, boolean keepBinary) throws IgniteException
T - Service interface type.prj - Grid projection.name - Service name.srvcCls - Service class.sticky - Whether multi-node request should be done.callAttrsProvider - Service call context attributes provider.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)
T - Service type.name - Service name.public void onLocalJoin(DiscoveryEvent evt, DiscoCache discoCache)
evt - Discovery event.discoCache - Discovery cache.public ServiceDeploymentManager deployment()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023