com.bigdata.service
Class AbstractServiceLoadHelper

java.lang.Object
  extended by com.bigdata.service.AbstractServiceLoadHelper
All Implemented Interfaces:
IServiceLoadHelper
Direct Known Subclasses:
AbstractServiceLoadHelperWithoutScores, AbstractServiceLoadHelperWithScores

public abstract class AbstractServiceLoadHelper
extends Object
implements IServiceLoadHelper

Base class for abstract implementations with integration points for the LoadBalancerService.

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

Field Summary
protected  long joinTimeout
           
 
Constructor Summary
protected AbstractServiceLoadHelper(long joinTimeout)
           
 
Method Summary
protected abstract  void awaitJoin(long timeout, TimeUnit unit)
          Await the join of an IDataService.
protected abstract  UUID[] getActiveServices()
          Return an array of service UUIDs for all of the active IDataServices that we know about right now (snapshot).
protected abstract  boolean isActiveDataService(UUID serviceUUID)
          Return true iff the given serviceUUID identifies an active IDataService.
protected abstract  boolean isUnderUtilizedDataService(ServiceScore score, ServiceScore[] scores)
          Return true iff the service is under-utilized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bigdata.service.IServiceLoadHelper
getUnderUtilizedDataServices
 

Field Detail

joinTimeout

protected final long joinTimeout
Constructor Detail

AbstractServiceLoadHelper

protected AbstractServiceLoadHelper(long joinTimeout)
Parameters:
joinTimeout -
Method Detail

isUnderUtilizedDataService

protected abstract boolean isUnderUtilizedDataService(ServiceScore score,
                                                      ServiceScore[] scores)
Return true iff the service is under-utilized.

Parameters:
score - The score for the service.
scores - The set of scores for the known services.

isActiveDataService

protected abstract boolean isActiveDataService(UUID serviceUUID)
Return true iff the given serviceUUID identifies an active IDataService.

Parameters:
serviceUUID - The service UUID.

awaitJoin

protected abstract void awaitJoin(long timeout,
                                  TimeUnit unit)
                           throws InterruptedException
Await the join of an IDataService.

Parameters:
timeout - The timeout.
unit - The unit for the timeout.
Throws:
InterruptedException

getActiveServices

protected abstract UUID[] getActiveServices()
Return an array of service UUIDs for all of the active IDataServices that we know about right now (snapshot).

Returns:
The array and never null.


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