public class

ResourceAssignmentBuilder

extends Object
java.lang.Object
   ↳ org.apache.helix.model.builder.ResourceAssignmentBuilder

Class Overview

Build an ideal assignment of resources

Summary

Public Constructors
ResourceAssignmentBuilder(ResourceId resourceId)
Create an assignment for a given resource
Public Methods
ResourceAssignmentBuilder addAssignment(PartitionId partitonId, ParticipantId participantId, State state)
Add a single replica assignment
ResourceAssignmentBuilder addAssignments(PartitionId partitionId, Map<ParticipantIdState> replicaMap)
Add multiple assignments of partition replicas
ResourceAssignment build()
Get a complete resource assignment
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ResourceAssignmentBuilder (ResourceId resourceId)

Create an assignment for a given resource

Parameters
resourceId resource id

Public Methods

public ResourceAssignmentBuilder addAssignment (PartitionId partitonId, ParticipantId participantId, State state)

Add a single replica assignment

Parameters
partitonId the partition to assign
participantId participant of assignment
state replica state
Returns
  • ResourceAssignmentBuilder

public ResourceAssignmentBuilder addAssignments (PartitionId partitionId, Map<ParticipantIdState> replicaMap)

Add multiple assignments of partition replicas

Parameters
partitionId the partition to assign
replicaMap participant-state map of assignments
Returns
  • ResourceAssignmentBuilder

public ResourceAssignment build ()

Get a complete resource assignment

Returns
  • ResourceAssignment