public class

FixedTargetTaskRebalancer

extends TaskRebalancer
java.lang.Object
   ↳ org.apache.helix.task.TaskRebalancer
     ↳ org.apache.helix.task.FixedTargetTaskRebalancer

Class Overview

A rebalancer for when a task group must be assigned according to partitions/states on a target resource. Here, tasks are colocated according to where a resource's partitions are, as well as (if desired) only where those partitions are in a given state.

Summary

Public Constructors
FixedTargetTaskRebalancer()
Public Methods
Set<Integer> getAllTaskPartitions(JobConfig jobCfg, JobContext jobCtx, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Cluster cache)
Get all the partitions that should be created by this task
Map<ParticipantIdSortedSet<Integer>> getTaskAssignment(ResourceCurrentState currStateOutput, ResourceAssignment prevAssignment, Collection<ParticipantId> instances, JobConfig jobCfg, JobContext jobContext, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Set<Integer> partitionSet, Cluster cache)
Compute an assignment of tasks to instances
[Expand]
Inherited Methods
From class org.apache.helix.task.TaskRebalancer
From class java.lang.Object
From interface org.apache.helix.controller.rebalancer.HelixRebalancer

Public Constructors

public FixedTargetTaskRebalancer ()

Public Methods

public Set<Integer> getAllTaskPartitions (JobConfig jobCfg, JobContext jobCtx, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Cluster cache)

Get all the partitions that should be created by this task

Parameters
jobCfg the task configuration
jobCtx the task context
workflowCfg the workflow configuration
workflowCtx the workflow context
cache cluster snapshot
Returns
  • set of partition numbers

public Map<ParticipantIdSortedSet<Integer>> getTaskAssignment (ResourceCurrentState currStateOutput, ResourceAssignment prevAssignment, Collection<ParticipantId> instances, JobConfig jobCfg, JobContext jobContext, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Set<Integer> partitionSet, Cluster cache)

Compute an assignment of tasks to instances

Parameters
currStateOutput the current state of the instances
prevAssignment the previous task partition assignment
jobCfg the task configuration
workflowCfg the workflow configuration
workflowCtx the workflow context
partitionSet the partitions to assign
cache cluster snapshot
Returns
  • map of instances to set of partition numbers