@Beta public class SearchCluster extends Object implements NodeManager<SearchCluster.Node>
Modifier and Type | Class and Description |
---|---|
static class |
SearchCluster.Group
A group in a search cluster.
|
static class |
SearchCluster.Node
A node in a search cluster.
|
private class |
SearchCluster.Pinger |
Modifier and Type | Field and Description |
---|---|
private ClusterMonitor<SearchCluster.Node> |
clusterMonitor |
private Optional<SearchCluster.Node> |
directDispatchTarget
A search node on this local machine having the entire corpus, which we therefore
should prefer to dispatch directly to, or empty if there is no such local search node.
|
private FS4ResourcePool |
fs4ResourcePool |
private com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> |
groups |
private static Logger |
log |
private double |
minActivedocsCoveragePercentage
The min active docs a group must have to be considered up, as a % of the average active docs of the other groups
|
private com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> |
nodesByHost |
private int |
size |
private com.yahoo.container.handler.VipStatus |
vipStatus |
Constructor and Description |
---|
SearchCluster(com.yahoo.vespa.config.search.DispatchConfig dispatchConfig,
FS4ResourcePool fs4ResourcePool,
int containerClusterSize,
com.yahoo.container.handler.VipStatus vipStatus) |
SearchCluster(double minActivedocsCoverage,
List<SearchCluster.Node> nodes,
FS4ResourcePool fs4ResourcePool,
int containerClusterSize,
com.yahoo.container.handler.VipStatus vipStatus) |
Modifier and Type | Method and Description |
---|---|
Optional<SearchCluster.Node> |
directDispatchTarget()
Returns the recipient we should dispatch queries directly to (bypassing fdispatch),
or empty if we should not dispatch directly.
|
void |
failed(SearchCluster.Node node)
Used by the cluster monitor to manage node status
|
private static Optional<SearchCluster.Node> |
findDirectDispatchTarget(String selfHostname,
int searchClusterSize,
int containerClusterSize,
com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> nodesByHost,
com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> groups) |
private Pong |
getPong(FutureTask<Pong> futurePong,
SearchCluster.Node node) |
com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> |
groups()
Returns the groups of this cluster as an immutable map indexed by group id
|
int |
groupSize()
Returns the number of nodes per group - size()/groups.size()
|
com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> |
nodesByHost()
Returns the nodes of this cluster as an immutable map indexed by host.
|
void |
ping(SearchCluster.Node node,
Executor executor)
Used by the cluster monitor to manage node status
|
void |
pingIterationCompleted()
Update statistics after a round of issuing pings.
|
int |
size()
Returns the number of nodes in this cluster (across all groups)
|
private static com.google.common.collect.ImmutableList<SearchCluster.Node> |
toNodes(com.yahoo.vespa.config.search.DispatchConfig dispatchConfig) |
private void |
updateSufficientCoverage(SearchCluster.Group group,
boolean sufficientCoverage) |
private boolean |
usesDirectDispatchTo(SearchCluster.Group group) |
private boolean |
usesDirectDispatchTo(SearchCluster.Node node) |
void |
working(SearchCluster.Node node)
Used by the cluster monitor to manage node status
|
private static final Logger log
private double minActivedocsCoveragePercentage
private final int size
private final com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> groups
private final com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> nodesByHost
private final ClusterMonitor<SearchCluster.Node> clusterMonitor
private final com.yahoo.container.handler.VipStatus vipStatus
private final Optional<SearchCluster.Node> directDispatchTarget
private final FS4ResourcePool fs4ResourcePool
public SearchCluster(com.yahoo.vespa.config.search.DispatchConfig dispatchConfig, FS4ResourcePool fs4ResourcePool, int containerClusterSize, com.yahoo.container.handler.VipStatus vipStatus)
public SearchCluster(double minActivedocsCoverage, List<SearchCluster.Node> nodes, FS4ResourcePool fs4ResourcePool, int containerClusterSize, com.yahoo.container.handler.VipStatus vipStatus)
private static Optional<SearchCluster.Node> findDirectDispatchTarget(String selfHostname, int searchClusterSize, int containerClusterSize, com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> nodesByHost, com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> groups)
private static com.google.common.collect.ImmutableList<SearchCluster.Node> toNodes(com.yahoo.vespa.config.search.DispatchConfig dispatchConfig)
public int size()
public com.google.common.collect.ImmutableMap<Integer,SearchCluster.Group> groups()
public int groupSize()
public com.google.common.collect.ImmutableMultimap<String,SearchCluster.Node> nodesByHost()
public Optional<SearchCluster.Node> directDispatchTarget()
public void working(SearchCluster.Node node)
working
in interface NodeManager<SearchCluster.Node>
public void failed(SearchCluster.Node node)
failed
in interface NodeManager<SearchCluster.Node>
private void updateSufficientCoverage(SearchCluster.Group group, boolean sufficientCoverage)
private boolean usesDirectDispatchTo(SearchCluster.Node node)
private boolean usesDirectDispatchTo(SearchCluster.Group group)
public void ping(SearchCluster.Node node, Executor executor)
ping
in interface NodeManager<SearchCluster.Node>
public void pingIterationCompleted()
pingIterationCompleted
in interface NodeManager<SearchCluster.Node>
private Pong getPong(FutureTask<Pong> futurePong, SearchCluster.Node node)
Copyright © 2018. All rights reserved.