orca.policy.core
Class BrokerPriorityPolicyPlugin

java.lang.Object
  extended by orca.shirako.core.Policy
      extended by orca.shirako.core.BrokerPolicy
          extended by orca.policy.core.BrokerBasePolicyPlugin
              extended by orca.policy.core.BrokerSimplePolicyPlugin
                  extended by orca.policy.core.BrokerPriorityPolicyPlugin
All Implemented Interfaces:
IBrokerPolicy, IClientPolicy, IInitialize, IPolicy, IRecover, ISerialize, IServerPolicy
Direct Known Subclasses:
BrokerBestFitPolicyPlugin, BrokerWorstFitMultiplePoolsPolicyPlugin, BrokerWorstFitPolicyPlugin

public class BrokerPriorityPolicyPlugin
extends BrokerSimplePolicyPlugin

AgentPriorityPolicyPlugin is an extension of the simple implementation of an agent's plugin interface. It buffers requests for allocation periods and when it performs allocations of resources. It allocates requests based on requestType priorities set in the configuration at the broker. There may be multiple requestTypes with the same priority. Within each priority class, requests are allocated FIFO. Within each priority class it gives priority to extending reservations followed by new reservations.

Author:
grit

Field Summary
static java.lang.String PropertyRequestTypeCount
           
static java.lang.String PropertyRequestTypeName
           
static java.lang.String PropertyRequestTypePriority
           
protected  java.util.Vector<RequestTypePriority> requestTypePriorities
           
 
Fields inherited from class orca.policy.core.BrokerSimplePolicyPlugin
ADVANCE_TIME, CALL_INTERVAL, CLOCK_SKEW, lastAllocation, ready, REQUEST_TYPE
 
Fields inherited from class orca.policy.core.BrokerBasePolicyPlugin
calendar, PropertyDiscoverTypes, PropertyTypeCount, PropertyTypeDescriptionPrefix, PropertyTypeNamePrefix, requireApproval
 
Fields inherited from class orca.shirako.core.BrokerPolicy
recoverer
 
Fields inherited from class orca.shirako.core.Policy
actor, clock, guid, logger, PropertyGuid
 
Constructor Summary
BrokerPriorityPolicyPlugin()
           
 
Method Summary
 void addRequestType(int priority, java.lang.String requestType)
           
 void allocate(long cycle)
          Allows additional configuration of priority between multiple types of requests as specified in REQUEST_TYPE.
 void configure(java.util.Properties p)
          Processes a list of configuration properties
 
Methods inherited from class orca.policy.core.BrokerSimplePolicyPlugin
allocateExtending, allocateNewBids, bind, calculateAvailable, createSourceHashtable, extend, extractTicket, formulateBids, getAllocation, getApprovedTerm, getNextAllocation, getRenew, getStartForAllocation, prepare, processRenewing, query, satisfyAllocation, switchSource, verifyWantedResources
 
Methods inherited from class orca.policy.core.BrokerBasePolicyPlugin
addForApproval, addForApprovalCalendar, addToCalendar, approve, checkPending, close, closed, count, donate, finish, getClosing, getForApproval, initialize, notApprove, release, release, releaseNotApproved, remove, removeForApproval, revisit, revisitClient, revisitServer
 
Methods inherited from class orca.shirako.core.BrokerPolicy
demand, getHoldings, getHoldings, getRedeeming, prepareExtend, prepareReserve, reset, revisit, ticketSatisfies, updateTicketComplete
 
Methods inherited from class orca.shirako.core.Policy
error, extend, getGuid, internalError, logError, logWarn, reset, save, save, setActor, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface orca.shirako.api.IPolicy
extend, getGuid, setActor, setLogger
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 
Methods inherited from interface orca.shirako.api.IPolicy
extend, getGuid, setActor, setLogger
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 

Field Detail

PropertyRequestTypeCount

public static final java.lang.String PropertyRequestTypeCount
See Also:
Constant Field Values

PropertyRequestTypeName

public static final java.lang.String PropertyRequestTypeName
See Also:
Constant Field Values

PropertyRequestTypePriority

public static final java.lang.String PropertyRequestTypePriority
See Also:
Constant Field Values

requestTypePriorities

protected java.util.Vector<RequestTypePriority> requestTypePriorities
Constructor Detail

BrokerPriorityPolicyPlugin

public BrokerPriorityPolicyPlugin()
Method Detail

configure

public void configure(java.util.Properties p)
               throws java.lang.Exception
Processes a list of configuration properties

Parameters:
p -
Throws:
java.lang.Exception

addRequestType

public void addRequestType(int priority,
                           java.lang.String requestType)

allocate

public void allocate(long cycle)
              throws java.lang.Exception
Allows additional configuration of priority between multiple types of requests as specified in REQUEST_TYPE. For example, requests for "master" nodes may be given priority over "worker" requests.
Run an allocation of requests against all sources, given a set of pending bids by using FCFS giving extends priority. This simple policy runs through the bids in iterator order, and give every request min(requested,available) until we run out. It gives priority to extending requests compared to new requests. Assumes that there is only 1 source reservation per type. Makes the assumption that we allocate resources sequentially in time, so there are never less resources available in the future.
Allocates resources to all clients who have requested them. This method is called by the policy once per cycle. The method should determine whether to perform resource allocation on the given cycle and what requests to consider in that process. This method is invoked with the kernel lock on.

Specified by:
allocate in interface IServerPolicy
Overrides:
allocate in class BrokerSimplePolicyPlugin
Parameters:
cycle - the cycle for this allocation
Throws:
java.lang.Exception


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.