Interface OnlineInstanceFinder

All Known Subinterfaces:
RoutingDataRepository
All Known Implementing Classes:
HelixBaseRoutingRepository, HelixCustomizedViewOfflinePushRepository, HelixExternalViewRepository

public interface OnlineInstanceFinder
Look up online instances related to a topic's partition. It's used in Venice router to help route requests to a certain host. Check out VeniceVersionFinder and VeniceHostFinder for more details. Currently, there are 2 implementations based on different sources of metadata: 1. HelixCustomizedViewOfflinePushRepository used in Router. 2. HelixExternalViewRepository used in Controller and Server.
  • Method Details

    • getReadyToServeInstances

      List<Instance> getReadyToServeInstances(String kafkaTopic, int partitionId)
      Query instances that belong to given kafka topic and partition. All of instances in result are ready to serve.
    • getReadyToServeInstances

      List<Instance> getReadyToServeInstances(PartitionAssignment partitionAssignment, int partitionId)
      Look for ready to serve instances on the given partition assignment. This is normally used to predict if a potential partition assignment will cause any replica unavailability issue
    • getWorkingInstances

      List<Instance> getWorkingInstances(String kafkaTopic, int partitionId)
      Query instances that are online (in leader or follower state), but not necessarily ready to serve yet.
    • getAllInstances

      Map<ExecutionStatus,List<Instance>> getAllInstances(String kafkaTopic, int partitionId)
      Query instances that belong to given kafka topic and partition.
      Returns:
      a map that has HelixState as the key and list of instances as the value
    • getNumberOfPartitions

      int getNumberOfPartitions(String kafkaTopic)
      Query number of partition in given kafka topic.