Interface RoutingDataRepository

All Superinterfaces:
OnlineInstanceFinder, VeniceResource
All Known Implementing Classes:
HelixBaseRoutingRepository, HelixCustomizedViewOfflinePushRepository, HelixExternalViewRepository

public interface RoutingDataRepository extends VeniceResource, OnlineInstanceFinder
Repository to access routing data like Partition and replica.

In Helix Full-auto model, Helix manage how to assign partitions to nodes. So here repository is read-only. In the further, if Venice need more flexibility to manage cluster, some update/delete methods could be added here.

  • Method Details

    • getPartitionAssignments

      PartitionAssignment getPartitionAssignments(String kafkaTopic)
      Query all partitions allocations that belong to given kafka topic. The instances in returned allocations are ready to serve OR being bootstrap.
    • containsKafkaTopic

      boolean containsKafkaTopic(String kafkaTopic)
      Whether this repository contains routing data for given kafka topic or not.
    • getLeaderController

      Instance getLeaderController()
      Query the leader controller of current cluster.
    • getLeaderControllerChangeTimeMs

      long getLeaderControllerChangeTimeMs()
      Timestamp in milliseconds of the last time leader controller changed.
    • subscribeRoutingDataChange

      void subscribeRoutingDataChange(String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener)
      Add a listener on kafka topic to get the notification when routing data is changed.
    • unSubscribeRoutingDataChange

      void unSubscribeRoutingDataChange(String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener)
      Remove the listener for given kafka topic.
    • isLiveInstance

      boolean isLiveInstance(String instanceId)
    • getResourceAssignment

      ResourceAssignment getResourceAssignment()
    • doesResourcesExistInIdealState

      boolean doesResourcesExistInIdealState(String resource)
      Whether the resources names exist in ideal state or not.
    • getLeaderInstance

      Instance getLeaderInstance(String resourceName, int partition)
      Given resource name and partition number, return the current leader instance.
      Returns:
      the current leader instance. Null if there is no leader/the resource doesn't use L/F model/resource doesn't exist.