orca.shirako.api
Interface IClientPolicy

All Superinterfaces:
IInitialize, IPolicy, IRecover, ISerialize
All Known Subinterfaces:
IBrokerPolicy, IServiceManagerPolicy
All Known Implementing Classes:
AgentQueuedBestFitPolicyPlugin, BaseServiceManagerCalendarPolicy, BrokerBasePolicyPlugin, BrokerBestFitPolicyPlugin, BrokerPolicy, BrokerPriorityPolicyPlugin, BrokerQueuedWorstFitPolicyPlugin, BrokerSimplePolicyPlugin, BrokerWorstFitMultiplePoolsPolicyPlugin, BrokerWorstFitPolicyPlugin, ServiceManagerPolicy, ServiceManagerSimplePolicyPlugin

public interface IClientPolicy
extends IPolicy

IClientPolicy defines the policy interface for an actor acting as a client of another actor (broker or a service manager).


Method Summary
 void demand(ReservationClient reservation)
          Injects a new resource demand into the demand stream.
 Bids formulateBids(long cycle)
          Formulates bids to the upstream broker(s).
 ReservationSet getHoldings()
          Return the holdings for the actor.
 ReservationSet getHoldings(long cycle)
          Returns the holdings for the actor at the given time instance.
 void ticketSatisfies(ResourceSet requestedResources, ResourceSet actualResources, Term requestedTerm, Term actualTerm)
          Checks if the resources and term received in a ticket are in compliance with what was initially requested.
 void updateTicketComplete(IReservation reservation)
          Notifies the policy that a ticket update operation has completed.
 
Methods inherited from interface orca.shirako.api.IPolicy
close, closed, extend, finish, getClosing, getGuid, prepare, query, remove, reset, revisit, setActor, setLogger
 
Methods inherited from interface orca.shirako.api.IInitialize
initialize
 
Methods inherited from interface orca.shirako.api.ISerialize
reset, save, save
 
Methods inherited from interface orca.shirako.api.IRecover
revisit
 

Method Detail

demand

void demand(ReservationClient reservation)
Injects a new resource demand into the demand stream. The reservation must be pre-initialized with resource set, term, properties, etc. The policy should use this request as an indication that new resources are required. The exact mapping of the request to actual requests for resources is policy-specific. For example, the policy may choose to combine several reservation requests into one, split a reservation request onto multiple brokers, etc. This method is invoked with the kernel lock on.

Parameters:
reservation - reservation representing resource demand
See Also:
formulateBids(long)

updateTicketComplete

void updateTicketComplete(IReservation reservation)
                          throws java.lang.Exception
Notifies the policy that a ticket update operation has completed. The mapper may use this upcall to update its internal state. This method is invoked with the kernel lock on.

Parameters:
reservation - reservation for which an update ticket operation has completed
Throws:
java.lang.Exception

getHoldings

ReservationSet getHoldings()
Return the holdings for the actor.

Returns:
the holdings for this actor

getHoldings

ReservationSet getHoldings(long cycle)
Returns the holdings for the actor at the given time instance.

Parameters:
cycle -
Returns:

formulateBids

Bids formulateBids(long cycle)
                   throws java.lang.Exception
Formulates bids to the upstream broker(s). The method should determine whether to issue bids on the current cycle. This method should consider the current demand, call broker(s) to obtain necessary information and decide how to distribute its resource demand. When deciding how to bid, also consider any expiring reservation and decide whether to renew and adjust their units. The code should only formulate the bids: the actor will then issue them. This method is invoked with the kernel lock on.

Here are some guidelines for implementing this method:


Parameters:
cycle - The current time
Returns:
Two collections:
  • ticketing - set of new reservations
  • extending - set of reservations to be extended Can be null if no action should be taken
Throws:
java.lang.Exception

ticketSatisfies

void ticketSatisfies(ResourceSet requestedResources,
                     ResourceSet actualResources,
                     Term requestedTerm,
                     Term actualTerm)
                     throws java.lang.Exception
Checks if the resources and term received in a ticket are in compliance with what was initially requested. The policy can prevent the application of the incoming update if it disagrees with it. This method is invoked with the kernel lock on.

Parameters:
requestedResources - resources requested from broker
actualResources - resources received from broker
requestedTerm - term requested from broker
actualTerm - term received from broker
Throws:
java.lang.Exception


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