public static abstract class

PartitionedRebalancerConfig.AbstractBuilder

extends BasicRebalancerConfig.AbstractBuilder<T extends AbstractBuilder<T>>
java.lang.Object
   ↳ org.apache.helix.controller.rebalancer.config.BasicRebalancerConfig.AbstractBuilder<T extends org.apache.helix.controller.rebalancer.config.BasicRebalancerConfig.AbstractBuilder<T>>
     ↳ org.apache.helix.controller.rebalancer.config.PartitionedRebalancerConfig.AbstractBuilder<T extends org.apache.helix.controller.rebalancer.config.BasicRebalancerConfig.AbstractBuilder<T>>
Known Direct Subclasses

Class Overview

Abstract builder for a generic partitioned resource rebalancer config

Summary

Public Constructors
PartitionedRebalancerConfig.AbstractBuilder(ResourceId resourceId)
Instantiate with a resource
Public Methods
T addPartition(Partition partition)
Add a partition that the resource serves
T addPartitions(int partitionCount)
Add a specified number of partitions with a default naming scheme, namely resourceId_partitionNumber where partitionNumber starts at 0
T addPartitions(Collection<Partition> partitions)
Add a collection of partitions
T anyLiveParticipant(boolean anyLiveParticipant)
Set whether any live participant should be used in rebalancing
T maxPartitionsPerParticipant(int maxPartitionsPerParticipant)
Set the maximum number of partitions to assign to any participant
T rebalanceMode(IdealState.RebalanceMode rebalanceMode)
Set the rebalance mode for a partitioned rebalancer config
T replicaCount(int replicaCount)
Set the number of replicas
Protected Methods
final void update(PartitionedRebalancerConfig config)
Update a PartitionedRebalancerConfig with fields from this builder level
[Expand]
Inherited Methods
From class org.apache.helix.controller.rebalancer.config.BasicRebalancerConfig.AbstractBuilder
From class java.lang.Object

Public Constructors

public PartitionedRebalancerConfig.AbstractBuilder (ResourceId resourceId)

Instantiate with a resource

Parameters
resourceId resource id

Public Methods

public T addPartition (Partition partition)

Add a partition that the resource serves

Parameters
partition fully-qualified partition
Returns
  • Builder

public T addPartitions (int partitionCount)

Add a specified number of partitions with a default naming scheme, namely resourceId_partitionNumber where partitionNumber starts at 0

Parameters
partitionCount number of partitions to add
Returns
  • Builder

public T addPartitions (Collection<Partition> partitions)

Add a collection of partitions

Parameters
partitions any collection of Partition objects
Returns
  • Builder

public T anyLiveParticipant (boolean anyLiveParticipant)

Set whether any live participant should be used in rebalancing

Parameters
anyLiveParticipant true if any live participant can be used, false otherwise
Returns
  • Builder

public T maxPartitionsPerParticipant (int maxPartitionsPerParticipant)

Set the maximum number of partitions to assign to any participant

Parameters
maxPartitionsPerParticipant the maximum
Returns
  • Builder

public T rebalanceMode (IdealState.RebalanceMode rebalanceMode)

Set the rebalance mode for a partitioned rebalancer config

Parameters
rebalanceMode IdealState.RebalanceMode enum value
Returns
  • Builder

public T replicaCount (int replicaCount)

Set the number of replicas

Parameters
replicaCount number of replicas
Returns
  • Builder

Protected Methods

protected final void update (PartitionedRebalancerConfig config)

Update a PartitionedRebalancerConfig with fields from this builder level

Parameters
config PartitionedRebalancerConfig