- java.lang.Object
-
- com.pervasive.datarush.cal.NodeAllocationState
-
- All Implemented Interfaces:
Serializable
public final class NodeAllocationState extends Object implements Serializable
Reflects the current state of node allocation, which takes into account failed nodes.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeAllocationState.AssignmentState
Assignment details for a particular node ID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NodeAllocationState.AssignmentState>
getAssignments()
Returns a list of assignments in this node allocation.Map<String,List<NodeAllocationState.AssignmentState>>
getGroupedAssignments()
returns assignments, grouped by current physical node idString
getJobMasterNodeId()
Returns the physical node id of the job master.ResourceAllocation
getPerPartitionResources()
Gets the per-partition resource allocation.static NodeAllocationState
initial(NodeAllocationPlan plan)
Creates the initial NodeAllocationState based on the plan.NodeAllocationState
reallocate(String failedNode)
Utility to re-allocate the work of a failed node to the other nodes in the cluster.
-
-
-
Method Detail
-
initial
public static NodeAllocationState initial(NodeAllocationPlan plan)
Creates the initial NodeAllocationState based on the plan.- Parameters:
plan
- the initial allocation plam- Returns:
- the initial state
-
getJobMasterNodeId
public String getJobMasterNodeId()
Returns the physical node id of the job master. This will return null in the pseudo-distributed case.- Returns:
- the physical node id of the job master
-
getAssignments
public List<NodeAllocationState.AssignmentState> getAssignments()
Returns a list of assignments in this node allocation. Assignments are sorted byNodeAllocationState.AssignmentState.getPartitionID()
.- Returns:
- a list of assignments
-
reallocate
public NodeAllocationState reallocate(String failedNode)
Utility to re-allocate the work of a failed node to the other nodes in the cluster.- Parameters:
failedNode
- the failed node- Returns:
- a new NodeAllocation
-
getGroupedAssignments
public Map<String,List<NodeAllocationState.AssignmentState>> getGroupedAssignments()
returns assignments, grouped by current physical node id- Returns:
- assignments, grouped by current physical node id
-
getPerPartitionResources
public ResourceAllocation getPerPartitionResources()
Gets the per-partition resource allocation.- Returns:
- the resources alloted to each partition
-
-