public class ClusterMonitor extends Object implements Runnable, com.yahoo.component.provider.Freezable
Modifier and Type | Field and Description |
---|---|
private MonitorConfiguration |
configuration |
private ScheduledFuture<?> |
future |
private boolean |
isFrozen |
private static Logger |
log |
private ClusterSearcher |
nodeManager |
private Map<VespaBackEndSearcher,NodeMonitor> |
nodeMonitors
A map from Node to corresponding MonitoredNode
|
private static int |
pingThreadInitialDelayMs |
private Optional<com.yahoo.container.handler.VipStatus> |
vipStatus |
Constructor and Description |
---|
ClusterMonitor(ClusterSearcher manager,
QrMonitorConfig monitorConfig,
Optional<com.yahoo.container.handler.VipStatus> vipStatus) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(VespaBackEndSearcher node)
Adds a new node for monitoring.
|
(package private) void |
failed(VespaBackEndSearcher node,
ErrorMessage error)
Called from ClusterSearcher/NodeManager when a node failed
|
void |
freeze() |
(package private) MonitorConfiguration |
getConfiguration()
Returns the configuration of this cluster monitor
|
private boolean |
hasInformationAboutAllNodes() |
private boolean |
hasWorkingNodesWithDocumentsOnline() |
boolean |
isFrozen() |
private void |
ping()
Ping all nodes which needs pinging to discover state changes
|
(package private) void |
responded(VespaBackEndSearcher node,
boolean hasSearchNodesOnline)
Called when a node responded
|
void |
run() |
void |
shutdown() |
(package private) void |
startPingThread() |
private void |
updateVipStatus() |
private static final int pingThreadInitialDelayMs
private final MonitorConfiguration configuration
private static final Logger log
private final ClusterSearcher nodeManager
private final Optional<com.yahoo.container.handler.VipStatus> vipStatus
private final Map<VespaBackEndSearcher,NodeMonitor> nodeMonitors
private ScheduledFuture<?> future
private boolean isFrozen
ClusterMonitor(ClusterSearcher manager, QrMonitorConfig monitorConfig, Optional<com.yahoo.container.handler.VipStatus> vipStatus)
MonitorConfiguration getConfiguration()
void startPingThread()
void add(VespaBackEndSearcher node)
void failed(VespaBackEndSearcher node, ErrorMessage error)
void responded(VespaBackEndSearcher node, boolean hasSearchNodesOnline)
private void updateVipStatus()
private boolean hasInformationAboutAllNodes()
private boolean hasWorkingNodesWithDocumentsOnline()
private void ping() throws InterruptedException
InterruptedException
public void shutdown()
public void freeze()
freeze
in interface com.yahoo.component.provider.Freezable
public boolean isFrozen()
isFrozen
in interface com.yahoo.component.provider.Freezable
Copyright © 2018. All rights reserved.