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 IHostScoringRule
s 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
IHostMetrics s 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, updateServiceTable
getJournal, getLeaderURI, getLocalServiceScore, getServiceScoreForHostname, notify, service, toString
protected void toString(StringBuilder sb)
AbstractLBSPolicy
AbstractLBSPolicy.toString()
- implementation MUST NOT block.toString
in class AbstractHostLBSPolicy
sb
- Buffer where you can write additional state.public void init(javax.servlet.ServletConfig servletConfig, IIndexManager indexManager) throws javax.servlet.ServletException
IHAPolicyLifeCycle
init
in interface IHAPolicyLifeCycle
init
in class AbstractHostLBSPolicy
javax.servlet.ServletException
public void destroy()
IHAPolicyLifeCycle
destroy
in interface IHAPolicyLifeCycle
destroy
in class AbstractHostLBSPolicy
protected Map<String,IHostMetrics> getHostReportForKnownServices(IHostScoringRule scoringRule, ServiceScore[] serviceScores)
IHostMetrics
s 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 AbstractHostLBSPolicy
scoringRule
- 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()
AbstractHostLBSPolicy
IHostScoringRule
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 AbstractHostLBSPolicy
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.