|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.LoadBalancerService.UpdateTask
protected class LoadBalancerService.UpdateTask
Computes and updates the ServiceScores based on an examination
of aggregated performance counters.
QueryUtil.getRequiredPerformanceCountersFilter()ILoadBalancerService#notify(String, byte[]) for 120 seconds
then presume dead? this requires that we compute the age of the
last reported counter value. e.g., do a counter scan for the
service and report the largest value for lastModified() on any
counter for that service.| Field Summary | |
|---|---|
protected org.apache.log4j.Logger |
log
Note: The logger is named for this class, but since it is an inner class the name uses a "$" delimiter (vs a ".") between the outer and the inner class names. |
| Constructor Summary | |
|---|---|
LoadBalancerService.UpdateTask()
|
|
| Method Summary | |
|---|---|
protected ServiceScore |
computeScore(HostScore hostScore,
UUID serviceUUID,
ICounterSet hostCounterSet,
ICounterSet serviceCounterSet)
Compute the score for a service. |
protected HostScore |
computeScore(String hostname,
ICounterSet hostCounterSet)
Compute the score for a host. |
protected double |
getAverageValueForMinutes(ICounterSet counterSet,
String path,
double defaultValue,
int minutes)
Return the average of the counter having the given path over the last minutes minutes. |
protected double |
getCurrentValue(ICounterSet counterSet,
String path,
double defaultValue)
|
protected void |
logCounters()
Writes the counters on a file. |
void |
run()
Note: Don't throw anything here since we don't want to have the task suppressed! |
protected void |
setupCounters()
Sets up reporting for the computed per-host and per-service scores. |
protected void |
updateHostScores()
(Re-)compute the utilization score for each active host. |
protected void |
updateServiceScores()
(Re-)compute the utilization score for each active service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final transient org.apache.log4j.Logger log
| Constructor Detail |
|---|
public LoadBalancerService.UpdateTask()
| Method Detail |
|---|
public void run()
run in interface Runnableprotected void updateHostScores()
protected void updateServiceScores()
Note: There is a dependency on
AbstractFederation.getServiceCounterPathPrefix(UUID, Class, String).
This method assumes that the service UUID is found in a
specific place in the constructed path.
protected HostScore computeScore(String hostname,
ICounterSet hostCounterSet)
The host scores MUST reflect critical resource exhaustion, especially DISK free space, which can take down all services on the host, and SWAPPING, which can bring the effective throughput of the host to a halt. All other resources fail soft, by causing the response time to increase.
Note: DISK exhaustion can lead to immediate failure of all services on the same host. A host that is nearing DISK exhaustion SHOULD get heavily dinged and an admin SHOULD be alerted.
The correct response for heavy swapping is to alert an admin to shutdown one or more processes on that host. If you do not have failover provisioned for your data services then DO NOT shutdown data services or you WILL loose data!
Note: If we are not getting critical counters for some host then we are assuming a reasonable values for the missing data and computing the utilization based on those assumptions. Note that a value of zero (0) may be interpreted as either critically high utilization or no utilization depending on the performance counter involved and that the impact of the different counters can vary depending on the formula used to compute the utilization score.
hostname - The fully qualified hostname.hostCounterSet - The performance counters for that host.serviceCounterSet - The performance counters for that service.
protected ServiceScore computeScore(HostScore hostScore,
UUID serviceUUID,
ICounterSet hostCounterSet,
ICounterSet serviceCounterSet)
Note: utilization is defined in terms of transient system resources : CPU, IO (DISK and NET), RAM. A host with enough CPU/RAM/IO/DISK can support more than one data service. Therefore it is important to look at not just host utilization but also at process utilization.
hostScore - The pre-computed score for the host on which the service
is running.serviceUUID - The service UUID.hostCounterSet - The performance counters for that host (in case you need
anything that is not already in the HostScore).serviceCounterSet - The performance counters for that service.
protected double getCurrentValue(ICounterSet counterSet,
String path,
double defaultValue)
protected double getAverageValueForMinutes(ICounterSet counterSet,
String path,
double defaultValue,
int minutes)
counterSet - path - defaultValue - minutes -
protected void setupCounters()
UUID for the
LoadBalancerService itself. This makes it easy to consult the
scores for the various hosts and services.
Note: The host and service scores will not appear until the
LoadBalancerService.UpdateTask has executed and those scores have been computed.
LoadBalancerService.Options.UPDATE_DELAYprotected void logCounters()
LoadBalancerService.Options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||