|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GridProjection
Defines grid projection interface and monadic set of operations on a set of grid nodes.
All main grid entities such as grid and a node instances can be viewed as
collection of grid nodes (in case of the grid node this collection consist of only one
element). As such they all share the same set of operations that can be performed on a set
grid nodes. These operations are defined in GridProjection interface and called
monadic as they are equally defined on any arbitrary set of nodes.
null values is Java's way to support such monadic invocations.
All methods that accept null values (for monadic purposes) will gracefully handle it by
either returning a finished future, or empty collection, null value, or combination of the
above. Most method calls therefore can be chained without an explicit checks for nulls.
The downside of this approach that inadvertent errors of passing null will not result
in NullPointerException and may be harder to catch.
| Wiki | |
| Forum |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Method Summary | ||
|---|---|---|
|
affinityCall(String cacheName,
Collection<?> affKeys,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the nodes where data for provided affinity keys are located. |
|
|
affinityCall(String cacheName,
Object affKey,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the node where data for provided affinity key is located. |
|
|
affinityCallAsync(String cacheName,
Collection<?> affKeys,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the nodes where data for provided affinity keys are located. |
|
|
affinityCallAsync(String cacheName,
Object affKey,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the node where data for provided affinity key is located. |
|
void |
affinityRun(String cacheName,
Collection<?> affKeys,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the nodes where data for provided affinity keys are located. |
|
void |
affinityRun(String cacheName,
Object affKey,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the node where data for provided affinity key is located. |
|
GridFuture<?> |
affinityRunAsync(String cacheName,
Collection<?> affKeys,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the nodes where data for provided affinity keys are located. |
|
GridFuture<?> |
affinityRunAsync(String cacheName,
Object affKey,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on the node where data for provided affinity key is located. |
|
|
call(GridClosureCallMode mode,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on this projection. |
|
|
call(GridClosureCallMode mode,
Collection<? extends Callable<R>> jobs,
GridPredicate<? super GridRichNode>... p)
Executes given closures on this projection. |
|
|
call(GridClosureCallMode mode,
Collection<? extends GridClosure<? super T,R>> jobs,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
call(GridClosureCallMode mode,
GridClosure<? super T,R> job,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
call(GridClosureCallMode mode,
GridClosure<? super T,R> job,
GridOutClosure<T> pdc,
int cnt,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given distribution mode. |
|
|
call(GridClosureCallMode mode,
GridClosure<? super T,R> job,
T arg,
GridPredicate<? super GridRichNode>... p)
Runs job producing result with given argument on this projection using given distribution mode. |
|
|
call(GridMapper<Callable<R>,GridRichNode> mapper,
Collection<? extends Callable<R>> jobs,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs producing result on this projection using given mapper to map jobs to nodes. |
|
|
callAsync(GridClosureCallMode mode,
Callable<R> job,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given closure on this projection. |
|
|
callAsync(GridClosureCallMode mode,
Collection<? extends Callable<R>> jobs,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given closures on this projection. |
|
|
callAsync(GridClosureCallMode mode,
Collection<? extends GridClosure<? super T,R>> jobs,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
callAsync(GridClosureCallMode mode,
GridClosure<? super T,R> job,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
callAsync(GridClosureCallMode mode,
GridClosure<? super T,R> job,
GridOutClosure<T> pdc,
int cnt,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given distribution mode. |
|
|
callAsync(GridClosureCallMode mode,
GridClosure<? super T,R> job,
T arg,
GridPredicate<? super GridRichNode>... p)
Runs job producing result with given argument on this projection using given distribution mode. |
|
|
callAsync(GridMapper<Callable<R>,GridRichNode> mapper,
Collection<? extends Callable<R>> jobs,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs producing result on this projection using given mapper to map jobs to nodes. |
|
|
callOptimistic(GridOutClosure<R> c,
int attempts,
R dfltVal,
GridAbsClosure rollback,
GridPredicate<? super GridRichNode>... p)
Executes given closure in optimistic topology transaction, i.e. ensuring that grid topology doesn't change during the closure execution. |
|
|
callOptimisticAsync(GridOutClosure<R> c,
int attempts,
R dfltVal,
GridAbsClosure rollback,
GridPredicate<? super GridRichNode>... p)
Executes given closure locally in optimistic topology transaction, i.e. ensuring that grid topology doesn't change during the closure execution. |
|
boolean |
contains(GridNode node,
GridPredicate<? super GridRichNode>... p)
Tests whether or not this optionally filtered projection contains given node. |
|
boolean |
contains(UUID nid,
GridPredicate<? super GridRichNode>... p)
Tests whether or not this optionally filtered projection contains a node with given node ID. |
|
int |
cpus()
Gets total number of CPUs for the nodes in this projection. |
|
GridProjection |
cross(Collection<? extends GridNode> nodes)
Creates cross product of this projection and a set of nodes. |
|
GridProjection |
cross(GridProjection... prjs)
Creates cross product of this projection and given projections. |
|
GridProjection |
cross0(GridRichNode... nodes)
Creates cross product of this projection and a set of nodes. |
|
Collection<GridRichNode> |
daemonNodes(GridPredicate<? super GridRichNode>... p)
Gets collection of daemon nodes in this projection. |
|
boolean |
dynamic()
Tells whether or not this projection is dynamic. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
long timeout,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
execute(String taskName,
T arg,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(String taskName,
T arg,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
execute(String taskName,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Executes a task on the grid. |
|
|
execute(String taskName,
T arg,
long timeout,
GridTaskListener lsnr,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes a task on the grid. |
|
|
executeSync(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Companion to GridProjection.execute(Class, Object, GridPredicate[]) this method executes given
task synchronously. |
|
|
executeSync(GridTask<T,R> task,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Companion to GridProjection.execute(Class, Object, GridPredicate[]) this method
executes given task synchronously. |
|
|
executeSync(String taskName,
T arg,
long timeout,
GridPredicate<? super GridRichNode>... p)
Companion to GridProjection.execute(String, Object, GridPredicate[]) this method executes given task synchronously. |
|
ExecutorService |
executor(GridPredicate<? super GridRichNode>... p)
Creates new ExecutorService which will execute all submitted
Callable and Runnable tasks on this projection. |
|
Grid |
grid()
Gets grid instance associated with this projection. |
|
|
gridify(GridClosureCallMode mode,
Callable<T> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
GridOutClosure<GridFuture<Boolean>> |
gridify(GridClosureCallMode mode,
GridAbsPredicate c,
GridPredicate<? super GridRichNode>... p)
Curries given predicate into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridClosure<E,T> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridClosure2<E1,E2,T> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridClosure3<E1,E2,E3,T> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridInClosure<E> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridInClosure2<E1,E2> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridInClosure3<E1,E2,E3> c,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridPredicate<E> c,
GridPredicate<? super GridRichNode>... p)
Curries given predicate into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridPredicate2<E1,E2> c,
GridPredicate<? super GridRichNode>... p)
Curries given predicate into distribution version of it. |
|
|
gridify(GridClosureCallMode mode,
GridPredicate3<E1,E2,E3> c,
GridPredicate<? super GridRichNode>... p)
Curries given predicate into distribution version of it. |
|
GridOutClosure<GridFuture<?>> |
gridify(GridClosureCallMode mode,
Runnable r,
GridPredicate<? super GridRichNode>... p)
Curries given closure into distribution version of it. |
|
boolean |
hasLocalNode()
Tests whether or not this projection has local node in it. |
|
boolean |
hasRemoteNodes()
Tests whether or not this projection has any remote nodes. |
|
int |
hosts()
Gets number of unique hosts for nodes in this projection. |
|
boolean |
isEmpty()
Tests whether this projection has any nodes in it. |
|
boolean |
isEmptyFor(GridPredicate<? super GridRichNode>... p)
Tests whether this optionally filtered projection has any nodes in it. |
|
|
listen(GridPredicate2<UUID,? super T>... p)
Convenient utility listening method for messages from the nodes in this projection. |
|
|
mapKeysToNodes(Collection<? extends K> keys)
This method provides ability to detect which cache keys are mapped to which nodes on default unnamed cache instance. |
|
|
mapKeysToNodes(String cacheName,
Collection<? extends K> keys)
This method provides ability to detect which cache keys are mapped to which nodes on cache instance with given name. |
|
|
mapKeyToNode(K key)
This method provides ability to detect which keys are mapped to which nodes on default unnamed cache instance. |
|
|
mapKeyToNode(String cacheName,
K key)
This method provides ability to detect which cache keys are mapped to which nodes on cache instance with given name. |
|
|
mapreduce(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
Collection<? extends GridClosure<? super T,R1>> jobs,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given mapper to map jobs to nodes and then reduces job results to a single execution result using provided reducer. |
|
|
mapreduce(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
GridClosure<? super T,R1> job,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given mapper to map job executions to nodes. |
|
|
mapreduce(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
GridClosure<? super T,R1> job,
GridOutClosure<T> pdc,
int cnt,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given mapper to map job executions to nodes. |
|
|
mapreduce(GridMapper<T,GridRichNode> mapper,
Collection<T> jobs,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Executes given jobs on this projection with custom mapping and reducing logic. |
|
|
mapreduceAsync(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
Collection<? extends GridClosure<? super T,R1>> jobs,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given mapper to map jobs to nodes and then reduces job results to a single execution result using provided reducer. |
|
|
mapreduceAsync(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
GridClosure<? super T,R1> job,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given mapper to map job executions to nodes. |
|
|
mapreduceAsync(GridMapper<GridOutClosure<R1>,GridRichNode> mapper,
GridClosure<? super T,R1> job,
GridOutClosure<T> pdc,
int cnt,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given mapper to map job executions to nodes. |
|
|
mapreduceAsync(GridMapper<T,GridRichNode> mapper,
Collection<T> jobs,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given jobs on this projection with custom mapping and reducing logic. |
|
GridProjection |
merge(GridProjection... prjs)
Merges this projection with the optional set of passed in projections. |
|
Collection<GridProjection> |
neighborhood()
Gets collections of neighbors from this projection. |
|
GridRichNode |
node(UUID nid,
GridPredicate<? super GridRichNode>... p)
Gets a node for given ID from this optionally filtered projection. |
|
Collection<GridRichNode> |
nodeId8(String id8)
Gets collection of nodes for given node ID8. |
|
Collection<GridRichNode> |
nodes(Collection<UUID> ids)
Gets collection of grid nodes for given node IDs out of this projection. |
|
Collection<GridRichNode> |
nodes(GridPredicate<? super GridRichNode>... p)
Gets read-only collections of nodes in this projection that evaluate to true for all
given predicates. |
|
GridRichNode |
oldest()
Gets the oldest node in this topology. |
|
GridRichNode |
oldestx()
Gets the oldest node in this topology. |
|
GridProjection |
parent()
Gets parent projection or null if this project is an instance of Grid interface, i.e. |
|
GridPredicate<GridRichNode> |
predicate()
Gets predicate that defines a subset of nodes for this projection at the time of the call. |
|
GridProjection |
projectionForAttribute(String n,
String v)
Creates monadic projection with the nodes from this projection that have given node attribute with optional value. |
|
GridProjection |
projectionForCaches(String cacheName,
String... cacheNames)
Creates monadic projection with the nodes from this projection that have configured caches with given names. |
|
GridProjection |
projectionForNodeIds(Collection<UUID> ids)
Creates monadic projection with a given set of node IDs out of this projection. |
|
GridProjection |
projectionForNodeIds(UUID... ids)
Creates monadic projection with a given set of node IDs ouf of this projection. |
|
GridProjection |
projectionForNodes(Collection<? extends GridNode> nodes)
Creates monadic projection with a given set of nodes out of this projection. |
|
GridProjection |
projectionForNodes(GridRichNode... nodes)
Creates monadic projection with a given set of nodes out of this projection. |
|
GridProjection |
projectionForPredicate(GridPredicate<? super GridRichNode>... p)
Creates monadic projection with the nodes from this projection that also satisfy given set of predicates. |
|
GridProjectionMetrics |
projectionMetrics()
Gets a metrics snapshot for this projection. |
|
GridRichNode |
random()
Gets the randomly selected node from this projection. |
|
GridRichNode |
randomx()
Gets the randomly selected node from this projection. |
|
|
reduce(GridClosureCallMode mode,
Collection<? extends Callable<R1>> jobs,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Executes given jobs on this projection. |
|
|
reduce(GridClosureCallMode mode,
Collection<? extends GridClosure<? super T,R1>> jobs,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given distribution mode and then reduces job results to a single execution result using provided reducer. |
|
|
reduce(GridClosureCallMode mode,
GridClosure<? super T,R1> job,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
reduce(GridClosureCallMode mode,
GridClosure<? super T,R1> job,
GridOutClosure<T> pdc,
int cnt,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given distribution mode. |
|
|
reduceAsync(GridClosureCallMode mode,
Collection<? extends Callable<R1>> jobs,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given jobs on this projection. |
|
|
reduceAsync(GridClosureCallMode mode,
Collection<? extends GridClosure<? super T,R1>> jobs,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument and producing result on this projection with given collection of arguments using given distribution mode and then reduces job results to a single execution result using provided reducer. |
|
|
reduceAsync(GridClosureCallMode mode,
GridClosure<? super T,R1> job,
Collection<? extends T> args,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given collection of arguments using given distribution mode. |
|
|
reduceAsync(GridClosureCallMode mode,
GridClosure<? super T,R1> job,
GridOutClosure<T> pdc,
int cnt,
GridReducer<R1,R2> rdc,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument and producing result on this projection with given producer of arguments using given distribution mode. |
|
List<GridEvent> |
remoteEvents(GridPredicate<? super GridEvent> pe,
long timeout,
GridPredicate<? super GridRichNode>... pn)
Queries nodes in this projection for events using passed in predicate filter for event selection. |
|
GridFuture<List<GridEvent>> |
remoteEventsAsync(GridPredicate<? super GridEvent> pe,
long timeout,
GridPredicate<? super GridRichNode>... pn)
Asynchronously queries nodes in this projection for events using passed in predicate filter for event selection. |
|
|
remoteListenAsync(Collection<? extends GridNode> nodes,
GridPredicate2<UUID,? super T>... p)
Registers given message listeners on all nodes defined by this projection to listen for messages sent from the given nodes. |
|
|
remoteListenAsync(GridNode node,
GridPredicate2<UUID,? super T>... p)
Registers given message listeners on all nodes defined by this projection to listen for messages sent from the given node. |
|
|
remoteListenAsync(GridPredicate<? super GridRichNode> pn,
GridPredicate2<UUID,? super T>... p)
Registers given message listeners on all nodes defined by this projection to listen for messages sent from the nodes defined via predicate. |
|
Collection<GridRichNode> |
remoteNodes(GridPredicate<? super GridRichNode>... p)
Gets read-only collections of nodes from this projection excluding local node, if any. |
|
GridProjection |
remoteProjection(GridPredicate<? super GridRichNode>... p)
Gets monadic projection consisting from the nodes in this projection excluding the local node, if any. |
|
void |
restartNodes(Collection<UUID> ids)
Restarts nodes defined by provided IDs. |
|
void |
restartNodes(GridPredicate<? super GridRichNode>... p)
Restarts nodes satisfying optional set of predicates. |
|
void |
restartNodes(UUID id,
UUID... ids)
Restarts nodes defined by provided IDs. |
|
|
run(GridClosureCallMode mode,
Collection<? extends GridInClosure<? super T>> jobs,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument on this projection with given collection of arguments using given distribution mode. |
|
void |
run(GridClosureCallMode mode,
Collection<? extends Runnable> jobs,
GridPredicate<? super GridRichNode>... p)
Executes given closures on this projection. |
|
|
run(GridClosureCallMode mode,
GridInClosure<? super T> job,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument on this projection with given collection of arguments using given distribution mode. |
|
|
run(GridClosureCallMode mode,
GridInClosure<? super T> job,
GridOutClosure<T> pdc,
int cnt,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument on this projection with given producer of arguments using given distribution mode. |
|
|
run(GridClosureCallMode mode,
GridInClosure<? super T> job,
T arg,
GridPredicate<? super GridRichNode>... p)
Runs job that doesn't produce any result with given argument on this projection using given distribution mode. |
|
void |
run(GridClosureCallMode mode,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Executes given closure on this projection. |
|
void |
run(GridMapper<Runnable,GridRichNode> mapper,
Collection<? extends Runnable> jobs,
GridPredicate<? super GridRichNode>... p)
Executes collections of closures using given mapper on this projection. |
|
|
runAsync(GridClosureCallMode mode,
Collection<? extends GridInClosure<? super T>> jobs,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs given collection of jobs taking argument on this projection with given collection of arguments using given distribution mode. |
|
GridFuture<?> |
runAsync(GridClosureCallMode mode,
Collection<? extends Runnable> jobs,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given closures on this projection. |
|
|
runAsync(GridClosureCallMode mode,
GridInClosure<? super T> job,
Collection<? extends T> args,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument on this projection with given collection of arguments using given distribution mode. |
|
|
runAsync(GridClosureCallMode mode,
GridInClosure<? super T> job,
GridOutClosure<T> pdc,
int cnt,
GridPredicate<? super GridRichNode>... p)
Runs job taking argument on this projection with given producer of arguments using given distribution mode. |
|
|
runAsync(GridClosureCallMode mode,
GridInClosure<? super T> job,
T arg,
GridPredicate<? super GridRichNode>... p)
Runs job that doesn't produce any result with given argument on this projection using given distribution mode. |
|
GridFuture<?> |
runAsync(GridClosureCallMode mode,
Runnable job,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes given closure on this projection. |
|
GridFuture<?> |
runAsync(GridMapper<Runnable,GridRichNode> mapper,
Collection<? extends Runnable> jobs,
GridPredicate<? super GridRichNode>... p)
Asynchronously executes collections of closures using given mapper on this projection. |
|
boolean |
runOptimistic(GridAbsClosure c,
int attempts,
GridAbsClosure rollback,
GridPredicate<? super GridRichNode>... p)
Executes given closure locally in optimistic topology transaction, i.e. ensuring that projection topology doesn't change during the closure execution. |
|
GridFuture<Boolean> |
runOptimisticAsync(GridAbsClosure c,
int attempts,
GridAbsClosure rollback,
GridPredicate<? super GridRichNode>... p)
Executes given closure in optimistic topology transaction, i.e. ensuring that grid topology doesn't change during the closure execution. |
|
void |
send(Collection<?> msgs,
GridPredicate<? super GridRichNode>... p)
Sends given messages to the nodes in this projection. |
|
void |
send(Object msg,
GridPredicate<? super GridRichNode>... p)
Sends given message to the nodes in this projection. |
|
int |
size(GridPredicate<? super GridRichNode>... p)
Gets number of nodes currently in this projection and satisfying optional set of predicates. |
|
GridPair<GridProjection> |
split(GridPredicate<? super GridRichNode>... p)
Splits this projection into two: first will have nodes that evaluate to true for all
given predicates, second will have the remaining nodes. |
|
Collection<GridTuple3<String,Boolean,String>> |
startNodes(Collection<String> hostSpecs,
String dfltUname,
String dfltPasswd,
File key,
int nodes,
String ggHome,
String cfg,
String script,
String log,
boolean restart)
Starts one or more nodes on remote host(s) defined by collection of host specifications. |
|
Collection<GridTuple3<String,Boolean,String>> |
startNodes(File file,
String dfltUname,
String dfltPasswd,
File key,
int nodes,
String ggHome,
String cfg,
String script,
String log,
boolean restart)
Starts one or more nodes on remote host(s) defined by file with host specifications (one specification per line). |
|
void |
stopNodes(Collection<UUID> ids)
Stops nodes defined by provided IDs. |
|
void |
stopNodes(GridPredicate<? super GridRichNode>... p)
Stops nodes satisfying optional set of predicates. |
|
void |
stopNodes(UUID id,
UUID... ids)
Stops nodes defined by provided IDs. |
|
long |
topologyHash(GridPredicate<? super GridRichNode>... p)
This method calculates hash value of the given set of nodes (a topology). |
|
GridProjection |
withCheckpointSpi(String spiName)
Sets checkpoint SPI for the next executed task on this projection in the current thread. |
|
GridProjection |
withFailoverSpi(String spiName)
Sets failover SPI for the next executed task on this projection in the current thread. |
|
GridProjection |
withLoadBalancingSpi(String spiName)
Sets load balancing SPI for the next executed task on this projection in the current thread. |
|
GridProjection |
withName(String taskName)
Sets task name for the next executed task on this projection in the current thread. |
|
GridProjection |
withResultClosure(GridClosure2X<GridJobResult,List<GridJobResult>,GridJobResultPolicy> res)
Sets custom ad-hoc implementation for GridTask.result(GridJobResult, List) method for the
next executed closure on this projection in the current thread. |
|
GridProjection |
withTopologySpi(String spiName)
Sets topology SPI for the next executed task on this projection in the current thread. |
|
GridRichNode |
youngest()
Gets the youngest node in this topology. |
|
GridRichNode |
youngestx()
Gets the youngest node in this topology. |
|
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.gridgain.grid.GridMetadataAware |
|---|
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta |
| Method Detail |
|---|
boolean runOptimistic(GridAbsClosure c,
int attempts,
@Nullable
GridAbsClosure rollback,
@Nullable
GridPredicate<? super GridRichNode>... p)
Note that this method will block until closure execution is complete (successfully or not). Note also that transactional semantic of this method is optimistic. No locking of grid topology is performed but the topology version is checked before and after the closure execution and compared to be the same.
Note also that if given closure or rollback closure throw runtime exception it will be propagated to the caller without any special handling. Specifically, a rollback closure won't be called if the executing closure throws runtime exception.
c - Closure to execute on unchanged topology.attempts - Number of re-execution attempts. Must be greater than zero.rollback - Optional rollback closure to execute in case when topology did indeed change during
closure execution. If not provided - the given closure will simply execute again.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
True if closure successfully executed on unchanged topology - false if number
of attempts is exceeded.GridProjection.runOptimisticAsync(GridAbsClosure, int, GridAbsClosure, GridPredicate[])<R> R callOptimistic(GridOutClosure<R> c, int attempts, R dfltVal, @Nullable GridAbsClosure rollback, @Nullable GridPredicate<? super GridRichNode>... p)
Note that this method will block until closure execution is complete (successfully or not). Note also that transactional semantic of this method is optimistic. No locking of grid topology is performed but the topology version is checked before and after the closure execution and compared to be the same.
Note also that if given closure or rollback closure throw runtime exception it will be propagated to the caller without any special handling. Specifically, a rollback closure won't be called if the executing closure throws runtime exception.
R - Type of the closure return value.c - Closure to execute on unchanged topology.attempts - Number of re-execution attempts. Must be greater than zero.dfltVal - Default to return when number of attempts is exceeded.rollback - Optional rollback closure to execute in case when topology did indeed change during
closure execution. If not provided - the given closure will simply execute again.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callOptimisticAsync(GridOutClosure, int, Object, GridAbsClosure, GridPredicate[])GridFuture<Boolean> runOptimisticAsync(GridAbsClosure c, int attempts, @Nullable GridAbsClosure rollback, @Nullable GridPredicate<? super GridRichNode>... p)
Note that this method will not block until closure execution is complete (successfully or not). Note also that transactional semantic of this method is optimistic. No locking of grid topology is performed but the topology version is checked before and after the closure execution and compared to be the same.
Note also that if given closure or rollback closure throw runtime exception it will be propagated to the caller without any special handling. Specifically, a rollback closure won't be called if the executing closure throws runtime exception.
c - Closure to execute on unchanged topology.attempts - Number of re-execution attempts. Must be greater than zero.rollback - Optional rollback closure to execute in case when topology did indeed change during
closure execution. If not provided - the given closure will simply execute again.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
true if closure successfully executed on unchanged
topology, or false if number of attempts is exceeded.GridProjection.runOptimistic(GridAbsClosure, int, GridAbsClosure, GridPredicate[])<R> GridFuture<R> callOptimisticAsync(GridOutClosure<R> c, int attempts, R dfltVal, @Nullable GridAbsClosure rollback, @Nullable GridPredicate<? super GridRichNode>... p)
Note that this method will not block until closure execution is complete (successfully or not). Note also that transactional semantic of this method is optimistic. No locking of grid topology is performed but the topology version is checked before and after the closure execution and compared to be the same.
Note also that if given closure or rollback closure throw runtime exception it will be propagated to the caller without any special handling. Specifically, a rollback closure won't be called if the executing closure throws runtime exception.
R - Type of the closure return value.c - Closure to execute on unchanged topology.attempts - Number of re-execution attempts. Must be greater than zero.dfltVal - Default to return when number of attempts is exceeded.rollback - Optional rollback closure to execute in case when topology did indeed change during
closure execution. If not provided - the given closure will simply execute again.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callOptimistic(GridOutClosure, int, Object, GridAbsClosure, GridPredicate[])
void affinityRun(String cacheName,
@Nullable
Object affKey,
@Nullable
Runnable job,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKey - Affinity key. If null - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.GridProjection.affinityRunAsync(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()
void affinityRun(String cacheName,
@Nullable
Collection<?> affKeys,
@Nullable
Runnable job,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
jobs that will be mapped to nodes
with provided affinity keys.
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKeys - Collection of affinity keys. All dups will be ignored. If null or empty
this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.GridProjection.affinityRunAsync(String, Collection, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()GridFuture<?> affinityRunAsync(String cacheName, @Nullable Object affKey, @Nullable Runnable job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
Unlike its sibling method GridProjection.affinityRun(String, Object, Runnable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKey - Affinity key. If null - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRun(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()GridFuture<?> affinityRunAsync(String cacheName, @Nullable Collection<?> affKeys, @Nullable Runnable job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
jobs that will be mapped to nodes
with provided affinity keys.
Unlike its sibling method GridProjection.affinityRun(String, Collection, Runnable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKeys - Collection of affinity keys. All dups will be ignored. If null or
empty - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRun(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()<R> R affinityCall(String cacheName, @Nullable Object affKey, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKey - Affinity key. If null - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null or empty - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRunAsync(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()<R> Collection<R> affinityCall(String cacheName, @Nullable Collection<?> affKeys, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
jobs that will be mapped to nodes
with provided affinity keys.
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKeys - Collection of affinity keys. All dups will be ignored. If null
or empty - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRunAsync(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()<R> GridFuture<R> affinityCallAsync(String cacheName, @Nullable Object affKey, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
Unlike its sibling method GridProjection.affinityCall(String, Object, Callable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException thrown if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKey - Affinity key. If null - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRunAsync(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()<R> GridFuture<Collection<R>> affinityCallAsync(String cacheName, @Nullable Collection<?> affKeys, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
jobs that will be mapped to nodes
with provided affinity keys.
Unlike its sibling method GridProjection.affinityCall(String, Object, Callable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.cacheName - Name of the cache to use for affinity co-location.affKeys - Collection of affinity keys. All dups will be ignored.
If null or empty - this method is no-op.job - Closure to affinity co-located on the node with given affinity key and execute.
If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.affinityRunAsync(String, Object, Runnable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String),
GridJobContext.cacheName(),
GridJobContext.affinityKey()
GridProjectionMetrics projectionMetrics()
throws GridException
GridException - If projection is empty.
GridNode.metrics()Collection<GridProjection> neighborhood()
Detection of the same physical computer (host) is based on comparing set of network interface MACs. If two nodes have the same set of MACs, GridGain considers these nodes running on the same physical computer. Note that this same logic is used in license management.
Knowing your neighbors can be very important when performing a dynamic split since nodes on the same computer will often bypass network when communicating with each other leading to much better performance for certain use cases. Conversely, one would like to avoid loading the nodes from the same physical computer with tasks as these nodes share CPU and memory between them resulting in reduced performance comparing to a no-neighboring split.
GridRichNode.neighbors(),
GridRichNode.neighborsAndMe()@Nullable GridRichNode youngest()
null if projection is
empty.GridProjection.youngestx()@Nullable GridRichNode oldest()
null if
projection is empty.GridProjection.oldestx()@Nullable GridRichNode random()
null if
projection is empty.GridProjection.randomx()
GridRichNode youngestx()
throws GridEmptyProjectionException
GridEmptyProjectionException - Thrown in case when projection is empty.
GridProjection.youngest()
GridRichNode oldestx()
throws GridEmptyProjectionException
GridEmptyProjectionException - Thrown in case when projection is empty.
GridProjection.oldest()
GridRichNode randomx()
throws GridEmptyProjectionException
GridEmptyProjectionException - Thrown in case when projection is empty.
GridProjection.random()int hosts()
Detection of the same physical computer (host) is based on comparing set of network interface MACs. If two nodes have the same set of MACs, GridGain considers these nodes running on the same physical computer. Note that this same logic is used in license management.
int cpus()
boolean dynamic()
Dynamic projection is based on predicate and in any particular moment of time can consist of a different set of nodes. Static project does not change and always consist of the same set of nodes (excluding the node that have left the topology since the creation of the static projection).
int size(@Nullable
GridPredicate<? super GridRichNode>... p)
p - Optional set of predicates. If none provided - all nodes in the projection
will count.
boolean hasRemoteNodes()
True if this projection does not have any remote nodes in it at the moment
of call, false otherwise.boolean hasLocalNode()
True if this projection does not have local node in it at the moment
of call, false otherwise.<T> GridOutClosure<GridFuture<T>> gridify(GridClosureCallMode mode, Callable<T> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
T - Type of the return value.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
GridOutClosure<GridFuture<?>> gridify(GridClosureCallMode mode, Runnable r, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
mode - Closure call mode with to curry given closure.r - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E,T> GridClosure<E,GridFuture<T>> gridify(GridClosureCallMode mode, GridClosure<E,T> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E - Type of the free variable.T - Type of the return value.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2,T> GridClosure2<E1,E2,GridFuture<T>> gridify(GridClosureCallMode mode, GridClosure2<E1,E2,T> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.T - Type of the return value.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2,E3,T> GridClosure3<E1,E2,E3,GridFuture<T>> gridify(GridClosureCallMode mode, GridClosure3<E1,E2,E3,T> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.E3 - Type of the third free variable.T - Type of the return value.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E> GridClosure<E,GridFuture<?>> gridify(GridClosureCallMode mode, GridInClosure<E> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E - Type of the free variable.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2> GridClosure2<E1,E2,GridFuture<?>> gridify(GridClosureCallMode mode, GridInClosure2<E1,E2> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2,E3> GridClosure3<E1,E2,E3,GridFuture<?>> gridify(GridClosureCallMode mode, GridInClosure3<E1,E2,E3> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" closure into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.E3 - Type of the third free variable.mode - Closure call mode with to curry given closure.c - Closure to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
GridOutClosure<GridFuture<Boolean>> gridify(GridClosureCallMode mode, GridAbsPredicate c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" predicate into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
mode - Closure call mode with to curry given closure.c - Predicate to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E> GridClosure<E,GridFuture<Boolean>> gridify(GridClosureCallMode mode, GridPredicate<E> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" predicate into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E - Type of the free variable.mode - Closure call mode with to curry given closure.c - Predicate to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2> GridClosure2<E1,E2,GridFuture<Boolean>> gridify(GridClosureCallMode mode, GridPredicate2<E1,E2> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" predicate into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.mode - Closure call mode with to curry given closure.c - Predicate to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
<E1,E2,E3> GridClosure3<E1,E2,E3,GridFuture<Boolean>> gridify(GridClosureCallMode mode, GridPredicate3<E1,E2,E3> c, @Nullable GridPredicate<? super GridRichNode>... p)
This method effectively allows to convert "local" predicate into a distributed one that will take the same parameters (if any), execute "somewhere" on this projection, and produce the same result but via future.
E1 - Type of the first free variable.E2 - Type of the second free variable.E3 - Type of the third free variable.mode - Closure call mode with to curry given closure.c - Predicate to convert.p - Optional set of filtering predicates. If none provided - all nodes from this
projection will be candidates for load balancing.
GridPredicate<GridRichNode> predicate()
GridProjection merge(@Nullable
GridProjection... prjs)
prjs - Optional set of projections to merge with. If non provided - this
projection is returned.
<T,R> R executeSync(GridTask<T,R> task, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridProjection.execute(Class, Object, GridPredicate[]) this method
executes given task synchronously. This method will block until execution
is complete, timeout expires or exception is thrown.
Note: this method will limit set of nodes to only those that are in this projection at the time of the call. If this projection is changing its node set dynamically, the set of nodes available for the task execution will also change dynamically from call to call.
When using this method task will be deployed automatically, so no explicit deployment step is required.
GridTaskTimeoutException - If task execution has timed out. Note that
physically task may still be executing, as there is no practical way to stop
it (however, every job within task will receive interrupt apply).
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridException - If task execution resulted in exception.T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List)
method.task - Instance of task to execute. If task class has GridTaskName
annotation, then task is deployed under a name specified within annotation.
Otherwise, full class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in
this projection will be used for task topology.
GridProjection.execute(Class, Object, GridPredicate[]),
GridProjection.execute(Class, Object, long, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> R executeSync(Class<? extends GridTask<T,R>> taskCls, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridProjection.execute(Class, Object, GridPredicate[]) this method executes given
task synchronously. This method will block until execution is complete, timeout expires or
exception is thrown.
Note: this method will limit set of nodes to only those that are in this projection at the time of the call. If this projection is changing its node set dynamically, the set of nodes available for the task execution will also change dynamically from call to call.
When using this method task will be deployed automatically, so no explicit deployment step is required.
GridTaskTimeoutException - If task execution has timed out. Note that physically
task may still be executing, as there is no practical way to stop it (however,
every job within task will receive interrupt apply).
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridException - If task execution resulted in exception.T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
GridProjection.execute(Class, Object, GridPredicate[]),
GridProjection.execute(Class, Object, long, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> R executeSync(String taskName, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridProjection.execute(String, Object, GridPredicate[]) this method executes given task synchronously.
This method will block until execution is complete, timeout expires or exception is thrown.
Note: this method will limit set of nodes to only those that are in this projection at the time of the call. If this projection is changing its node set dynamically, the set of nodes available for the task execution will also change dynamically from call to call.
If task for given name has not been deployed yet, then taskName will be
used as task class name to auto-deploy the task (see Grid#deployTask() method
for deployment algorithm).
GridTaskTimeoutException - If task execution has timed out. Note that physically
task may still be executing, as there is no practical way to stop it (however,
every job within task will receive interrupt apply).
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridException - If task execution resulted in exception.T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
GridProjection.execute(String, Object, GridPredicate[]),
GridProjection.execute(String, Object, long, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(String taskName, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridPredicate[]) method. It is always recommended
to specify explicit task timeout.
If task for given name has not been deployed yet, then taskName will be
used as task class name to auto-deploy the task (see Grid#deployTask() method
for deployment algorithm).
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.executeSync(String, Object, long, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(String taskName, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
If task for given name has not been deployed yet, then taskName will be
used as task class name to auto-deploy the task (see Grid#deployTask() method
for deployment algorithm).
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(String taskName, @Nullable T arg, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridTaskListener, GridPredicate[]) method. It is always
recommended to specify explicit task timeout.
If task for given name has not been deployed yet, then taskName will be
used as task class name to auto-deploy the task(see Grid#deployTask() method
for deployment algorithm).
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(String taskName, @Nullable T arg, long timeout, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
If task for given name has not been deployed yet, then taskName will be
used as task class name to auto-deploy the task(see Grid#deployTask() method
for deployment algorithm).
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridPredicate[]) method. It is always recommended
to specify explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls, @Nullable T arg, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridTaskListener, GridPredicate[]) method. It is always
recommended to specify explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.<T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls, @Nullable T arg, long timeout, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.<T,R> GridTaskFuture<R> execute(GridTask<T,R> task, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridPredicate[]) method. It is always recommended to specify
explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(GridTask<T,R> task, @Nullable T arg, long timeout, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask documentation.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.,
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withTopologySpi(String)<T,R> GridTaskFuture<R> execute(GridTask<T,R> task, @Nullable T arg, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
GridProjection.execute(String, Object, long, GridTaskListener, GridPredicate[]) method. It is always
recommended to specify explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.<T,R> GridTaskFuture<R> execute(GridTask<T,R> task, @Nullable T arg, long timeout, @Nullable GridTaskListener lsnr, @Nullable GridPredicate<? super GridRichNode>... p)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridFuture.isDone() will always return true.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
Note that if projection is empty after applying filtering predicates, the result future will finish with exception. In case of dynamic projection this method will take a snapshot of all nodes in the projection, apply all filtering predicates, if any, and if the resulting set of nodes is empty the returned future will finish with exception.
T - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.lsnr - Optional grid task result listener that will be called once the execution is completed
(successfully or not).timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for task topology.
for information about task execution.<R1,R2,T extends Callable<R1>> R2 mapreduce(@Nullable GridMapper<T,GridRichNode> mapper, @Nullable Collection<T> jobs, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message and calculates its length by splitting it by spaces, calculating the length of each word on individual (remote) grid node and then summing (reducing) results from all nodes to produce the final length of the input string using function APIs, typedefs, and execution closures on the grid:
public static int length(final String msg) throws GridException {
return G.grid().call(SPREAD, F.yield(msg.split(" "), F.cInvoke("length")), F.sumIntReducer());
}
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.R1 - Return type of the closures.R2 - Return type of the final reduced value.mapper - Mapping closure that maps given jobs to the grid nodes. Note that each job will be
mapped only once. If null - this method is no-op.jobs - Closures to map to grid nodes and execute on them. If null or empty -
this method is no-op.rdc - Reducing closure that reduces results from multiple closure into one final value.
If null - this method is no-op.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for topology.
null is returned.GridProjection.withResultClosure(GridClosure2X)<R1,R2,T extends Callable<R1>> GridFuture<R2> mapreduceAsync(@Nullable GridMapper<T,GridRichNode> mapper, @Nullable Collection<T> jobs, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
Note that unlike its sibling method GridProjection.mapreduce(GridMapper, Collection, GridReducer, GridPredicate[])
this method does not block and returns immediately with the future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
If you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
R1 - Return type of the closures.R2 - Return type of the final reduced value.mapper - Mapping closure that maps given jobs to the grid nodes. Note that each job will be
mapped only once. If null - this method is no-op.jobs - Closures to map to grid nodes and execute on them.
If null or empty - this method is no-op.rdc - Reducing closure that reduces results from multiple closure into one final value.
If null - this method is no-op.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be used for topology.
null value is returned.GridProjection.withResultClosure(GridClosure2X)Collection<GridRichNode> nodes(@Nullable Collection<UUID> ids)
Nodes are returned in the same order as passed in IDs.
ids - Collection of node IDs. If none provides - empty collection will be returned.
Collection<GridRichNode> nodes(@Nullable GridPredicate<? super GridRichNode>... p)
true for all
given predicates.
p - Optional set of predicates. If none provided - all nodes will be returned.
true for provided predicates.
Node that this collection can be empty when either given predicates filter out all
nodes or method is called on daemon node and it is the only node in the topology.
Remember: this method doesn't return daemon nodes.GridProjection.daemonNodes(GridPredicate[])
GridProjection projectionForNodes(@Nullable
Collection<? extends GridNode> nodes)
nodes - Collection of nodes to create a projection from.
GridProjection projectionForNodes(@Nullable
GridRichNode... nodes)
nodes - Collection of nodes to create a projection from.
GridProjection projectionForNodeIds(@Nullable
UUID... ids)
Note that name with prefix 0 selected to avoid Java naming conflict.
ids - Collection of node IDs defining collection of nodes to create projection with.
GridProjection projectionForNodeIds(@Nullable
Collection<UUID> ids)
Note that name with prefix 0 selected to avoid Java naming conflict.
ids - Collection of node IDs defining collection of nodes to create projection with.
GridProjection projectionForPredicate(@Nullable
GridPredicate<? super GridRichNode>... p)
Note that name with prefix 1 selected to avoid Java naming conflict.
p - Collection of predicates that all should evaluate to true for a node
to be included in the final projection.
PN
GridProjection projectionForAttribute(String n,
@Nullable
String v)
null than simple attribute presence
(with any value) will be used for inclusion of the node.
n - Name of the attribute.v - Optional attribute value to match.
GridProjection projectionForCaches(@Nullable
String cacheName,
@Nullable
String... cacheNames)
cacheName - Cache name.cacheNames - Cache names.
GridPair<GridProjection> split(@Nullable GridPredicate<? super GridRichNode>... p)
true for all
given predicates, second will have the remaining nodes. Note that if no predicates provided the first
projection in returned pair will be this projection and the second object in the pair will be null.
p - Optional set of splitting predicates.
GridProjection cross(@Nullable
Collection<? extends GridNode> nodes)
nodes - Set of nodes to cross by. If none provided - this projection is returned.
GridProjection cross0(@Nullable
GridRichNode... nodes)
Note that name with prefix 1 selected to avoid Java naming conflict.
nodes - Set of nodes to cross by. If none provided - this projection is returned.
GridProjection cross(@Nullable
GridProjection... prjs)
prjs - Other projections. If none provided - this projection is returned.
long topologyHash(@Nullable
GridPredicate<? super GridRichNode>... p)
Note that since GridGain topology architecture is peer-to-peer (without centralized coordination) there is still a small window in which different nodes would have different version for the same topology. Therefore, this version cannot be used in strict ACID context. Values returned by this method are not guaranteed to be sequential. Standard implementation uses CRC32 hash method.
p - Collection of predicates that all should evaluate to true for node
to be included in the final calculation.
Collection<GridRichNode> remoteNodes(@Nullable GridPredicate<? super GridRichNode>... p)
p - Predicates to filter remote nodes. If none provided - all remote nodes
will be returned.
GridProjection remoteProjection(@Nullable
GridPredicate<? super GridRichNode>... p)
p - Predicates to filter remote nodes. If none provided - all remote nodes
will be used.
Grid grid()
@Nullable GridProjection parent()
null if this project is an instance of Grid interface, i.e.
root projection.
null.
GridProjection withName(@Nullable
String taskName)
You may use this method to set task name when you cannot use
GridTaskName annotation.
Here is an example.
G.grid().withName("MyTask").call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
taskName - Task name.
this).
GridProjection withResultClosure(@Nullable
GridClosure2X<GridJobResult,List<GridJobResult>,GridJobResultPolicy> res)
GridTask.result(GridJobResult, List) method for the
next executed closure on this projection in the current thread.
When closure starts execution the ad-hoc implementation set here is reset - so it is valid only
for one execution from the current thread.
Note that this method makes sense only for closure executions, i.e. the case where GridGain automatically converts closure to a grid task. If a user provided task is executed this ad-hoc closure is ignored.
This particular useful when you need to disable, for example, failover on specific closure
execution like in the following example (note that X.NO_FAILOVER provides
built-in closure that effectively disables failover logic):
G.grid().withResultClosure(X.NO_FAILOVER).call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
res - Ad-hoc implementation for GridTask.result(GridJobResult, List) method.
this).X.NO_FAILOVER
GridProjection withFailoverSpi(@Nullable
String spiName)
You may use this method to set specific failover SPI when you cannot use
GridTaskSpis annotation.
Here is an example.
G.grid().withFailoverSpi("MyFailoverSpi").call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
spiName - Failover SPI name to use.
this).GridTaskSpis
GridProjection withCheckpointSpi(@Nullable
String spiName)
You may use this method to set specific checkpoint SPI when you cannot use
GridTaskSpis annotation.
Here is an example.
G.grid().withCheckpointSpi("MyCheckpointSpi").call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
spiName - Checkpoint SPI name to use.
this).GridTaskSpis
GridProjection withLoadBalancingSpi(@Nullable
String spiName)
You may use this method to set specific load balancing SPI when you cannot use
GridTaskSpis annotation.
Here is an example.
G.grid().withLoadBalancingSpi("MyLoadBalancingSpi").call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
spiName - Load balancing SPI name to use.
this).GridTaskSpis
GridProjection withTopologySpi(@Nullable
String spiName)
You may use this method to set specific topology SPI when you cannot use
GridTaskSpis annotation.
Here is an example.
G.grid().withTopologySpi("MyTopologySpi").call(
BROADCAST,
new CAX() {
@Override public void applyx() throws GridException {
System.out.println("Hello!");
}
}
);
spiName - Checkpoint SPI name to use.
this).GridTaskSpis
void run(@Nullable
GridMapper<Runnable,GridRichNode> mapper,
@Nullable
Collection<? extends Runnable> jobs,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
This method will block until its execution is complete or an exception is thrown.
All default SPI implementations configured for this grid instance will be
used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message and calculates its length by splitting it by spaces, calculating the length of each word on individual (remote) grid node and then summing (reducing) results from all nodes to produce the final length of the input string using function APIs, typedefs, and execution closures on the grid:
public static int length(final String msg) throws GridException {
return G.grid().call(SPREAD, F.yield(msg.split(" "), F.cInvoke("length")), F.sumIntReducer());
}
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.mapper - Mapping closure that maps given jobs to the grid nodes. Note that each job will be
mapped only once. If null - this method is no-op.jobs - Closures to map to grid nodes and execute on them.
If null or empty - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)GridFuture<?> runAsync(@Nullable GridMapper<Runnable,GridRichNode> mapper, @Nullable Collection<? extends Runnable> jobs, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.run(GridClosureCallMode, Runnable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations configured for this grid
instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message and calculates its length by splitting it by spaces, calculating the length of each word on individual (remote) grid node and then summing (reducing) results from all nodes to produce the final length of the input string using function APIs, typedefs, and execution closures on the grid:
public static int length(final String msg) throws GridException {
return G.grid().call(SPREAD, F.yield(msg.split(" "), F.cInvoke("length")), F.sumIntReducer());
}
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
mapper - Mapping closure that maps given jobs to the grid nodes. Note that each job will be
mapped only once. If null - this method is no-op.jobs - Closures to map to grid nodes and execute on them.
If null or empty - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used for topology.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)
void run(GridClosureCallMode mode,
@Nullable
Runnable job,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
This method will block until the execution is complete. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message, splits it into individual words and prints each word on an individual grid node using typedefs, functional APIs and closure execution on the grid:
public static void sayIt(String phrase) throws GridException {
G.grid().call(SPREAD, F.yield(phrase.split(" "), F.<String>printf("%s")));
}
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.mode - Mode of the distribution for the closure.job - Job closure to execute. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used in topology.PN,
GridProjection.runAsync(GridClosureCallMode, Runnable, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable Runnable job, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.run(GridClosureCallMode, Runnable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
mode - Mode of the distribution for the closure.job - Job closure to execute. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used in topology.
PN,
GridProjection.run(GridClosureCallMode, Runnable, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)
void run(GridClosureCallMode mode,
@Nullable
Collection<? extends Runnable> jobs,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
This method will block until the execution is complete. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message, splits it into individual words and prints each word on an individual grid node using typedefs, functional APIs and closure execution on the grid:
public static void sayIt(String phrase) throws GridException {
G.grid().call(SPREAD, F.yield(phrase.split(" "), F.<String>printf("%s")));
}
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.mode - Mode of the distribution for the closure.jobs - Job closures to execute. If null or empty - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used in topology.PN,
GridProjection.runAsync(GridClosureCallMode, Collection, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends Runnable> jobs, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.run(GridClosureCallMode, Collection, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
mode - Mode of the distribution for the closure.jobs - Job closures to execute. If null or empty - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used in topology.
PN,
GridProjection.run(GridClosureCallMode, Collection, GridPredicate[])<R> R call(GridClosureCallMode mode, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
This method will block until the execution is complete. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision
resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message, splits it into individual words and prints each word on an individual grid node using typedefs, functional APIs and closure execution on the grid:
public static void sayIt(String phrase) throws GridException {
G.grid().call(SPREAD, F.yield(phrase.split(" "), F.<String>printf("%s")));
}
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.R - Type of the closure return value.mode - Mode of the distribution for the closures.job - Closure to invoke. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
GridClosureCallMode.UNICAST) - all results will be received but only first one
will be returned (and all other will be discarded). Such non-unicast executions make sense
primarily for side-effects only closures (i.e. closures that have no return value).PN,
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R> GridFuture<R> callAsync(GridClosureCallMode mode, @Nullable Callable<R> job, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.call(GridClosureCallMode, Callable, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
R - Type of the closure return value.mode - Mode of the distribution for the closures.job - Closure to invoke. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
GridClosureCallMode.UNICAST) - all results will be received but
only first one will be returned (and all other will be discarded). Such non-unicast executions
make sense primarily for side-effects only closures (i.e. closures that have no return value).PN,
GridProjection.call(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R> Collection<R> call(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R>> jobs, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
This method will block until the execution is complete. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision
resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message, splits it into individual words and prints each word on an individual grid node using typedefs, functional APIs and closure execution on the grid:
public static void sayIt(String phrase) throws GridException {
G.grid().call(SPREAD, F.yield(phrase.split(" "), F.<String>printf("%s")));
}
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.mode - Mode of the distribution for the closures.jobs - Closures to invoke. If null or empty - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
PN,
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R> GridFuture<Collection<R>> callAsync(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R>> jobs, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.call(GridClosureCallMode, Collection, GridPredicate[]) this method does
not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
R - Type of the closure return value.mode - Mode of the distribution for the closures.jobs - Closures to invoke. If null or empty - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
PN,
GridProjection.call(GridClosureCallMode, Collection, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2> R2 reduce(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R1>> jobs, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
This method will block until the execution is complete. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision
resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Here's a general example of the Java method that takes a text message and calculates its length by splitting it by spaces, calculating the length of each word on individual (remote) grid node and then summing (reducing) results from all nodes to produce the final length of the input string using function APIs, typedefs, and execution closures on the grid:
public static int length(final String msg) throws GridException {
return G.grid().call(SPREAD, F.yield(msg.split(" "), F.cInvoke("length")), F.sumIntReducer());
}
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
GridException - Thrown in case of any error.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.R1 - Closure result type.R2 - Type of the reduced value.mode - Mode of the distribution for the closure.jobs - Closures to executes. If null or empty - this method is no-op.rdc - Result reducing closure. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
null is returned.PN,
GridProjection.reduceAsync(GridClosureCallMode, Collection, GridReducer, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2> GridFuture<R2> reduceAsync(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R1>> jobs, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
Unlike its sibling method GridProjection.reduce(GridClosureCallMode, Collection, GridReducer, GridPredicate[])
this method does not block and returns immediately with future. All default SPI implementations
configured for this grid instance will be used (i.e. failover, load balancing, collision resolution, etc.).
Note that if you need greater control on any aspects of Java code execution on the grid
you should implement GridTask which will provide you with full control over the execution.
Note that class GridAbsClosure implements Runnable and class GridOutClosure
implements Callable interface. Note also that class GridFunc and typedefs provide rich
APIs and functionality for closures and predicates based processing in GridGain. While Java interfaces
Runnable and Callable allow for lowest common denominator for APIs - it is advisable
to use richer Functional Programming support provided by GridGain available in org.gridgain.grid.lang
package.
Notice that Runnable and Callable implementations must support serialization as required
by the configured marshaller. For example, JDK marshaller will require that implementations would
be serializable. Other marshallers, e.g. JBoss marshaller, may not have this limitation. Please consult
with specific marshaller implementation for the details. Note that all closures and predicates in
org.gridgain.grid.lang package are serializable and can be freely used in the distributed
context with all marshallers currently shipped with GridGain.
R1 - Closure result type.R2 - Type of the reduced value.mode - Mode of the distribution for the closure.jobs - Closures to executes. If null or empty - this method is no-op.rdc - Result reducing closure. If null - this method is no-op.p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.
null
value is returned.PN,
GridProjection.reduce(GridClosureCallMode, Collection, GridReducer, GridPredicate[]),
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)
void send(@Nullable
Object msg,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
GridException - If failed to send a message to any of the nodes.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.msg - Message to send. If null - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used.
void send(@Nullable
Collection<?> msgs,
@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
GridException - If failed to send a message to any of the nodes.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.msgs - Messages to send. Order of the sending is undefined. If the method produces
the exception none or some messages could have been sent already.
If null or empty - this method is no-op.p - Optional set of filtering predicates. All predicates must evaluate to true for a
node to be included. If none provided - all nodes in this projection will be used.
@Nullable
GridRichNode node(UUID nid,
@Nullable
GridPredicate<? super GridRichNode>... p)
nid - Node ID.p - Optional set of filtering predicates. If non provided - all nodes in this
projection will be included.
null if such node does not exist in this
projection.Collection<GridRichNode> daemonNodes(@Nullable GridPredicate<? super GridRichNode>... p)
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 data grid storage.
p - Optional set of predicates. If none provided - all daemon nodes will be returned.
null.Collection<GridRichNode> nodeId8(String id8)
id8 - node ID8.
boolean isEmptyFor(@Nullable
GridPredicate<? super GridRichNode>... p)
p - Optional set of filtering predicates. If non provided - all nodes in this
projection will be included.
true if at the time of calling this projection has at least
one node - false otherwise.boolean isEmpty()
true if at the time of calling this projection has at least
one node - false otherwise.
boolean contains(GridNode node,
@Nullable
GridPredicate<? super GridRichNode>... p)
node - Node to check.p - Optional set of filtering predicates. If non provided - all nodes in this
projection will be included.
true if this node is in this projection, false otherwise.
boolean contains(UUID nid,
@Nullable
GridPredicate<? super GridRichNode>... p)
nid - Node ID to check.p - Optional set of filtering predicates. If non provided - all nodes in this
projection will be included.
true if the node with given node ID is in this projection, false otherwise.List<GridEvent> remoteEvents(GridPredicate<? super GridEvent> pe, long timeout, @Nullable GridPredicate<? super GridRichNode>... pn) throws GridException
GridException - If query failed to execute.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException throws if computation was cancelled.pe - Predicate filter used to query events on remote nodes.pn - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.timeout - Maximum time to wait for result, 0 to wait forever.
GridProjection.remoteEventsAsync(GridPredicate, long, GridPredicate[]),
PE,
PNGridFuture<List<GridEvent>> remoteEventsAsync(GridPredicate<? super GridEvent> pe, long timeout, @Nullable GridPredicate<? super GridRichNode>... pn)
pe - Predicate filter used to query events on remote nodes.pn - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided - all nodes in this projection will be used.timeout - Maximum time to wait for result, 0 to wait forever.
GridProjection.remoteEvents(GridPredicate, long, GridPredicate[]),
PE,
PN<T> void listen(@Nullable GridPredicate2<UUID,? super T>... p)
When this method is called it will register message listener for the messages only from nodes
in this projection and return immediately without blocking. On the background, for each received
messages from these nodes it will call passed in predicates. If all predicates return true -
it will continue listen for the new messages. If at least one predicate returns false -
it will unregister the listener and stop receiving messages. Note that checking predicates will
be short-circuit if a predicate evaluates to false.
Note that all predicates will be called in synchronized context so that only one thread can access given predicate at a time.
T - Type of the message.p - Collection of predicates that is called on each received message. If all predicates
return true - the implementation will continue listen for the new messages. If any
predicate returns false - the implementation will unregister the listener and stop
receiving messages.
If none provided - this method is no-op.
GridListenActor,
GridProjection.remoteListenAsync(Collection, GridPredicate2[]),
GridProjection.remoteListenAsync(GridPredicate, GridPredicate2[])<T> GridFuture<?> remoteListenAsync(@Nullable GridNode node, @Nullable GridPredicate2<UUID,? super T>... p)
node. Messages can be sent using one of the following
methods:
Essentially, this method allows to "wire up" sender and receiver(s) of the messages in a
completely distributed manner. Note that this method will take a current snapshot of nodes in
this projection which is an important consideration for dynamic projection that can have a
constantly changing set of nodes.
T - Type of the message.node - Node to listen for message from. If null this method is no-op.p - Collection of predicates that are called on each received message. If all predicates
return true - the implementation will continue listen for the new messages. If any
predicate returns false - the implementation will unregister the listener and stop
receiving messages.
If none provided - this method is no-op.
GridListenActor,
GridProjection.listen(GridPredicate2[]),
GridProjection.remoteListenAsync(GridPredicate, GridPredicate2[]),
GridProjection.send(Object, GridPredicate[]),
GridProjection.send(Collection, GridPredicate[])<T> GridFuture<?> remoteListenAsync(@Nullable Collection<? extends GridNode> nodes, @Nullable GridPredicate2<UUID,? super T>... p)
nodes. Messages can be sent using one of the following
methods:
Essentially, this method allows to "wire up" senders and receiver(s) of the messages in a
completely distributed manner. Note that this method will take a current snapshot of nodes in
this projection which is an important consideration for dynamic projection that can have a
constantly changing set of nodes.
T - Type of the message.nodes - Nodes to listen for message from. If null or empty
this method is no-op.p - Collection of predicates that is called on each received message. If all predicates
return true - the implementation will continue listen for the new messages. If any
predicate returns false - the implementation will unregister the listener and stop
receiving messages.
If none provided - this method is no-op.
GridListenActor,
GridProjection.listen(GridPredicate2[]),
GridProjection.remoteListenAsync(GridPredicate, GridPredicate2[])<T> GridFuture<?> remoteListenAsync(@Nullable GridPredicate<? super GridRichNode> pn, @Nullable GridPredicate2<UUID,? super T>... p)
T - Type of the message.pn - Predicate to define nodes on each node from this projection to listen for messages
from. If not provided - this method is no-op.p - Collection of predicates that is called on each received message. If all predicates
return true - the implementation will continue listen for the new messages. If any
predicate returns false - the implementation will unregister the listener and stop
receiving messages.
If none provided - this method is no-op.
GridListenActor,
GridProjection.listen(GridPredicate2[]),
GridProjection.remoteListenAsync(Collection, GridPredicate2[])
ExecutorService executor(@Nullable
GridPredicate<? super GridRichNode>... p)
ExecutorService which will execute all submitted
Callable and Runnable tasks on this projection. This essentially
creates a Distributed Thread Pool that can be used as a drop-in
replacement for local thread pools to gain easy distributed processing
capabilities.
User may run Callable and Runnable tasks
just like normally with java.util.ExecutorService.
The typical Java example could be:
... ExecutorService exec = grid.executor(); Future<String> fut = exec.submit(new MyCallable()); ... String res = fut.get(); ...
p - Optional set of predicates. All predicates must evaluate to true for a node to be
included. If none provided or null - all nodes in this projection will be used.
ExecutorService which delegates all calls to grid.<R> Collection<R> call(@Nullable GridMapper<Callable<R>,GridRichNode> mapper, @Nullable Collection<? extends Callable<R>> jobs, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridMapper
for mapper details.
Note that unlike its sibling GridProjection.callAsync(GridMapper, Collection, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R - Type of job result.mapper - Mapper used to map jobs to nodes. If null - this method is no-op.jobs - Jobs to run. If null or empty - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R> GridFuture<Collection<R>> callAsync(@Nullable GridMapper<Callable<R>,GridRichNode> mapper, @Nullable Collection<? extends Callable<R>> jobs, @Nullable GridPredicate<? super GridRichNode>... p)
GridMapper
for mapper details.
Note that unlike its sibling GridProjection.call(GridMapper, Collection, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R - Type of job result.mapper - Mapper used to map jobs to nodes. If null - this method is no-op.jobs - Jobs to run. If null or empty - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> Collection<R> call(GridClosureCallMode mode, @Nullable Collection<? extends GridClosure<? super T,R>> jobs, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
Note that unlike its sibling
GridProjection.callAsync(GridClosureCallMode, Collection, Collection, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.R - Type of job result.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.args - Jobs' arguments (closure free variables).
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> GridFuture<Collection<R>> callAsync(GridClosureCallMode mode, @Nullable Collection<? extends GridClosure<? super T,R>> jobs, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p)
Note that unlike its sibling
GridProjection.call(GridClosureCallMode, Collection, Collection, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.R - Type of job result.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.args - Jobs' arguments (closure free variables).
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> Collection<R> call(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST
will be equal to size of collection of arguments.
Note that unlike its sibling
GridProjection.callAsync(GridClosureCallMode, GridClosure, Collection, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.R - Type of job result.mode - Distribution mode.job - Job to run. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.args - Job arguments (closure free variables).
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> GridFuture<Collection<R>> callAsync(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST
will be equal to size of collection of arguments.
Note that unlike its sibling
GridProjection.call(GridClosureCallMode, GridClosure, Collection, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.R - Type of job result.mode - Distribution mode.job - Job to run. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.args - Job arguments (closure free variables).
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> Collection<R> call(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST
will be equal to number of produced arguments specified by cnt.
Note that unlike its sibling
GridProjection.callAsync(GridClosureCallMode, GridClosure, GridOutClosure, int, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.R - Type of job result.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments.cnt - Number of arguments to produce.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T,R> GridFuture<Collection<R>> callAsync(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST
will be equal to number of produced arguments specified by cnt.
Note that unlike its sibling
GridProjection.call(GridClosureCallMode, GridClosure, GridOutClosure, int, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.R - Type of job result.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> void run(GridClosureCallMode mode, @Nullable Collection<? extends GridInClosure<? super T>> jobs, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
Note that unlike its sibling
GridProjection.runAsync(GridClosureCallMode, Collection, Collection, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends GridInClosure<? super T>> jobs, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p)
Note that unlike its sibling
GridProjection.run(GridClosureCallMode, Collection, Collection, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> void run(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST will be equal to
size of collection of arguments.
Note that unlike its sibling
GridProjection.runAsync(GridClosureCallMode, GridInClosure, Collection, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.args - Job arguments.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable Collection<? extends T> args, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST will be equal to
size of collection of arguments.
Note that unlike its sibling
GridProjection.run(GridClosureCallMode, GridInClosure, Collection, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.args - Job arguments.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> void run(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST will be equal to
number of produced arguments specified by cnt.
Note that unlike its sibling
GridProjection.runAsync(GridClosureCallMode, GridInClosure, GridOutClosure, int, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST will be equal to
number of produced arguments specified by cnt.
Note that unlike its sibling
GridProjection.run(GridClosureCallMode, GridInClosure, GridOutClosure, int, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 reduce(GridClosureCallMode mode, @Nullable Collection<? extends GridClosure<? super T,R1>> jobs, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.reduceAsync(GridClosureCallMode, Collection, Collection, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> reduceAsync(GridClosureCallMode mode, @Nullable Collection<? extends GridClosure<? super T,R1>> jobs, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.reduce(GridClosureCallMode, Collection, Collection, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 reduce(GridClosureCallMode mode, @Nullable GridClosure<? super T,R1> job, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST
will be equal to size of collection of arguments. Then method reduces these job
results to a single execution result using provided reducer. See GridReducer
for reducer details.
Note that unlike its sibling
GridProjection.reduceAsync(GridClosureCallMode, GridClosure, Collection, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> reduceAsync(GridClosureCallMode mode, @Nullable GridClosure<? super T,R1> job, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST
will be equal to size of collection of arguments. Then method reduces these job
results to a single execution result using provided reducer. See GridReducer
for reducer details.
Note that unlike its sibling
GridProjection.reduce(GridClosureCallMode, GridClosure, Collection, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 reduce(GridClosureCallMode mode, @Nullable GridClosure<? super T,R1> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST
will be equal to number of produced arguments specified by cnt. Then method
reduces these job results to a single execution result using provided reducer. See
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.reduceAsync(GridClosureCallMode, GridClosure, GridOutClosure, int, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> reduceAsync(GridClosureCallMode mode, @Nullable GridClosure<? super T,R1> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST
will be equal to number of produced arguments specified by cnt. Then method
reduces these job results to a single execution result using provided reducer. See
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.reduce(GridClosureCallMode, GridClosure, GridOutClosure, int, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 mapreduce(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable Collection<? extends GridClosure<? super T,R1>> jobs, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridMapper for mapper details and GridReducer
for reducer details.
Note that unlike its sibling
GridProjection.mapreduceAsync(GridMapper, Collection, Collection, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> mapreduceAsync(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable Collection<? extends GridClosure<? super T,R1>> jobs, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridMapper for mapper details and GridReducer
for reducer details.
Note that unlike its sibling
GridProjection.mapreduce(GridMapper, Collection, Collection, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.jobs - Jobs to run. If null or empty - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value
is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 mapreduce(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable GridClosure<? super T,R1> job, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST will be equal to size of collection of
arguments. Then method reduces these job results to a single execution result
using provided reducer. See GridMapper for mapper details and
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.mapreduceAsync(GridMapper, GridClosure, Collection, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.job - Job to run. If null - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> mapreduceAsync(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable GridClosure<? super T,R1> job, @Nullable Collection<? extends T> args, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST will be equal to size of collection of
arguments. Then method reduces these job results to a single execution result
using provided reducer. See GridMapper for mapper details and
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.mapreduce(GridMapper, GridClosure, Collection, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.job - If null - this method is no-op.args - Job arguments.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> R2 mapreduce(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable GridClosure<? super T,R1> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridClosureCallMode.BROADCAST will be equal to number of produced arguments
specified by cnt. Then method reduces these job results to a single execution
result using provided reducer. See GridMapper for mapper details and
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.mapreduceAsync(GridMapper, GridClosure, GridOutClosure, int, GridReducer, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R1,R2,T> GridFuture<R2> mapreduceAsync(@Nullable GridMapper<GridOutClosure<R1>,GridRichNode> mapper, @Nullable GridClosure<? super T,R1> job, @Nullable GridOutClosure<T> pdc, int cnt, @Nullable GridReducer<R1,R2> rdc, @Nullable GridPredicate<? super GridRichNode>... p)
GridClosureCallMode.BROADCAST will be equal to number of produced arguments
specified by cnt. Then method reduces these job results to a single execution
result using provided reducer. See GridMapper for mapper details and
GridReducer for reducer details.
Note that unlike its sibling
GridProjection.mapreduce(GridMapper, GridClosure, GridOutClosure, int, GridReducer, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R1 - Type of job result.R2 - Type of reduced result.T - Type of job argument.mapper - Mapper used to map jobs to nodes.job - Job to run. If null - this method is no-op.pdc - Producer of job arguments. If null - this method is no-op.cnt - Number of arguments to produce.rdc - Job result reducer. If null - this method is no-op.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
null value is returned.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> void run(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridProjection.callAsync(GridClosureCallMode, GridClosure, Object, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.arg - Job argument.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<T> GridFuture<?> runAsync(GridClosureCallMode mode, @Nullable GridInClosure<? super T> job, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p)
GridProjection.run(GridClosureCallMode, GridInClosure, Object, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.arg - Job argument.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R,T> R call(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p) throws GridException
GridProjection.callAsync(GridClosureCallMode, GridClosure, Object, GridPredicate[])
this method will block until execution is complete, timeout expires, execution
is cancelled or exception is thrown.
GridException - Thrown in case of any failure.
GridInterruptedException - Subclass of GridException
thrown if the wait was interrupted.
GridFutureCancelledException - Subclass of GridException
thrown if computation was cancelled.
GridEmptyProjectionException - Thrown in case when this projection is empty.
Note that in case of dynamic projection this method will take a snapshot of all the
nodes at the time of this call, apply all filtering predicates, if any, and if the
resulting collection of nodes is empty - the exception will be thrown.R - Type of job result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.arg - Job argument.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridClosureCallMode.UNICAST) - all results will be received but only first one
will be returned (and all other will be discarded). Such non-unicast executions make sense
primarily for side-effects only closures (i.e. closures that have no return value).GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)<R,T> GridFuture<R> callAsync(GridClosureCallMode mode, @Nullable GridClosure<? super T,R> job, @Nullable T arg, @Nullable GridPredicate<? super GridRichNode>... p)
GridProjection.call(GridClosureCallMode, GridClosure, Object, GridPredicate[])
this method doesn't block and immediately returns with future of execution.
R - Type of job result.T - Type of job argument.mode - Distribution mode.job - Job to run. If null - this method is no-op.arg - Job argument.p - Optional set of predicates filtering execution topology. If not
provided - all nodes in this projection will be included.
GridClosureCallMode.UNICAST) - all results will be received but
only first one will be returned (and all other will be discarded). Such non-unicast executions
make sense primarily for side-effects only closures (i.e. closures that have no return value).GridProjection.callAsync(GridClosureCallMode, Callable, GridPredicate[]),
GridProjection.withCheckpointSpi(String),
GridProjection.withFailoverSpi(String),
GridProjection.withName(String),
GridProjection.withResultClosure(GridClosure2X),
GridProjection.withTopologySpi(String)@GridEnterpriseFeature(value="Data affinity outside of GridCache is enterprise-only feature.") <K> Map<GridRichNode,Collection<K>> mapKeysToNodes(@Nullable Collection<? extends K> keys) throws GridException
This method works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
GridException - If failed to map cache keys.keys - Cache keys to map to nodes.
@GridEnterpriseFeature(value="Data affinity outside of GridCache is enterprise-only feature.") <K> Map<GridRichNode,Collection<K>> mapKeysToNodes(@Nullable String cacheName, @Nullable Collection<? extends K> keys) throws GridException
This method works as following:
GridCacheAffinity is
used to determine which keys are mapped to which groups of nodes.
GridException - If failed to map cache keys.cacheName - Cache name, if null, then default cache instance is used.keys - Cache keys to map to nodes.
@GridEnterpriseFeature(value="Data affinity outside of GridCache is enterprise-only feature.") @Nullable <K> GridRichNode mapKeyToNode(K key) throws GridException
This method works as following:
GridCacheAffinity
is returned.
GridException - If failed to map key.key - Cache key to map to a node.
null if cache with default name
is not present in the grid.@GridEnterpriseFeature(value="Data affinity outside of GridCache is enterprise-only feature.") @Nullable <K> GridRichNode mapKeyToNode(@Nullable String cacheName, K key) throws GridException
This method works as following:
GridCacheAffinity
is returned.
GridException - If failed to map key.cacheName - Cache name, if null, then default cache instance is used.key - Cache key to map to a node.
null if cache with given name
is not present in the grid.Collection<GridTuple3<String,Boolean,String>> startNodes(File file, @Nullable String dfltUname, @Nullable String dfltPasswd, @Nullable File key, int nodes, @Nullable String ggHome, @Nullable String cfg, @Nullable String script, @Nullable String log, boolean restart) throws GridException
Parameters for each host are defined in specification which has the following format: <username>:<password>@<hostname>:<port>#<nodes> (only hostname is required).
If username or password are not provided in specification, default values from
dfltUname and dfltPasswd parameters are used.
Default port is 22.
<nodes> defines number of nodes that should run on the host. E.g., if
5 nodes are expected and 3 are already running, only 2 new
nodes will be started.
One specification can define several hosts if their IPs are sequential.
E.g., 10.0.0.1~5 defines range of five IP addresses. Other parameters
(username, password, etc.) are applied to all hosts equally.
Returned result contains tuples. Each corresponds to one node start attempt and contains hostname, success flag and error message if attempt was not successful. Note that successful attempt doesn't mean that node was actually started and joined topology. For large topologies (> 100s nodes) it can take over 10 minutes for all nodes to start. See individual node logs for details.
Note that SSH remote execution requires that all environment properties be set globally
on the remote node. Standard GridGain ggstart.{sh|bat} script needs both GRIDGAIN_HOME
(cam also be passed in ggHome parameter) and JAVA_HOME environment variables
set globally for SSH-based execution to work.
On Linux - you can use '/etc/environment' file to set global environment variables at the login time. Mac OSX currently doesn't support automatic setting of global variable and you need to provide custom start script in this case. On Windows use standard way to set environment properties.
GridException - In case of error.file - File with host specifications.dfltUname - Default username (used if specification doesn't contain username).dfltPasswd - Default password (used if specification doesn't contain password).key - Private key file. Define it if server requires key authentication.nodes - Expected number of nodes on the host. If some nodes are started
already, then only remaining nodes will be started. If current count of
nodes is equal to this number, and restart flag is false,
then nothing will happen.ggHome - Path to GridGain installation folder. If null, global
GRIDGAIN_HOME environment variable must be set on remote hosts.cfg - Path to configuration file (optional).script - Path to start script (optional).log - Path to log file (optional).restart - Whether to stop existing nodes. If true, all existing
nodes on the host will be stopped before starting new ones. If false,
nodes will be started only if there are less nodes on the host than expected.
Collection<GridTuple3<String,Boolean,String>> startNodes(Collection<String> hostSpecs, @Nullable String dfltUname, @Nullable String dfltPasswd, @Nullable File key, int nodes, @Nullable String ggHome, @Nullable String cfg, @Nullable String script, @Nullable String log, boolean restart) throws GridException
Parameters for each host are defined in specification which has the following format: <username>:<password>@<hostname>:<port>#<nodes> (only hostname is required).
If username or password are not provided in specification, default values from
dfltUname and dfltPasswd parameters are used.
Default port is 22.
<nodes> defines number of nodes that should run on the host. E.g., if
5 nodes are expected and 3 are already running, only 2 new
nodes will be started.
One specification can define several hosts if their IPs are sequential.
E.g., 10.0.0.1~5 defines range of five IP addresses. Other parameters
(username, password, etc.) are applied to all hosts equally.
Returned result contains tuples. Each corresponds to one node start attempt and contains hostname, success flag and error message if attempt was not successful. Note that successful attempt doesn't mean that node was actually started and joined topology. For large topologies (> 100s nodes) it can take over 10 minutes for all nodes to start. See individual node logs for details.
Note that SSH remote execution requires that all environment properties be set globally
on the remote node. Standard GridGain ggstart.{sh|bat} script needs both GRIDGAIN_HOME
(cam also be passed in ggHome parameter) and JAVA_HOME environment variables
set globally for SSH-based execution to work.
On Linux - you can use '/etc/environment' file to set global environment variables at the login time. Mac OSX currently doesn't support automatic setting of global variable and you need to provide custom start script in this case. On Windows use standard way to set environment properties.
GridException - In case of error.hostSpecs - Collection of host specifications.dfltUname - Default username (used if specification doesn't contain username).dfltPasswd - Default password (used if specification doesn't contain password).key - Private key file. Define it if server requires key authentication.nodes - Expected number of nodes on the host. If some nodes are started
already, then only remaining nodes will be started. If current count of
nodes is equal to this number, and restart flag is false,
then nothing will happen.ggHome - Path to GridGain installation folder. If null, global
GRIDGAIN_HOME environment variable must be set on remote hosts.cfg - Path to configuration file (optional).script - Path to start script (optional).log - Path to log file (optional).restart - Whether to stop existing nodes. If true, all existing
nodes on the host will be stopped before starting new ones. If false,
nodes will be started only if there are less nodes on the host than expected.
void stopNodes(@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
GridException - In case of error.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be stopped.
void stopNodes(UUID id,
@Nullable
UUID... ids)
throws GridException
GridException - In case of error.id - ID defining node to stop.ids - IDs defining nodes to stop.void stopNodes(Collection<UUID> ids) throws GridException
GridException - In case of error.ids - IDs defining nodes to stop.
void restartNodes(@Nullable
GridPredicate<? super GridRichNode>... p)
throws GridException
GridException - In case of error.p - Optional set of filtering predicates. If none provided - all nodes in this projection
will be restarted.
void restartNodes(UUID id,
@Nullable
UUID... ids)
throws GridException
GridException - In case of error.id - ID defining node to restart.ids - IDs defining nodes to restart.void restartNodes(Collection<UUID> ids) throws GridException
GridException - In case of error.ids - IDs defining nodes to restart.
|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Real Time Big Data
|
|
|