public class ClusterGroupAdapter extends Object implements ClusterGroupEx, Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected GridKernalContext |
ctx
Kernal context.
|
protected IgnitePredicate<ClusterNode> |
p
Cluster group predicate.
|
protected UUID |
subjId
Subject ID.
|
| Modifier | Constructor and Description |
|---|---|
|
ClusterGroupAdapter()
Required by
Externalizable. |
protected |
ClusterGroupAdapter(@Nullable GridKernalContext ctx,
@Nullable UUID subjId,
@Nullable IgnitePredicate<ClusterNode> p) |
protected |
ClusterGroupAdapter(@Nullable GridKernalContext ctx,
@Nullable UUID subjId,
Set<UUID> ids) |
| Modifier and Type | Method and Description |
|---|---|
IgniteCompute |
compute() |
protected org.apache.ignite.internal.cluster.ClusterGroupAdapter.ClusterGroupState |
ensureLastTopologyState() |
IgniteEvents |
events() |
ExecutorService |
executorService() |
ClusterGroup |
forAttribute(String name,
@Nullable Object val)
Creates a new cluster group for nodes containing given name and value
specified in user attributes.
|
ClusterGroup |
forCacheNodes(String cacheName)
Creates a cluster group for all nodes that have cache with specified name, either in client or server modes.
|
ClusterGroup |
forCacheNodes(String cacheName,
boolean affNodes,
boolean nearNodes,
boolean clientNodes) |
ClusterGroup |
forClientNodes(String cacheName)
Creates a cluster group for all client nodes that access cache with the specified name.
|
ClusterGroup |
forClients()
Creates a cluster group of nodes started in client mode.
|
ClusterGroup |
forDaemons()
Gets a cluster group consisting from the daemon nodes.
|
ClusterGroup |
forDataNodes(String cacheName)
Creates a cluster group for all data nodes that have the cache with the specified name running.
|
ClusterGroup |
forHost(ClusterNode node)
Gets cluster group consisting from the nodes in this cluster group residing on the
same host as the given node.
|
ClusterGroup |
forHost(String host,
String... hosts)
Gets cluster group consisting from the nodes running on the hosts specified.
|
ClusterGroup |
forNode(ClusterNode node,
ClusterNode... nodes)
Creates a cluster group for the given node.
|
ClusterGroup |
forNodeId(UUID id,
UUID... ids)
Creates a cluster group for a node with the specified ID.
|
ClusterGroup |
forNodeIds(Collection<UUID> ids)
Creates a cluster group over nodes with specified node IDs.
|
ClusterGroup |
forNodes(Collection<? extends ClusterNode> nodes)
Creates a cluster group over a given set of nodes.
|
ClusterGroup |
forOldest()
Creates a cluster group with one oldest node from the current cluster group.
|
ClusterGroup |
forOthers(ClusterGroup grp)
Creates a cluster group for nodes not included into the given cluster group.
|
ClusterGroup |
forOthers(ClusterNode node,
ClusterNode... nodes)
Creates a cluster group for nodes other than the given nodes.
|
ClusterGroup |
forPredicate(IgnitePredicate<ClusterNode> p)
Creates a new cluster group which includes all nodes that pass the given predicate filter.
|
ClusterGroup |
forRandom()
Creates a cluster group with one random node from the current cluster group.
|
ClusterGroup |
forRemotes()
Gets cluster group consisting from the nodes in this cluster group excluding the local node.
|
ClusterGroup |
forServers()
Creates a cluster group of nodes started in server mode.
|
ClusterGroupEx |
forSubjectId(UUID subjId)
Creates projection for specified subject ID.
|
ClusterGroup |
forYoungest()
Creates a cluster group with one youngest node in the current cluster group.
|
protected void |
guard()
ctx.gateway().readLock()
|
Collection<String> |
hostNames()
Gets the read-only collection of hostnames in this cluster group.
|
Ignite |
ignite()
Gets instance of grid.
|
IgniteMessaging |
message() |
ClusterMetrics |
metrics()
Gets a metrics snapshot for this cluster group.
|
ClusterNode |
node()
Gets first node from the list of nodes in this cluster group.
|
ClusterNode |
node(UUID id)
Gets a node for given ID from this cluster group.
|
Collection<ClusterNode> |
nodes()
Gets the read-only collection of nodes in this cluster group.
|
IgnitePredicate<ClusterNode> |
predicate()
Gets predicate that defines a subset of nodes for this cluster group.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on unmarshalling.
|
protected org.apache.ignite.internal.cluster.ClusterGroupAdapter.ClusterGroupState |
resetState() |
protected Collection<ClusterNode> |
resolveCurrentNodes() |
IgniteServices |
services() |
void |
setKernalContext(GridKernalContext ctx)
Sets kernal context.
|
protected void |
unguard()
ctx.gateway().readUnlock()
|
void |
writeExternal(ObjectOutput out) |
protected transient GridKernalContext ctx
protected UUID subjId
protected IgnitePredicate<ClusterNode> p
public ClusterGroupAdapter()
Externalizable.protected ClusterGroupAdapter(@Nullable
@Nullable GridKernalContext ctx,
@Nullable
@Nullable UUID subjId,
@Nullable
@Nullable IgnitePredicate<ClusterNode> p)
subjId - Subject ID.ctx - Kernal context.p - Predicate.protected ClusterGroupAdapter(@Nullable
@Nullable GridKernalContext ctx,
@Nullable
@Nullable UUID subjId,
Set<UUID> ids)
ctx - Kernal context.subjId - Subject ID.ids - Node IDs.protected void guard()
protected void unguard()
public void setKernalContext(GridKernalContext ctx)
ctx - Kernal context to set.public final Ignite ignite()
ignite in interface ClusterGrouppublic final IgniteCompute compute()
IgniteCompute for this cluster group.public final IgniteMessaging message()
IgniteMessaging for this cluster group.public final IgniteEvents events()
IgniteEvents for this cluster group.public IgniteServices services()
IgniteServices for this cluster group.public ExecutorService executorService()
ExecutorService for this cluster group.public final ClusterMetrics metrics()
metrics in interface ClusterGrouppublic Collection<ClusterNode> nodes()
nodes in interface ClusterGroupprotected Collection<ClusterNode> resolveCurrentNodes()
public Collection<String> hostNames()
hostNames in interface ClusterGrouppublic final ClusterNode node(UUID id)
node in interface ClusterGroupid - Node ID.null, if such node does not exist.public ClusterNode node()
node in interface ClusterGroupnull if the cluster group is empty.public IgnitePredicate<ClusterNode> predicate()
predicate in interface ClusterGrouppublic ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p)
forPredicate in interface ClusterGroupp - Predicate filter for nodes to include into the cluster group.public final ClusterGroup forAttribute(String name, @Nullable @Nullable Object val)
User attributes for every node are optional and can be specified in
grid node configuration. See IgniteConfiguration.getUserAttributes()
for more information.
forAttribute in interface ClusterGroupname - Name of the attribute.val - Optional attribute value to match.public ClusterGroup forServers()
forServers in interface ClusterGroupIgnition.setClientMode(boolean),
IgniteConfiguration.setClientMode(boolean)public ClusterGroup forClients()
forClients in interface ClusterGroupIgnition.setClientMode(boolean),
IgniteConfiguration.setClientMode(boolean)public final ClusterGroup forNode(ClusterNode node, ClusterNode... nodes)
forNode in interface ClusterGroupnode - Node to create cluster group for.nodes - Optional additional nodes to include into the cluster group.public final ClusterGroup forNodes(Collection<? extends ClusterNode> nodes)
forNodes in interface ClusterGroupnodes - Collection of nodes to create the cluster group from.public final ClusterGroup forNodeId(UUID id, UUID... ids)
forNodeId in interface ClusterGroupid - Node ID to get the cluster group for.ids - Optional additional node IDs to include into the cluster group.public final ClusterGroup forNodeIds(Collection<UUID> ids)
forNodeIds in interface ClusterGroupids - Collection of node IDs.public final ClusterGroup forOthers(ClusterNode node, ClusterNode... nodes)
forOthers in interface ClusterGroupnode - Node to exclude from the new cluster group.nodes - Optional additional nodes to exclude from the cluster group.public ClusterGroup forOthers(ClusterGroup grp)
forOthers in interface ClusterGroupgrp - Cluster group to exclude from the new cluster group.public final ClusterGroup forRemotes()
forRemotes in interface ClusterGrouppublic final ClusterGroup forCacheNodes(String cacheName)
forCacheNodes in interface ClusterGroupcacheName - Cache name.public final ClusterGroup forDataNodes(String cacheName)
forDataNodes in interface ClusterGroupcacheName - Cache name.public final ClusterGroup forClientNodes(String cacheName)
forClientNodes in interface ClusterGroupcacheName - Cache name.public ClusterGroup forCacheNodes(String cacheName, boolean affNodes, boolean nearNodes, boolean clientNodes)
forCacheNodes in interface ClusterGroupExcacheName - Cache name.affNodes - Flag to include affinity nodes.nearNodes - Flag to include near nodes.clientNodes - Flag to include client nodes.public final ClusterGroup forHost(ClusterNode node)
forHost in interface ClusterGroupnode - Node to select the host for.public final ClusterGroup forHost(String host, String... hosts)
forHost in interface ClusterGrouphost - Host name to get nodes to put in clusterhosts - Host names to get nodes to put in cluster.public final ClusterGroup forDaemons()
Daemon nodes are the usual grid nodes that participate in topology but not visible on the main APIs, i.e. they are not part of any cluster group. The only way to see daemon nodes is to use this method.
Daemon nodes are used primarily for management and monitoring functionality that is build on Ignite and needs to participate in the topology, but also needs to be excluded from the "normal" topology, so that it won't participate in the task execution or in-memory data grid storage.
forDaemons in interface ClusterGrouppublic final ClusterGroup forRandom()
forRandom in interface ClusterGrouppublic ClusterGroup forOldest()
Use ClusterGroup.node() method to get the oldest node.
forOldest in interface ClusterGrouppublic ClusterGroup forYoungest()
forYoungest in interface ClusterGrouppublic ClusterGroupEx forSubjectId(UUID subjId)
forSubjectId in interface ClusterGroupExsubjId - Subject ID.protected final org.apache.ignite.internal.cluster.ClusterGroupAdapter.ClusterGroupState ensureLastTopologyState()
protected org.apache.ignite.internal.cluster.ClusterGroupAdapter.ClusterGroupState resetState()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - Thrown in case of unmarshalling error.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020