orca.policy.core
Class AgentQueuedBestFitPolicyPlugin
java.lang.Object
orca.shirako.core.Policy
orca.shirako.core.BrokerPolicy
orca.policy.core.BrokerBasePolicyPlugin
orca.policy.core.BrokerSimplePolicyPlugin
orca.policy.core.BrokerPriorityPolicyPlugin
orca.policy.core.BrokerBestFitPolicyPlugin
orca.policy.core.AgentQueuedBestFitPolicyPlugin
- All Implemented Interfaces:
- IBrokerPolicy, IClientPolicy, IInitialize, IPolicy, IRecover, ISerialize, IServerPolicy
public class AgentQueuedBestFitPolicyPlugin
- extends BrokerBestFitPolicyPlugin
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 java.util.Vector<BrokerReservation> |
queue
Queue of requests that failed but have been deferred: not sure how to
recover queue |
|
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.BrokerBestFitPolicyPlugin |
canResize, checkRequestEndTime, configure, constructTable, donate, extendTicket, findAllotment, finish, getIdentifiers, getLogicalInventory, getLogicalMachine, getMax, getMin, getShares, growResources, issueTicket, rebuildAllotment, release, releaseNotApproved, releaseResources, removeIds, reset, revisit, save, save |
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
queue
protected java.util.Vector<BrokerReservation> queue
- Queue of requests that failed but have been deferred: not sure how to
recover queue
AgentQueuedBestFitPolicyPlugin
public AgentQueuedBestFitPolicyPlugin()
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 BrokerBestFitPolicyPlugin
- 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 BrokerBestFitPolicyPlugin
- 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 BrokerBestFitPolicyPlugin
- Parameters:
r - the requesttable - the available machines from the logical inventorystart - requested startend - requested end
- Returns:
- true if ticket successfully completed, false otherwise
- Throws:
java.lang.Exception
Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.