public class ProbeWorker extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected Probe |
currentProbe |
static String |
FAILED_TO_BOOT |
static String |
FAILURE_OF_A_LIVE_PROBE_DURING_BOOTSTRAPPING |
int |
interval |
protected ProbeStatus |
lastFailingBootstrapProbe |
protected ProbeStatus |
lastStatus |
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
ProbeWorker(List<Probe> monitorProbes,
List<Probe> dependencyProbes,
int interval,
int bootstrapTimeout)
Create a probe worker
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndReportBootstrapProbes()
run through all the bootstrap probes and see if they are live.
|
boolean |
checkAndReportDependencyProbes()
Run through all the dependency probes and report their outcomes successes (even if they fail)
|
protected void |
checkAndReportLiveProbes()
run through all the live probes, pinging and reporting them.
|
protected void |
executeProbePhases()
Run the set of probes relevant for this phase of the probe lifecycle.
|
int |
getBootstrapTimeout() |
Probe |
getCurrentProbe() |
ProbeStatus |
getLastStatus() |
ProbePhase |
getProbePhase() |
void |
init() |
boolean |
isBootstrapTimeExceeded()
predicate that gets current time and checks for its time being exceeded.
|
protected void |
probeFailed(ProbeFailedException e) |
void |
run() |
void |
setMustExit() |
void |
setReportHandler(ProbeReportHandler reportHandler) |
void |
verifyBootstrapHasNotTimedOut()
This checks that bootstrap operations have not timed out
|
protected static final org.slf4j.Logger log
public static final String FAILED_TO_BOOT
public static final String FAILURE_OF_A_LIVE_PROBE_DURING_BOOTSTRAPPING
public final int interval
protected volatile ProbeStatus lastStatus
protected volatile ProbeStatus lastFailingBootstrapProbe
protected volatile Probe currentProbe
public ProbeWorker(List<Probe> monitorProbes, List<Probe> dependencyProbes, int interval, int bootstrapTimeout)
monitorProbes - list of probes that must boot and then go live -after which
they must stay live.dependencyProbes - the list of dependency probes that must all succeed before
any attempt to probe the direct probe list is performed. Once the
dependency phase has completed, these probes are never checked again.interval - probe interval in milliseconds.bootstrapTimeout - timeout for bootstrap in millisecondspublic void init()
throws IOException
IOExceptionpublic void setReportHandler(ProbeReportHandler reportHandler)
public void setMustExit()
public ProbeStatus getLastStatus()
public Probe getCurrentProbe()
public ProbePhase getProbePhase()
public boolean checkAndReportDependencyProbes()
throws ProbeInterruptedException
ProbeInterruptedException - if the process was interrupted.public int getBootstrapTimeout()
public void verifyBootstrapHasNotTimedOut()
throws ProbeFailedException
ProbeFailedException - if the bootstrap has failedpublic boolean isBootstrapTimeExceeded()
public boolean checkAndReportBootstrapProbes()
throws ProbeInterruptedException,
ProbeFailedException
ProbeInterruptedException - the probe interruption flagsProbeFailedException - if a probe failed.protected void checkAndReportLiveProbes()
throws ProbeFailedException,
ProbeInterruptedException
ProbeFailedException - a probe failedProbeInterruptedException - the probe process was explicitly interruptedprotected void executeProbePhases()
throws ProbeFailedException,
ProbeInterruptedException
ProbeFailedException - a probe failedProbeInterruptedException - the probe process was explicitly interruptedprotected void probeFailed(ProbeFailedException e)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.