public class DefaultServiceFederationDelegate<T extends AbstractService> extends Object implements IFederationDelegate<T>
ILoadBalancerService
.Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
log |
protected T |
service |
Constructor and Description |
---|
DefaultServiceFederationDelegate(T service) |
Modifier and Type | Method and Description |
---|---|
void |
didStart()
NOP
|
T |
getService()
Return the client or service.
|
Class |
getServiceIface()
Return the class or interface that is the most interesting facet of the
client and which will be used to identify this client in the performance
counters reported to the
ILoadBalancerService . |
String |
getServiceName()
Return a name for the service.
|
UUID |
getServiceUUID()
|
boolean |
isServiceReady()
Returns
true |
protected void |
logHttpdURL(File file)
Writes the URL of the local httpd service for the
DataService
onto a file named httpd.url in the specified directory. |
AbstractHTTPD |
newHttpd(int httpdPort,
ICounterSetAccess access)
Create a new
AbstractHTTPD instance. |
void |
reattachDynamicCounters()
Offers the service an opportunity to dynamically detach and re-attach
performance counters.
|
void |
serviceJoin(IService service,
UUID serviceUUID)
NOP
|
void |
serviceLeave(UUID serviceUUID)
NOP
|
protected static final org.apache.log4j.Logger log
protected final T extends AbstractService service
public DefaultServiceFederationDelegate(T service)
public T getService()
IFederationDelegate
getService
in interface IFederationDelegate<T extends AbstractService>
public String getServiceName()
IFederationDelegate
getServiceName
in interface IFederationDelegate<T extends AbstractService>
public UUID getServiceUUID()
IFederationDelegate
getServiceUUID
in interface IFederationDelegate<T extends AbstractService>
AbstractService.setServiceUUID(UUID)
public Class getServiceIface()
IFederationDelegate
ILoadBalancerService
.getServiceIface
in interface IFederationDelegate<T extends AbstractService>
null
.public void reattachDynamicCounters()
IFederationDelegate
ILoadBalancerService
. In general, implementations should limit
the frequency of update, e.g., to no more than once a second.
Note: For most purposes, this has been replaced by
ICounterSetAccess
which is now passed into
CounterSetHTTPD
. That provides the necessary indirection for
periodic refresh of the performance counters. The CounterSetHTTPD
now also handles the limitation on the update frequency for the
materialized counters.
However, there are still some counters which need to be dynamically reattached. For example, any counter set which is dynamic in its structure, such as the DirectBufferPool.
reattachDynamicCounters
in interface IFederationDelegate<T extends AbstractService>
public boolean isServiceReady()
true
isServiceReady
in interface IFederationDelegate<T extends AbstractService>
public void didStart()
didStart
in interface IFederationDelegate<T extends AbstractService>
public void serviceJoin(IService service, UUID serviceUUID)
serviceJoin
in interface IFederationDelegate<T extends AbstractService>
service
- The service.serviceUUID
- The service UUID
.public void serviceLeave(UUID serviceUUID)
serviceLeave
in interface IFederationDelegate<T extends AbstractService>
serviceUUID
- The service UUID
.public AbstractHTTPD newHttpd(int httpdPort, ICounterSetAccess access) throws IOException
IFederationDelegate
AbstractHTTPD
instance.newHttpd
in interface IFederationDelegate<T extends AbstractService>
access
- Used to materialize the CounterSet
that will be served
up.IOException
protected void logHttpdURL(File file)
DataService
onto a file named httpd.url
in the specified directory.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.