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, com.yahoo.vespa.config.search.DispatchConfig dispatchConfig, com.yahoo.container.handler.VipStatus vipStatus, PingFactory pingFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMonitoring
(ClusterMonitor<Node> clusterMonitor) boolean
com.yahoo.vespa.config.search.DispatchConfig
int
estimateHitsToFetch
(int wantedHits, int numPartitions) int
estimateHitsToFetch
(int wantedHits, int numPartitions, double topKProbability) void
Called by the cluster monitor when node state changes to failedgroup
(int n) Returns the n'th (zero-indexed) group in the cluster if possiblegroups()
Returns the groups of this cluster as an immutable map indexed by group idint
boolean
boolean
isPartialGroupCoverageSufficient
(List<Node> nodes) Calculate whether a subset of nodes in a group has enough coverageReturns the single, local node we should dispatch queries directly to, or empty if we should not dispatch directly.name()
Name to identify Nodemanagernodes()
Returns an immutable list of all nodes in this.Returns the groups of this cluster as an immutable list in introduction ordervoid
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, com.yahoo.vespa.config.search.DispatchConfig dispatchConfig, 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>
-
addMonitoring
-
dispatchConfig
public com.yahoo.vespa.config.search.DispatchConfig dispatchConfig() -
nodes
Returns an immutable list of all nodes in this. -
groups
Returns the groups of this cluster as an immutable map indexed by group id -
orderedGroups
Returns the groups of this cluster as an immutable list in introduction order -
group
Returns the n'th (zero-indexed) group in the cluster if possible -
allGroupsHaveSize1
public boolean allGroupsHaveSize1() -
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>
-
estimateHitsToFetch
public int estimateHitsToFetch(int wantedHits, int numPartitions) -
estimateHitsToFetch
public int estimateHitsToFetch(int wantedHits, int numPartitions, double topKProbability) -
hasInformationAboutAllNodes
public boolean hasInformationAboutAllNodes() -
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>
-
isPartialGroupCoverageSufficient
Calculate whether a subset of nodes in a group has enough coverage
-