Class NodeAllocationState

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:
  • Method Details

    • 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 by NodeAllocationState.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