Package com.linkedin.venice.meta
Interface RoutingDataRepository
- All Superinterfaces:
OnlineInstanceFinder
,VeniceResource
- All Known Implementing Classes:
HelixBaseRoutingRepository
,HelixCustomizedViewOfflinePushRepository
,HelixExternalViewRepository
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.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKafkaTopic
(String kafkaTopic) Whether this repository contains routing data for given kafka topic or not.boolean
doesResourcesExistInIdealState
(String resource) Whether the resources names exist in ideal state or not.Query the leader controller of current cluster.long
Timestamp in milliseconds of the last time leader controller changed.getLeaderInstance
(String resourceName, int partition) Given resource name and partition number, return the current leader instance.getPartitionAssignments
(String kafkaTopic) Query all partitions allocations that belong to given kafka topic.boolean
isLiveInstance
(String instanceId) void
subscribeRoutingDataChange
(String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener) Add a listener on kafka topic to get the notification when routing data is changed.void
unSubscribeRoutingDataChange
(String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener) Remove the listener for given kafka topic.Methods inherited from interface com.linkedin.venice.meta.OnlineInstanceFinder
getAllInstances, getNumberOfPartitions, getReadyToServeInstances, getReadyToServeInstances, getWorkingInstances
Methods inherited from interface com.linkedin.venice.VeniceResource
clear, refresh
-
Method Details
-
getPartitionAssignments
Query all partitions allocations that belong to given kafka topic. The instances in returned allocations are ready to serve OR being bootstrap. -
containsKafkaTopic
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
-
getResourceAssignment
ResourceAssignment getResourceAssignment() -
doesResourcesExistInIdealState
Whether the resources names exist in ideal state or not. -
getLeaderInstance
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.
-