public class GangliaLBSPolicy extends AbstractHostLBSPolicy
Note: This IHALoadBalancerPolicy has a dependency on the
GangliaPlugIn. The GangliaPlugIn must be setup to listen to
the Ganglia protocol and build up an in-memory model of the load on each
host. Ganglia MUST be reporting metrics for each host running an
HAJournalServer instance. This can be achieved either using the
gmond utility from the ganglia distribution or using the
GangliaPlugIn.
Note: The actual performance metrics will be reported by a given ganglia
daemon on some host depend on the ganglia implementation, ganglia
configuration, and the host OS. Some key performance metrics may not be
available on all hosts. For example, IO Wait is not available under OSX. The
available performance metrics constraints the IHostScoringRules that
you can utilize on a given cluster. You can monitor the available performance
metrics by running the GangliaListener utility.
Note: The ganglia updates are not synchronized across a cluster. They pour in ever N seconds from each host. However, the hosts do not begin to report on the same N second boundary. All you know is that (on average) all hosts should have reported in within N seconds.
| Modifier and Type | Class and Description |
|---|---|
static interface |
GangliaLBSPolicy.InitParams
Servlet
init-param values understood by the
GangliaLBSPolicy. |
journalRef, serviceIDRef, serviceTableRef| Constructor and Description |
|---|
GangliaLBSPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the policy (stop any asynchronous processing, release any
resources).
|
protected String |
getDefaultScoringRule()
Return the name of the
IHostScoringRule that provides default
value for the AbstractHostLBSPolicy.InitParams.HOST_SCORING_RULE configuration
parameter. |
protected Map<String,IHostMetrics> |
getHostReportForKnownServices(IHostScoringRule scoringRule,
ServiceScore[] serviceScores)
Return a map from the known canonical hostnames (as self-reported by the
services) of the joined services to the
IHostMetricss for those
hosts. |
void |
init(javax.servlet.ServletConfig servletConfig,
IIndexManager indexManager)
Initialize the policy.
|
protected void |
toString(StringBuilder sb)
Extension hook for
AbstractLBSPolicy.toString() - implementation MUST NOT block. |
conditionallyForwardReadRequest, conditionallyUpdateServiceTable, getHostDiscoveryDelay, getReaderURI, setLocalForwardThreshold, updateHostTable, updateServiceTablegetJournal, getLeaderURI, getLocalServiceScore, getServiceScoreForHostname, notify, service, toStringprotected void toString(StringBuilder sb)
AbstractLBSPolicyAbstractLBSPolicy.toString() - implementation MUST NOT block.toString in class AbstractHostLBSPolicysb - Buffer where you can write additional state.public void init(javax.servlet.ServletConfig servletConfig,
IIndexManager indexManager)
throws javax.servlet.ServletException
IHAPolicyLifeCycleinit in interface IHAPolicyLifeCycleinit in class AbstractHostLBSPolicyjavax.servlet.ServletExceptionpublic void destroy()
IHAPolicyLifeCycledestroy in interface IHAPolicyLifeCycledestroy in class AbstractHostLBSPolicyprotected Map<String,IHostMetrics> getHostReportForKnownServices(IHostScoringRule scoringRule, ServiceScore[] serviceScores)
IHostMetricss for those
hosts.
This implementation queries the in-memory model of the cluster that is
built up and maintained by the integrated GangliaService.
getHostReportForKnownServices in class AbstractHostLBSPolicyscoringRule - The IHostScoringRule to be applied.serviceScores - The set of known services.UUID and
the host metrics were combined into the map once for each
service.protected String getDefaultScoringRule()
AbstractHostLBSPolicyIHostScoringRule that provides default
value for the AbstractHostLBSPolicy.InitParams.HOST_SCORING_RULE configuration
parameter.
Note: The policy needs to be specific to the LBS implementation since the names of the host metrics depend on the system that is being used to collect and report them.
getDefaultScoringRule in class AbstractHostLBSPolicyCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.