Class SearchCluster
java.lang.Object
com.yahoo.search.dispatch.searchcluster.SearchCluster
- All Implemented Interfaces:
NodeManager<Node>
A model of a search cluster we might want to dispatch queries to.
- Author:
- bratseth
-
Constructor Summary
ConstructorsConstructorDescriptionSearchCluster(String clusterId, AvailabilityPolicy availabilityPolicy, Collection<Node> nodes, com.yahoo.container.handler.VipStatus vipStatus, PingFactory pingFactory) SearchCluster(String clusterId, SearchGroupsImpl groups, com.yahoo.container.handler.VipStatus vipStatus, PingFactory pingFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMonitoring(ClusterMonitor<Node> clusterMonitor) voidCalled by the cluster monitor when node state changes to failedgroup(int id) intbooleanReturns the single, local node we should dispatch queries directly to, or empty if we should not dispatch directly.name()Name to identify Nodemanagervoidping(ClusterMonitor<Node> clusterMonitor, Node node, Executor executor) Used by the cluster monitor to manage node statusvoidUpdate statistics after a round of issuing pings.voidupdateNodes(AvailabilityPolicy availabilityPolicy, Collection<Node> newNodes, ClusterMonitor<Node> monitor) Sets the new nodes to monitor to be the new nodes, but keep any existing node instances which are equal the new ones.voidCalled by the cluster monitor when node state changes to working
-
Constructor Details
-
SearchCluster
public SearchCluster(String clusterId, AvailabilityPolicy availabilityPolicy, Collection<Node> nodes, com.yahoo.container.handler.VipStatus vipStatus, PingFactory pingFactory) -
SearchCluster
public SearchCluster(String clusterId, SearchGroupsImpl groups, com.yahoo.container.handler.VipStatus vipStatus, PingFactory pingFactory)
-
-
Method Details
-
name
Description copied from interface:NodeManagerName to identify Nodemanager- Specified by:
namein interfaceNodeManager<Node>
-
updateNodes
public void updateNodes(AvailabilityPolicy availabilityPolicy, Collection<Node> newNodes, ClusterMonitor<Node> monitor) Sets the new nodes to monitor to be the new nodes, but keep any existing node instances which are equal the new ones. -
addMonitoring
-
groupList
-
group
-
groupsWithSufficientCoverage
public int groupsWithSufficientCoverage() -
localCorpusDispatchTarget
Returns the single, local node we should dispatch queries directly to, or empty if we should not dispatch directly. -
working
Called by the cluster monitor when node state changes to working- Specified by:
workingin interfaceNodeManager<Node>
-
failed
Called by the cluster monitor when node state changes to failed- Specified by:
failedin interfaceNodeManager<Node>
-
hasInformationAboutAllNodes
public boolean hasInformationAboutAllNodes() -
ping
Used by the cluster monitor to manage node status- Specified by:
pingin interfaceNodeManager<Node>
-
pingIterationCompleted
public void pingIterationCompleted()Update statistics after a round of issuing pings. Note that this doesn't wait for pings to return, so it will typically accumulate data from last rounds pinging, or potentially (although unlikely) some combination of new and old data.- Specified by:
pingIterationCompletedin interfaceNodeManager<Node>
-