orca.policy.core
Class BrokerQueuedWorstFitPolicyPlugin

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
                      extended by orca.policy.core.BrokerWorstFitPolicyPlugin
                          extended by orca.policy.core.BrokerQueuedWorstFitPolicyPlugin
All Implemented Interfaces:
IBrokerPolicy, IClientPolicy, IInitialize, IPolicy, IRecover, ISerialize, IServerPolicy

public class BrokerQueuedWorstFitPolicyPlugin
extends BrokerWorstFitPolicyPlugin

The AgentQueuedWorstFitPolicyPlugin performs a worst fit allocation algorithm over an inventory of machines.
This uses the priorities for new reservations but extends AgentWorstFitPolicyPlugin to use a queue, so if a reservation cannot be allocated "now" and is elasticTime, then it is placed on the queue and the system tries to allocate it in the next allocation cycle.

Author:
grit

Field Summary
protected  FIFOQueue queue
          Queue of requests that failed but have been deferred: not sure how to recover queue
 
Fields inherited from class orca.policy.core.BrokerWorstFitPolicyPlugin
allocated, Dimensions, failed, inventory, PropertyForceNewId, PropertyIDList, PropertyIDs
 
Fields inherited from class orca.policy.core.BrokerPriorityPolicyPlugin
PropertyRequestTypeCount, PropertyRequestTypeName, PropertyRequestTypePriority, 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
BrokerQueuedWorstFitPolicyPlugin()
           
 
Method Summary
 void allocate(long cycle)
          Allocate pending requests in the queue before issuing new requests.
 void allocate(ReservationSet requests, long startCycle)
          If a reservation fails to find an allotment, if it's elasticTime, put it on the queue for next allotment cycle instead of failing it.
 void allocateQueue(long startCycle)
          Allocate queued requests.
protected  boolean ticket(BrokerReservation r, ResourceTable table, long start, long end)
          Do not fail a reservation because we may put it on the queue if it's elastic Issue a new ticket to a request.
This is the first request for a ticket We try to satisfy the request for the lower bound of requested resources per dimension.
 
Methods inherited from class orca.policy.core.BrokerWorstFitPolicyPlugin
canResize, checkRequestEndTime, configure, constructTable, donate, extendTicket, findAllotment, finish, getIdentifiers, getIDList, getIDList, getIDString, getLogicalInventory, getLogicalMachine, getMax, getMin, getShares, growResources, issueTicket, rebuildAllotment, release, releaseNotApproved, releaseResources, removeIds, reset, revisit, save, save, storeIDList
 
Methods inherited from class orca.policy.core.BrokerPriorityPolicyPlugin
addRequestType
 
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, getClosing, getForApproval, initialize, notApprove, release, remove, removeForApproval, 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, 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.IPolicy
extend, getGuid, setActor, setLogger
 

Field Detail

queue

protected FIFOQueue queue
Queue of requests that failed but have been deferred: not sure how to recover queue

Constructor Detail

BrokerQueuedWorstFitPolicyPlugin

public BrokerQueuedWorstFitPolicyPlugin()
Method Detail

allocate

public void allocate(long cycle)
              throws java.lang.Exception
Allocate pending requests in the queue before issuing new requests. 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 BrokerWorstFitPolicyPlugin
Parameters:
cycle - the cycle for this allocation
Throws:
java.lang.Exception

allocateQueue

public void allocateQueue(long startCycle)
                   throws java.lang.Exception
Allocate queued requests. Iterate through all the requests, create a table representing the available resources for the duration of the request, and determine if it is a new request or an extend request.

Parameters:
requests -
Throws:
java.lang.Exception

allocate

public void allocate(ReservationSet requests,
                     long startCycle)
              throws java.lang.Exception
If a reservation fails to find an allotment, if it's elasticTime, put it on the queue for next allotment cycle instead of failing it. Allocate requests. Iterate through all the requests, create a table representing the available resources for the duration of the request, and determine if it is a new request or an extend request.

Overrides:
allocate in class BrokerWorstFitPolicyPlugin
Throws:
java.lang.Exception

ticket

protected boolean ticket(BrokerReservation r,
                         ResourceTable table,
                         long start,
                         long end)
                  throws java.lang.Exception
Do not fail a reservation because we may put it on the queue if it's elastic Issue a new ticket to a request.
This is the first request for a ticket We try to satisfy the request for the lower bound of requested resources per dimension. If this succeeds, we find the maximum amount by which we can grow each of the pre-allocated nodes. We compute the final allocation and commit it to the inventory. Finally, we issue a ticket will all required properties.

Overrides:
ticket in class BrokerWorstFitPolicyPlugin
Parameters:
r - the request
table - the available machines from the logical inventory
start - requested start
end - requested end
Returns:
true if ticket successfully completed, false otherwise
Throws:
java.lang.Exception


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