public class

GenericTaskRebalancer

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

Class Overview

This class does an assignment based on an automatic rebalancing strategy, rather than requiring assignment to target partitions and states of another resource

Summary

Nested Classes
interface GenericTaskRebalancer.RetryPolicy  
Public Constructors
GenericTaskRebalancer()
Public Methods
Set<Integer> getAllTaskPartitions(JobConfig jobCfg, JobContext jobCtx, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, ClusterDataCache cache)
Get all the partitions that should be created by this task
Map<StringSortedSet<Integer>> getTaskAssignment(CurrentStateOutput currStateOutput, ResourceAssignment prevAssignment, Collection<String> instances, JobConfig jobCfg, JobContext jobContext, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Set<Integer> partitionSet, ClusterDataCache 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.Rebalancer
From interface org.apache.helix.controller.rebalancer.internal.MappingCalculator

Public Constructors

public GenericTaskRebalancer ()

Public Methods

public Set<Integer> getAllTaskPartitions (JobConfig jobCfg, JobContext jobCtx, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, ClusterDataCache 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<StringSortedSet<Integer>> getTaskAssignment (CurrentStateOutput currStateOutput, ResourceAssignment prevAssignment, Collection<String> instances, JobConfig jobCfg, JobContext jobContext, WorkflowConfig workflowCfg, WorkflowContext workflowCtx, Set<Integer> partitionSet, ClusterDataCache cache)

Compute an assignment of tasks to instances

Parameters
currStateOutput the current state of the instances
prevAssignment the previous task partition assignment
instances the instances
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