Package com.linkedin.venice.meta
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 Summary
Modifier and TypeMethodDescriptiongetAllInstances
(String kafkaTopic, int partitionId) Query instances that belong to given kafka topic and partition.int
getNumberOfPartitions
(String kafkaTopic) Query number of partition in given kafka topic.getReadyToServeInstances
(PartitionAssignment partitionAssignment, int partitionId) Look for ready to serve instances on the given partition assignment.getReadyToServeInstances
(String kafkaTopic, int partitionId) Query instances that belong to given kafka topic and partition.getWorkingInstances
(String kafkaTopic, int partitionId) Query instances that are online (in leader or follower state), but not necessarily ready to serve yet.
-
Method Details
-
getReadyToServeInstances
Query instances that belong to given kafka topic and partition. All of instances in result are ready to serve. -
getReadyToServeInstances
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
Query instances that are online (in leader or follower state), but not necessarily ready to serve yet. -
getAllInstances
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
Query number of partition in given kafka topic.
-