public interface ILoadBalancerService extends IService, IEventReceivingService
Modifier and Type | Method and Description |
---|---|
UUID |
getUnderUtilizedDataService()
Return the
UUID of an under-utilized data service. |
UUID[] |
getUnderUtilizedDataServices(int minCount,
int maxCount,
UUID exclude)
Return up to limit
IDataService UUID s that are
currently under-utilized. |
boolean |
isHighlyUtilizedDataService(UUID serviceUUID)
Return
true if the service is considered to be "highly
utilized". |
boolean |
isUnderUtilizedDataService(UUID serviceUUID)
Return
true if the service is considered to be
"under-utilized". |
void |
notify(UUID serviceUUID,
byte[] data)
Send performance counters.
|
void |
sighup()
Logs counters to a temp file.
|
void |
urgent(String msg,
UUID serviceUUID)
An urgent warning issued the caller is in immediate danger of depleting
its resources with a consequence of immediate service and/or host
failure(s).
|
void |
warn(String msg,
UUID serviceUUID)
A warning issued by a client when it is in danger of depleting its
resources.
|
destroy, getHostname, getServiceIface, getServiceName, getServiceUUID
notifyEvent
void notify(UUID serviceUUID, byte[] data) throws IOException
serviceUUID
- The service UUID
that is self-reporting.data
- The serialized performance counter data.IOException
void warn(String msg, UUID serviceUUID) throws IOException
msg
- A message.serviceUUID
- The service UUID
that is self-reporting.IOException
void urgent(String msg, UUID serviceUUID) throws IOException
msg
- A message.serviceUUID
- The service UUID
that is self-reporting.IOException
UUID getUnderUtilizedDataService() throws IOException, TimeoutException, InterruptedException
UUID
of an under-utilized data service. If there is no
under-utilized service, then return the UUID
of the service with
the least load.TimeoutException
- if there are no data services and a timeout occurs while
awaiting a service join.InterruptedException
- if the request is interrupted.IOException
UUID[] getUnderUtilizedDataServices(int minCount, int maxCount, UUID exclude) throws IOException, TimeoutException, InterruptedException
IDataService
UUID
s that are
currently under-utilized.
When minCount is positive, this method will always return at
least minCount service UUID
s, however the UUID
s
returned MAY contain duplicates if the LoadBalancerService
has a
strong preference for allocating load to some services (or for NOT
allocating load to other services). Further, the
LoadBalancerService
MAY choose (or be forced to choose) to return
UUID
s for services that are within a nominal utilization range,
or even UUID
s for services that are highly-utilized if it could
otherwise not satisify the request.
minCount
- The minimum #of services UUID
s to return -or- zero
(0) if there is no minimum limit.maxCount
- The maximum #of services UUID
s to return -or- zero
(0) if there is no maximum limit.exclude
- The optional UUID
of a data service to be excluded
from the returned set.null
IFF no services are recommended at this time
as needing additional load.TimeoutException
- if there are no data services, or if there is only a single
data service and it is excluded by the request, and a timeout
occurs while awaiting a service join.InterruptedException
- if the request is interrupted.IOException
boolean isHighlyUtilizedDataService(UUID serviceUUID) throws IOException
true
if the service is considered to be "highly
utilized".
Note: This is used mainly to decide when a service should attempt to shed index partitions. This implementation SHOULD reflect the relative rank of the service among all services as well as its absolute load.
serviceUUID
- The service UUID
.true
if the service is considered to be "highly
utilized".IOException
boolean isUnderUtilizedDataService(UUID serviceUUID) throws IOException
true
if the service is considered to be
"under-utilized".serviceUUID
- The service UUID
.true
if the service is considered to be "under-utilized".IOException
void sighup() throws IOException
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.