Package com.linkedin.venice.meta
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RoutingDataRepository.RoutingDataChangedListener
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
containsKafkaTopic(java.lang.String kafkaTopic)
Whether this repository contains routing data for given kafka topic or not.boolean
doesResourcesExistInIdealState(java.lang.String resource)
Whether the resources names exist in ideal state or not.Instance
getLeaderController()
Query the leader controller of current cluster.long
getLeaderControllerChangeTimeMs()
Timestamp in milliseconds of the last time leader controller changed.Instance
getLeaderInstance(java.lang.String resourceName, int partition)
Given resource name and partition number, return the current leader instance.PartitionAssignment
getPartitionAssignments(java.lang.String kafkaTopic)
Query all partitions allocations that belong to given kafka topic.ResourceAssignment
getResourceAssignment()
boolean
isLiveInstance(java.lang.String instanceId)
void
subscribeRoutingDataChange(java.lang.String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener)
Add a listener on kafka topic to get the notification when routing data is changed.void
unSubscribeRoutingDataChange(java.lang.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 Detail
-
getPartitionAssignments
PartitionAssignment getPartitionAssignments(java.lang.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(java.lang.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(java.lang.String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener)
Add a listener on kafka topic to get the notification when routing data is changed.
-
unSubscribeRoutingDataChange
void unSubscribeRoutingDataChange(java.lang.String kafkaTopic, RoutingDataRepository.RoutingDataChangedListener listener)
Remove the listener for given kafka topic.
-
isLiveInstance
boolean isLiveInstance(java.lang.String instanceId)
-
getResourceAssignment
ResourceAssignment getResourceAssignment()
-
doesResourcesExistInIdealState
boolean doesResourcesExistInIdealState(java.lang.String resource)
Whether the resources names exist in ideal state or not.
-
getLeaderInstance
Instance getLeaderInstance(java.lang.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.
-
-