com.bigdata.service
Class AbstractServiceLoadHelperWithScores

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

public abstract class AbstractServiceLoadHelperWithScores
extends AbstractServiceLoadHelper

The default implementation used when scores are available.

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

Field Summary
protected static boolean INFO
           
protected  UUID knownGood
           
protected static org.apache.log4j.Logger log
           
protected  ServiceScore[] scores
           
 
Fields inherited from class com.bigdata.service.AbstractServiceLoadHelper
joinTimeout
 
Constructor Summary
protected AbstractServiceLoadHelperWithScores(long joinTimeout, UUID knownGood, ServiceScore[] scores)
           
 
Method Summary
 UUID[] getUnderUtilizedDataServices(int minCount, int maxCount, UUID exclude)
          Handles the case when we have per-service scores.
 
Methods inherited from class com.bigdata.service.AbstractServiceLoadHelper
awaitJoin, getActiveServices, isActiveDataService, isUnderUtilizedDataService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

INFO

protected static final boolean INFO

knownGood

protected final UUID knownGood

scores

protected final ServiceScore[] scores
Constructor Detail

AbstractServiceLoadHelperWithScores

protected AbstractServiceLoadHelperWithScores(long joinTimeout,
                                              UUID knownGood,
                                              ServiceScore[] scores)
Parameters:
joinTimeout - The maximum time in milliseconds
knownGood - A service that is known to be active and NOT excluded from the request to be posed.
scores - Scores for the services in ascending order (least utilized to most utilized).
Method Detail

getUnderUtilizedDataServices

public UUID[] getUnderUtilizedDataServices(int minCount,
                                           int maxCount,
                                           UUID exclude)
                                    throws TimeoutException,
                                           InterruptedException
Handles the case when we have per-service scores.

Note: Pre-condition: the service scores must exist and there must be at least one active service with a score that is not excluded (the knownGood service).

Parameters:
minCount -
maxCount -
exclude -
Returns:
Throws:
TimeoutException
InterruptedException
See Also:
ILoadBalancerService.getUnderUtilizedDataServices(int, int, UUID)


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