Package com.linkedin.venice.meta
Class Partition
java.lang.Object
com.linkedin.venice.meta.Partition
Class defines the partition in Venice.
Partition is a logic unit to distribute the data in Venice cluster. Each resource(Store Version) will be assigned to a set of partition so that data in this resource will be distributed averagely in ideal. Each partition contains 1 or multiple replica which hold the same data in ideal.
In Helix Full-auto model, Helix manager is responsible to assign partitions to nodes. So here partition is read-only. In the future, if Venice need more flexibility to manage cluster, some update/delete methods could be added here.
-
Constructor Summary
ConstructorsConstructorDescriptionPartition(int id, EnumMap<HelixState, List<Instance>> helixStateToInstancesMap, EnumMap<ExecutionStatus, List<Instance>> executionStatusToInstancesMap) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetExecutionStatusByInstanceId(String instanceId) getHelixStateByInstanceId(String instanceId) Find the status of given instance in this partition.intgetId()getInstancesInState(HelixState state) intinthashCode()toString()withRemovedInstance(String instanceId) Remove the given instance from this partition.
-
Constructor Details
-
Partition
public Partition(int id, EnumMap<HelixState, List<Instance>> helixStateToInstancesMap, EnumMap<ExecutionStatus, List<Instance>> executionStatusToInstancesMap)
-
-
Method Details
-
getInstancesInState
-
getInstancesInState
-
getReadyToServeInstances
-
getWorkingInstances
-
getErrorInstances
-
getLeaderInstance
-
getAllInstancesSet
-
getAllInstancesByHelixState
-
getAllInstancesByExecutionStatus
-
getInstanceToHelixStateMap
-
getHelixStateByInstanceId
Find the status of given instance in this partition. -
getExecutionStatusByInstanceId
-
getNumOfTotalInstances
public int getNumOfTotalInstances() -
withRemovedInstance
Remove the given instance from this partition. As partition is an immutable object, so we return a new partition after removing. -
getId
public int getId() -
toString
-
equals
-
hashCode
public int hashCode()
-