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.
|
| Modifier | Constructor and Description |
|---|---|
|
ClusterGroupAdapter()
Required by
Externalizable. |
protected |
ClusterGroupAdapter(GridKernalContext ctx,
UUID subjId,
IgnitePredicate<ClusterNode> p) |
protected |
ClusterGroupAdapter(GridKernalContext ctx,
UUID subjId,
Set<UUID> ids) |
| Modifier and Type | Method and Description |
|---|---|
IgniteCompute |
compute() |
IgniteEvents |
events() |
ExecutorService |
executorService() |
ClusterGroup |
forAttribute(String name,
String val)
Creates projection for nodes containing given name and value
specified in user attributes.
|
ClusterGroup |
forCacheNodes(String cacheName)
Creates projection for all nodes that have cache with specified name running.
|
ClusterGroup |
forCacheNodes(String cacheName,
Set<CacheDistributionMode> distributionModes) |
ClusterGroup |
forClientNodes(String cacheName)
Creates projection for all nodes that have cache with specified name running and cache distribution mode is
CacheDistributionMode.CLIENT_ONLY or CacheDistributionMode.NEAR_ONLY. |
ClusterGroup |
forDaemons()
Gets projection consisting from the daemon nodes in this projection.
|
ClusterGroup |
forDataNodes(String cacheName)
Creates projection for all nodes that have cache with specified name running and cache distribution mode is
CacheDistributionMode.PARTITIONED_ONLY or CacheDistributionMode.NEAR_PARTITIONED. |
ClusterGroup |
forHost(ClusterNode node)
Gets grid projection consisting from the nodes in this projection residing on the
same host as given node.
|
ClusterGroup |
forNode(ClusterNode node,
ClusterNode... nodes)
Creates a grid projection for the given node.
|
ClusterGroup |
forNodeId(UUID id,
UUID... ids)
Creates a grid projection for a node with specified ID.
|
ClusterGroup |
forNodeIds(Collection<UUID> ids)
Creates a grid projection over nodes with specified node IDs.
|
ClusterGroup |
forNodes(Collection<? extends ClusterNode> nodes)
Creates a grid projection over a given set of nodes.
|
ClusterGroup |
forOldest()
Creates grid projection with one oldest node in the current projection.
|
ClusterGroup |
forOthers(ClusterGroup grp)
Creates a grid projection for nodes not included into given projection.
|
ClusterGroup |
forOthers(ClusterNode node,
ClusterNode... nodes)
Creates a grid projection for nodes other than given nodes.
|
ClusterGroup |
forPredicate(IgnitePredicate<ClusterNode> p)
Creates a grid projection which includes all nodes that pass the given predicate filter.
|
ClusterGroup |
forRandom()
Creates grid projection with one random node from current projection.
|
ClusterGroup |
forRemotes()
Gets grid projection consisting from the nodes in this projection excluding the local node.
|
ClusterGroup |
forStreamer(String streamerName,
String... streamerNames)
Creates projection for all nodes that have streamer with specified name running.
|
ClusterGroupEx |
forSubjectId(UUID subjId)
Creates projection for specified subject ID.
|
ClusterGroup |
forYoungest()
Creates grid projection with one youngest node in the current projection.
|
protected void |
guard()
ctx.gateway().readLock()
|
Ignite |
ignite()
Gets instance of grid.
|
IgniteMessaging |
message() |
ClusterMetrics |
metrics()
Gets a metrics snapshot for this projection.
|
ClusterNode |
node()
Gets first node from the list of nodes in this projection.
|
ClusterNode |
node(UUID id)
Gets a node for given ID from this grid projection.
|
Collection<ClusterNode> |
nodes()
Gets read-only collections of nodes in this projection.
|
IgnitePredicate<ClusterNode> |
predicate()
Gets predicate that defines a subset of nodes for this projection.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on unmarshalling.
|
IgniteServices |
services() |
void |
setKernalContext(GridKernalContext ctx)
Sets kernal context.
|
protected void |
unguard()
ctx.gateway().readUnlock()
|
void |
writeExternal(ObjectOutput out) |
protected transient GridKernalContext ctx
protected IgnitePredicate<ClusterNode> p
public ClusterGroupAdapter()
Externalizable.protected ClusterGroupAdapter(@Nullable GridKernalContext ctx, @Nullable UUID subjId, @Nullable IgnitePredicate<ClusterNode> p)
subjId - Subject ID.ctx - Kernal context.p - Predicate.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 ClusterGrouppublic final ClusterNode node(UUID id)
node in interface ClusterGroupid - Node ID.null if such node does not exist in this
projection.public ClusterNode node()
node in interface ClusterGroupnull if projection is empty.public final IgnitePredicate<ClusterNode> predicate()
predicate in interface ClusterGrouppublic final ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p)
forPredicate in interface ClusterGroupp - Predicate filter for nodes to include into this projection.public final ClusterGroup forAttribute(String name, @Nullable String 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 final ClusterGroup forNode(ClusterNode node, ClusterNode... nodes)
forNode in interface ClusterGroupnode - Node to get projection for.nodes - Optional additional nodes to include into projection.public final ClusterGroup forNodes(Collection<? extends ClusterNode> nodes)
forNodes in interface ClusterGroupnodes - Collection of nodes to create a projection from.public final ClusterGroup forNodeId(UUID id, UUID... ids)
forNodeId in interface ClusterGroupid - Node ID to get projection for.ids - Optional additional node IDs to include into projection.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 new grid projection.nodes - Optional additional nodes to exclude from projection.public ClusterGroup forOthers(ClusterGroup grp)
forOthers in interface ClusterGroupgrp - Projection to exclude from new grid projection.public final ClusterGroup forRemotes()
forRemotes in interface ClusterGrouppublic final ClusterGroup forCacheNodes(@Nullable String cacheName)
forCacheNodes in interface ClusterGroupcacheName - Cache name.public final ClusterGroup forDataNodes(@Nullable String cacheName)
CacheDistributionMode.PARTITIONED_ONLY or CacheDistributionMode.NEAR_PARTITIONED.forDataNodes in interface ClusterGroupcacheName - Cache name.CacheConfiguration.getDistributionMode()public final ClusterGroup forClientNodes(@Nullable String cacheName)
CacheDistributionMode.CLIENT_ONLY or CacheDistributionMode.NEAR_ONLY.forClientNodes in interface ClusterGroupcacheName - Cache name.CacheConfiguration.getDistributionMode()public final ClusterGroup forStreamer(@Nullable String streamerName, @Nullable String... streamerNames)
forStreamer in interface ClusterGroupstreamerName - Streamer name.streamerNames - Optional additional streamer names to include into projection.public ClusterGroup forCacheNodes(@Nullable String cacheName, Set<CacheDistributionMode> distributionModes)
forCacheNodes in interface ClusterGroupExcacheName - Cache name.distributionModes - Cache distribution modes.public final ClusterGroup forHost(ClusterNode node)
forHost in interface ClusterGroupnode - Node residing on the host for which projection is created.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 projections. 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 "normal" topology so that it won't participate in task execution or in-memory data grid storage.
forDaemons in interface ClusterGrouppublic final ClusterGroup forRandom()
forRandom in interface ClusterGrouppublic ClusterGroup forOldest()
forOldest in interface ClusterGrouppublic ClusterGroup forYoungest()
forYoungest in interface ClusterGrouppublic ClusterGroupEx forSubjectId(UUID subjId)
forSubjectId in interface ClusterGroupExsubjId - Subject ID.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 Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015