com.bigdata.service
Interface ILoadBalancerService

All Superinterfaces:
IEventReceivingService, IService, Remote
All Known Implementing Classes:
AbstractEmbeddedLoadBalancerService, EmbeddedFederation.EmbeddedLoadBalancerServiceImpl, LoadBalancerServer.AdministrableLoadBalancer, LoadBalancerService

public interface ILoadBalancerService
extends IService, IEventReceivingService

Interface for collecting, reporting, and decision-making based on node and service utilization statistics.

Version:
$Id: ILoadBalancerService.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 UUID getUnderUtilizedDataService()
          Return the UUID of an under-utilized data service.
 UUID[] getUnderUtilizedDataServices(int minCount, int maxCount, UUID exclude)
          Return up to limit IDataService UUIDs 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 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.
 
Methods inherited from interface com.bigdata.service.IService
destroy, getHostname, getServiceIface, getServiceName, getServiceUUID
 
Methods inherited from interface com.bigdata.service.IEventReceivingService
notifyEvent
 

Method Detail

notify

void notify(UUID serviceUUID,
            byte[] data)
            throws IOException
Send performance counters. Clients SHOULD invoke this method no less than once every 60 seconds.

Parameters:
serviceUUID - The service UUID that is self-reporting.
data - The serialized performance counter data.
Throws:
IOException

warn

void warn(String msg,
          UUID serviceUUID)
          throws IOException
A warning issued by a client when it is in danger of depleting its resources.

Parameters:
msg - A message.
serviceUUID - The service UUID that is self-reporting.
Throws:
IOException

urgent

void urgent(String msg,
            UUID serviceUUID)
            throws IOException
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).

Parameters:
msg - A message.
serviceUUID - The service UUID that is self-reporting.
Throws:
IOException

getUnderUtilizedDataService

UUID getUnderUtilizedDataService()
                                 throws IOException,
                                        TimeoutException,
                                        InterruptedException
Return the 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.

Throws:
TimeoutException - if there are no data services and a timeout occurs while awaiting a service join.
InterruptedException - if the request is interrupted.
IOException

getUnderUtilizedDataServices

UUID[] getUnderUtilizedDataServices(int minCount,
                                    int maxCount,
                                    UUID exclude)
                                    throws IOException,
                                           TimeoutException,
                                           InterruptedException
Return up to limit IDataService UUIDs that are currently under-utilized.

When minCount is positive, this method will always return at least minCount service UUIDs, however the UUIDs 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 UUIDs for services that are within a nominal utilization range, or even UUIDs for services that are highly-utilized if it could otherwise not satisify the request.

Parameters:
minCount - The minimum #of services UUIDs to return -or- zero (0) if there is no minimum limit.
maxCount - The maximum #of services UUIDs 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.
Returns:
Up to maxCount under-utilized services -or- null IFF no services are recommended at this time as needing additional load.
Throws:
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
TODO:
generalize to also accept the class or interface of the service so that it can be used with services other than data services, e.g., metadata services, map/reduce services, IBigdataClients, etc., probably should use Integer.MAX_VALUE rather than ZERO for the "no limit" signifier for [maxCount].

isHighlyUtilizedDataService

boolean isHighlyUtilizedDataService(UUID serviceUUID)
                                    throws IOException
Return 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.

Parameters:
serviceUUID - The service UUID.
Returns:
true if the service is considered to be "highly utilized".
Throws:
IOException

isUnderUtilizedDataService

boolean isUnderUtilizedDataService(UUID serviceUUID)
                                   throws IOException
Return true if the service is considered to be "under-utilized".

Parameters:
serviceUUID - The service UUID.
Returns:
true if the service is considered to be "under-utilized".
Throws:
IOException


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.