Package org.apache.ignite.internal
Enum GridClosureCallMode
- java.lang.Object
-
- java.lang.Enum<GridClosureCallMode>
-
- org.apache.ignite.internal.GridClosureCallMode
-
- All Implemented Interfaces:
Serializable
,Comparable<GridClosureCallMode>
public enum GridClosureCallMode extends Enum<GridClosureCallMode>
Distribution modes for one or more closures executed viaGrid.call(...)
methods. In other words, given a set of jobs (closures) and set of grid nodes this enumeration provides three simple modes of how these jobs will be mapped to the nodes.Note that if you need to provide custom distribution logic you need to implement
ComputeTask
interface that allows you to customize every aspect of a distributed Java code execution such as mapping, load balancing, failover, collision resolution, continuations, etc.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable GridClosureCallMode
fromOrdinal(byte ord)
Efficiently gets enumerated value from its ordinal.static GridClosureCallMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static GridClosureCallMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BROADCAST
public static final GridClosureCallMode BROADCAST
In this mode all closures will be executed on each node. This mode essentially allows to broadcast executions to all nodes.
-
BALANCE
public static final GridClosureCallMode BALANCE
In this mode closures will be executed on the nodes provided by the default load balancer.NOTE: this mode must be used for all cache affinity routing. Load balance manager has specific logic to handle co-location between compute grid jobs and in-memory data grid data. All other modes will not work for affinity-based co-location.
-
-
Method Detail
-
values
public static GridClosureCallMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GridClosureCallMode c : GridClosureCallMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GridClosureCallMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromOrdinal
@Nullable public static @Nullable GridClosureCallMode fromOrdinal(byte ord)
Efficiently gets enumerated value from its ordinal.- Parameters:
ord
- Ordinal value.- Returns:
- Enumerated value.
-
-