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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<ExecutionStatus,java.util.List<Instance>>
getAllInstances(java.lang.String kafkaTopic, int partitionId)
Query instances that belong to given kafka topic and partition.int
getNumberOfPartitions(java.lang.String kafkaTopic)
Query number of partition in given kafka topic.java.util.List<Instance>
getReadyToServeInstances(PartitionAssignment partitionAssignment, int partitionId)
Look for ready to serve instances on the given partition assignment.java.util.List<Instance>
getReadyToServeInstances(java.lang.String kafkaTopic, int partitionId)
Query instances that belong to given kafka topic and partition.java.util.List<Instance>
getWorkingInstances(java.lang.String kafkaTopic, int partitionId)
Query instances that are online (in leader or follower state), but not necessarily ready to serve yet.
-
-
-
Method Detail
-
getReadyToServeInstances
java.util.List<Instance> getReadyToServeInstances(java.lang.String kafkaTopic, int partitionId)
Query instances that belong to given kafka topic and partition. All of instances in result are ready to serve.
-
getReadyToServeInstances
java.util.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
java.util.List<Instance> getWorkingInstances(java.lang.String kafkaTopic, int partitionId)
Query instances that are online (in leader or follower state), but not necessarily ready to serve yet.
-
getAllInstances
java.util.Map<ExecutionStatus,java.util.List<Instance>> getAllInstances(java.lang.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(java.lang.String kafkaTopic)
Query number of partition in given kafka topic.
-
-