java.lang.Object | ||
↳ | org.apache.helix.HelixProperty | |
↳ | org.apache.helix.model.ResourceAssignment |
Represents the assignments of replicas for an entire resource, keyed on partitions of the
resource. Each partition has its replicas assigned to a node, and each replica is in a state.
For example, if there is a partition p with 2 replicas, a valid assignment is:
p: {(n1, s1), (n2, s2)}
This means one replica of p is located at node n1 and is in state s1, and another is in node n2
and is in state s2. n1 cannot be equal to n2, but s1 can be equal to s2 if at least two replicas
can be in s1.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initialize an empty mapping
| |||||||||||
Instantiate from a record.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add participant, state pairs for a partition
| |||||||||||
Get the currently mapped partitions
| |||||||||||
Get the participant, state pairs for a partition
| |||||||||||
Get the resource for which this assignment was created
| |||||||||||
Get the entire map of a resource
| |||||||||||
Helper for converting a map of strings to a concrete replica map
| |||||||||||
Convert a full replica mapping as strings into participant state maps
| |||||||||||
Helper for converting a replica map to a map of strings
| |||||||||||
Convert a full state mapping into a mapping of string names
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Initialize an empty mapping
resourceId | the resource being mapped |
---|
Instantiate from a record. This supports reading the assignment directly from the backing store
record | backing record |
---|
Add participant, state pairs for a partition
partitionId | the partition to set |
---|---|
replicaMap | map of (participant name, state) |
Get the currently mapped partitions
Get the participant, state pairs for a partition
Get the resource for which this assignment was created
Get the entire map of a resource
Helper for converting a map of strings to a concrete replica map
rawMap | map of participant name to state name |
---|
Convert a full replica mapping as strings into participant state maps
rawMaps | the map of partition name to participant name and state |
---|
Helper for converting a replica map to a map of strings
replicaMap | map of participant id to state |
---|
Convert a full state mapping into a mapping of string names
replicaMaps | the map of partition id to participant id and state |
---|