public class GridProjectionAdapter extends GridMetadataAwareAdapter implements GridProjectionEx, Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected GridKernalContext |
ctx |
| Modifier | Constructor and Description |
|---|---|
|
GridProjectionAdapter()
Required by
Externalizable. |
protected |
GridProjectionAdapter(GridProjection parent,
GridKernalContext ctx,
UUID subjId,
GridPredicate<GridNode> p) |
protected |
GridProjectionAdapter(GridProjection parent,
GridKernalContext ctx,
UUID subjId,
Set<UUID> ids) |
| Modifier and Type | Method and Description |
|---|---|
GridCompute |
compute()
Gets
compute functionality over this grid projection. |
GridEvents |
events()
Gets
events functionality over this grid projection. |
GridProjection |
forAttribute(String name,
String val)
Creates projection for nodes containing given name and value
specified in user attributes.
|
GridProjection |
forCache(String cacheName,
String... cacheNames)
Creates projection for all nodes that have cache with specified name running.
|
GridProjection |
forDaemons()
Gets projection consisting from the daemon nodes in this projection.
|
GridProjection |
forHost(GridNode node)
Gets grid projection consisting from the nodes in this projection residing on the
same host as given node.
|
GridProjection |
forNode(GridNode node,
GridNode... nodes)
Creates a grid projection for the given node.
|
GridProjection |
forNodeId(UUID id,
UUID... ids)
Creates a grid projection for a node with specified ID.
|
GridProjection |
forNodeIds(Collection<UUID> ids)
Creates a grid projection over nodes with specified node IDs.
|
GridProjection |
forNodes(Collection<? extends GridNode> nodes)
Creates a grid projection over a given set of nodes.
|
GridProjection |
forOthers(GridNode node,
GridNode... nodes)
Creates a grid projection for nodes other than given nodes.
|
GridProjection |
forOthers(GridProjection prj)
Creates a grid projection for nodes not included into given projection.
|
GridProjection |
forPredicate(GridPredicate<GridNode> p)
Creates a grid projection which includes all nodes that pass the given predicate filter.
|
GridProjection |
forRandom()
Creates grid projection with one random node from current projection.
|
GridProjection |
forRemotes()
Gets grid projection consisting from the nodes in this projection excluding the local node.
|
GridProjection |
forStreamer(String streamerName,
String... streamerNames)
Creates projection for all nodes that have streamer with specified name running.
|
GridProjectionEx |
forSubjectId(UUID subjId)
Creates projection for specified subject ID.
|
Grid |
grid()
Gets instance of grid.
|
protected void |
guard()
ctx.gateway().readLock()
|
protected void |
lightCheck()
ctx.gateway().lightCheck()
|
GridMessaging |
message()
Gets
messaging functionality over this grid projection. |
GridProjectionMetrics |
metrics()
Gets a metrics snapshot for this projection.
|
GridNode |
node()
Gets first node from the list of nodes in this projection.
|
GridNode |
node(UUID id)
Gets a node for given ID from this grid projection.
|
Collection<GridNode> |
nodes()
Gets read-only collections of nodes in this projection.
|
GridPredicate<GridNode> |
predicate()
Gets predicate that defines a subset of nodes for this projection.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on demarshalling.
|
protected void |
setKernalContext(GridKernalContext ctx)
Sets kernal context.
|
protected void |
unguard()
ctx.gateway().readUnlock()
|
void |
writeExternal(ObjectOutput out) |
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetaprotected transient GridKernalContext ctx
public GridProjectionAdapter()
Externalizable.protected GridProjectionAdapter(@Nullable GridProjection parent, @Nullable GridKernalContext ctx, @Nullable UUID subjId, @Nullable GridPredicate<GridNode> p)
parent - Parent of this projection.ctx - Grid kernal context.p - Predicate.protected GridProjectionAdapter(@Nullable GridProjection parent, @Nullable GridKernalContext ctx, @Nullable UUID subjId, Set<UUID> ids)
parent - Parent of this projection.ctx - Grid kernal context.ids - Node IDs.protected void guard()
protected void unguard()
protected void lightCheck()
protected void setKernalContext(GridKernalContext ctx)
ctx - Kernal context to set.public final Grid grid()
grid in interface GridProjectionpublic final GridCompute compute()
compute functionality over this grid projection. All operations
on the returned GridCompute instance will only include nodes from
this projection.compute in interface GridProjectionpublic final GridMessaging message()
messaging functionality over this grid projection. All operations
on the returned GridMessaging instance will only include nodes from
this projection.message in interface GridProjectionpublic final GridEvents events()
events functionality over this grid projection. All operations
on the returned GridEvents instance will only include nodes from
this projection.events in interface GridProjectionpublic final GridProjectionMetrics metrics() throws GridException
metrics in interface GridProjectionGridException - If projection is empty.public final Collection<GridNode> nodes()
nodes in interface GridProjectionpublic final GridNode node(UUID id)
node in interface GridProjectionid - Node ID.null if such node does not exist in this
projection.public GridNode node()
node in interface GridProjectionnull if projection is empty.public final GridPredicate<GridNode> predicate()
predicate in interface GridProjectionpublic final GridProjection forPredicate(GridPredicate<GridNode> p)
forPredicate in interface GridProjectionp - Predicate filter for nodes to include into this projection.public final GridProjection forAttribute(String name, @Nullable String val)
User attributes for every node are optional and can be specified in
grid node configuration. See GridConfiguration.getUserAttributes()
for more information.
forAttribute in interface GridProjectionname - Name of the attribute.val - Optional attribute value to match.public final GridProjection forNode(GridNode node, GridNode... nodes)
forNode in interface GridProjectionnode - Node to get projection for.nodes - Optional additional nodes to include into projection.public final GridProjection forNodes(Collection<? extends GridNode> nodes)
forNodes in interface GridProjectionnodes - Collection of nodes to create a projection from.public final GridProjection forNodeId(UUID id, UUID... ids)
forNodeId in interface GridProjectionid - Node ID to get projection for.ids - Optional additional node IDs to include into projection.public final GridProjection forNodeIds(Collection<UUID> ids)
forNodeIds in interface GridProjectionids - Collection of node IDs.public final GridProjection forOthers(GridNode node, GridNode... nodes)
forOthers in interface GridProjectionnode - Node to exclude from new grid projection.nodes - Optional additional nodes to exclude from projection.public GridProjection forOthers(GridProjection prj)
forOthers in interface GridProjectionprj - Projection to exclude from new grid projection.public final GridProjection forRemotes()
forRemotes in interface GridProjectionpublic final GridProjection forCache(@Nullable String cacheName, @Nullable String... cacheNames)
forCache in interface GridProjectioncacheName - Cache name.cacheNames - Optional additional cache names to include into projection.public final GridProjection forStreamer(@Nullable String streamerName, @Nullable String... streamerNames)
forStreamer in interface GridProjectionstreamerName - Streamer name.streamerNames - Optional additional streamer names to include into projection.public final GridProjection forHost(GridNode node)
forHost in interface GridProjectionnode - Node residing on the host for which projection is created.public final GridProjection 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 GridGain 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 GridProjectionpublic final GridProjection forRandom()
forRandom in interface GridProjectionpublic GridProjectionEx forSubjectId(UUID subjId)
forSubjectId in interface GridProjectionExsubjId - 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 demarshalling error.Copyright © 2014. All rights reserved.