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
ConstructorDescriptionSearchCluster
(String clusterId, double minActivedocsPercentage, 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 TypeMethodDescriptionvoid
addMonitoring
(ClusterMonitor<Node> clusterMonitor) void
Called by the cluster monitor when node state changes to failedcom.yahoo.container.handler.VipStatus
group
(int id) int
boolean
Returns the single, local node we should dispatch queries directly to, or empty if we should not dispatch directly.name()
Name to identify Nodemanagerlong
void
ping
(ClusterMonitor clusterMonitor, Node node, Executor executor) Used by the cluster monitor to manage node statusvoid
Update statistics after a round of issuing pings.void
Called by the cluster monitor when node state changes to working
-
Constructor Details
-
SearchCluster
public SearchCluster(String clusterId, double minActivedocsPercentage, 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:NodeManager
Name to identify Nodemanager- Specified by:
name
in interfaceNodeManager<Node>
-
getVipStatus
public com.yahoo.container.handler.VipStatus getVipStatus() -
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:
working
in interfaceNodeManager<Node>
-
failed
Called by the cluster monitor when node state changes to failed- Specified by:
failed
in interfaceNodeManager<Node>
-
hasInformationAboutAllNodes
public boolean hasInformationAboutAllNodes() -
nonWorkingNodeCount
public long nonWorkingNodeCount() -
ping
Used by the cluster monitor to manage node status- Specified by:
ping
in 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:
pingIterationCompleted
in interfaceNodeManager<Node>
-