|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.core.Policy
orca.shirako.core.BrokerPolicy
public class BrokerPolicy
| Field Summary | |
|---|---|
protected BrokerPolicyRecoverer |
recoverer
The recoverer. |
| Fields inherited from class orca.shirako.core.Policy |
|---|
actor, clock, guid, logger, PropertyGuid |
| Constructor Summary | |
|---|---|
BrokerPolicy()
Default constructor. |
|
BrokerPolicy(Broker actor)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
allocate(long cycle)
Allocates resources to all clients who have requested them. |
boolean |
bind(BrokerReservation reservation)
Handles an incoming request to allocate resources and issue a ticket for the reservation. |
void |
demand(ReservationClient reservation)
Injects a new resource demand into the demand stream. |
void |
donate(ReservationClient reservation)
Accepts ticketed resources to be used for allocation of client requests. |
boolean |
extend(BrokerReservation reservation)
Handles an incoming request to extend previously allocated resources and issue a ticket for the reservation. |
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. |
ReservationSet |
getRedeeming(long cycle)
|
void |
initialize()
Initializes the object. |
void |
prepareExtend(ReservationClient reservation)
|
void |
prepareReserve(ReservationClient reservation)
|
void |
reset()
Post recovery entry point. |
void |
revisit(IActor actor,
java.util.Properties p)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
void |
revisit(ResourceReservation reservation)
Informs the mapper about a reservation. |
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 class orca.shirako.core.Policy |
|---|
close, closed, error, extend, finish, getClosing, getGuid, internalError, logError, logWarn, prepare, query, remove, 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 |
|---|
close, closed, extend, finish, getClosing, getGuid, prepare, query, remove, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Methods inherited from interface orca.shirako.api.IPolicy |
|---|
close, closed, extend, finish, getClosing, getGuid, prepare, query, remove, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Field Detail |
|---|
protected BrokerPolicyRecoverer recoverer
| Constructor Detail |
|---|
public BrokerPolicy()
public BrokerPolicy(Broker actor)
actor - actor the mapper belongs to| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializeinitialize in class Policyjava.lang.Exception
public void donate(ReservationClient reservation)
throws java.lang.Exception
IServerPolicyNote: This method will be invoked only for resources not directly requested by the policy. For example, exported resources claimed manually by an administrator. The policy is itself responsible to "donate" resources to its inventory when resources it requests become available.
donate in interface IServerPolicyjava.lang.Exception
public void prepareReserve(ReservationClient reservation)
throws java.lang.Exception
java.lang.Exception
public void prepareExtend(ReservationClient reservation)
throws java.lang.Exception
java.lang.Exception
public void updateTicketComplete(IReservation reservation)
throws java.lang.Exception
IClientPolicy
updateTicketComplete in interface IClientPolicyreservation - reservation for which an update ticket operation has
completed
java.lang.Exceptionpublic void demand(ReservationClient reservation)
IClientPolicy
demand in interface IClientPolicyreservation - reservation representing resource demandIClientPolicy.formulateBids(long)
public boolean bind(BrokerReservation reservation)
throws java.lang.Exception
IServerPolicyreservation.getRequestedResources(). The requested lease
term can be obtained by calling
reservation.getRequestedTerm(). Properties specific to
the allocation protocol can be obtained by calling
reservation.getRequestedResources().getRequestProperties().
This method is invoked with the kernel lock on.
If the policy completed processing this request, the functions should
return true. If no further intervention is required, e.g., approval by an
administrator, the policy should also clear the bidPending
flag.
The policy may decide to defer the request for a later time. In this case
the function should return false and the bidPending flag
should remain unchanged.
This method may be invoked multiple times for a given reservation, i.e., if the policy delays the allocation, the system will continue invoking this method at later times until the policy completes processing this request.
bind in interface IServerPolicyreservation - reservation to allocate resources for.
java.lang.Exception
public boolean extend(BrokerReservation reservation)
throws java.lang.Exception
IServerPolicyreservation.getRequestedResources().
Properties specific to the allocation protocol can be obtained by calling
reservation.getRequestedResources().getRequestProperties().
The requested lease term can be obtained by calling
reservation.getRequestedTerm(). The new term must extend
the currently allocated term. This method is invoked with the kernel lock
on.
If the policy completed processing this request, the functions should
return true. If no further intervention is required, e.g., approval by an
administrator, the policy should also clear the bidPending
flag.
The policy may decide to defer the request for a later time. In this case
the function should return false and the bidPending flag
should remain unchanged.
This method may be invoked multiple times for a given reservation, i.e., if the policy delays the allocation, the system will continue invoking this method at later times until the policy completes processing this request.
While the policy is free to modify the term as it wishes, care must be taken that the client reservation is not closed before the extension is actually granted.
extend in interface IServerPolicyjava.lang.Exception
public void allocate(long cycle)
throws java.lang.Exception
IServerPolicy
allocate in interface IServerPolicycycle - the cycle for this allocation
java.lang.Exceptionpublic Bids formulateBids(long cycle)
IClientPolicyHere are some guidelines for implementing this method:
formulateBids in interface IClientPolicycycle - The current time
public ReservationSet getRedeeming(long cycle)
public ReservationSet getHoldings(long cycle)
IClientPolicy
getHoldings in interface IClientPolicypublic ReservationSet getHoldings()
IClientPolicy
getHoldings in interface IClientPolicy
public void ticketSatisfies(ResourceSet requestedResources,
ResourceSet actualResources,
Term requestedTerm,
Term actualTerm)
throws java.lang.Exception
IClientPolicy
ticketSatisfies in interface IClientPolicyrequestedResources - resources requested from brokeractualResources - resources received from brokerrequestedTerm - term requested from brokeractualTerm - term received from broker
java.lang.Exception
public void revisit(IActor actor,
java.util.Properties p)
throws java.lang.Exception
IRecover
revisit in interface IRecoverrevisit in class Policyactor - actor object the component belongs top - properties list containing configuration data about the
component
java.lang.Exception
public void revisit(ResourceReservation reservation)
throws java.lang.Exception
IPolicy
revisit in interface IPolicyrevisit in class Policyjava.lang.Exception
public void reset()
throws java.lang.Exception
IPolicy
reset in interface IPolicyreset in class Policyjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||