Class Partition

java.lang.Object
com.linkedin.venice.meta.Partition

public class Partition extends Object
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 Details

  • Method Details

    • getInstancesInState

      public List<Instance> getInstancesInState(ExecutionStatus state)
    • getInstancesInState

      public List<Instance> getInstancesInState(HelixState state)
    • getReadyToServeInstances

      public List<Instance> getReadyToServeInstances()
    • getWorkingInstances

      public List<Instance> getWorkingInstances()
    • getErrorInstances

      public List<Instance> getErrorInstances()
    • getLeaderInstance

      public Instance getLeaderInstance()
    • getAllInstancesSet

      public Set<Instance> getAllInstancesSet()
    • getAllInstancesByHelixState

      public Map<HelixState,List<Instance>> getAllInstancesByHelixState()
    • getAllInstancesByExecutionStatus

      public EnumMap<ExecutionStatus,List<Instance>> getAllInstancesByExecutionStatus()
    • getInstanceToHelixStateMap

      public Map<Instance,HelixState> getInstanceToHelixStateMap()
    • getHelixStateByInstanceId

      public HelixState getHelixStateByInstanceId(String instanceId)
      Find the status of given instance in this partition.
    • getExecutionStatusByInstanceId

      public ExecutionStatus getExecutionStatusByInstanceId(String instanceId)
    • getNumOfTotalInstances

      public int getNumOfTotalInstances()
    • withRemovedInstance

      public Partition withRemovedInstance(String instanceId)
      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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object