|
||||||||||
| 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.ServiceManagerPolicy
orca.policy.core.BaseServiceManagerCalendarPolicy
orca.policy.core.ServiceManagerSimplePolicyPlugin
public class ServiceManagerSimplePolicyPlugin
A simple implementation of a Service Manager bidding policy. This version
implements a simple SM bid policy with the following assumptions:
1 broker
Always bid on only the first open auction
Never shrinks a reservation (e.g., due to budget constraints)
Extend all reservations expiring at bidding time, if renewable
Close - ADVANCE_CLOSE cycles early
| Field Summary | |
|---|---|
protected static long |
ADVANCE_CLOSE
How far in advance a reservation should initiate the close. |
static long |
CLOCK_SKEW
The amount of time over specific policy decisions the SM must add when communicating with other actors (e.g. |
| Fields inherited from class orca.policy.core.BaseServiceManagerCalendarPolicy |
|---|
calendar, clock, events, lazyClose, logger, pendingNotify, PropertyEventHandler |
| Fields inherited from class orca.shirako.core.ServiceManagerPolicy |
|---|
recoverer |
| Fields inherited from class orca.shirako.core.Policy |
|---|
actor, guid, PropertyGuid |
| Constructor Summary | |
|---|---|
ServiceManagerSimplePolicyPlugin()
|
|
| Method Summary | |
|---|---|
void |
demand(ResourceReservation reservation)
|
Bids |
formulateBids(long cycle)
Form bids for expiring reservations and new demands. |
long |
getClose(ReservationClient reservation,
Term term)
Very simple policy - based on ADVANCE_CLOSE Get the time that a reservation closes |
protected Term |
getExtendTerm(Term suggestedTerm,
Term currentTerm)
|
long |
getRedeem(ReservationClient reservation)
Redeem at the new start of the lease Get the time when this reservation should be redeemed |
long |
getRenew(ReservationClient reservation)
Call up to the agent to receive the advanceTime. |
void |
prepare(long cycle)
Informs the policy that processing for a new cycle is about to begin. |
protected ReservationSet |
processDemand(long cycle)
For each newly requested reservation, assigns a term to request, and a broker to bid from. |
protected ReservationSet |
processRenewing(long cycle)
Returns a fresh ReservationSet of expiring reservations to try to renew in this bidding cycle, and suggest new terms for them. |
| Methods inherited from class orca.policy.core.BaseServiceManagerCalendarPolicy |
|---|
addEventHandler, checkPending, close, closed, demand, error, extend, finish, getClosing, getHoldings, getHoldings, getPending, getRedeeming, getTicketingReservations, getTicketingUnits, getTicketingUnits, getTicketingUnits, initialize, isExpired, remove, removeEventHandler, revisit, setEventHandler |
| Methods inherited from class orca.shirako.core.ServiceManagerPolicy |
|---|
leaseSatisfies, reset, revisit, ticketSatisfies, updateTicketComplete |
| Methods inherited from class orca.shirako.core.Policy |
|---|
getGuid, internalError, logError, logWarn, query, 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 |
|---|
getGuid, query, setActor, setLogger |
| Methods inherited from interface orca.shirako.api.ISerialize |
|---|
reset, save, save |
| Field Detail |
|---|
public static long CLOCK_SKEW
protected static long ADVANCE_CLOSE
| Constructor Detail |
|---|
public ServiceManagerSimplePolicyPlugin()
| Method Detail |
|---|
public void prepare(long cycle)
Note: The cycle number parameter is redundant and is passed for
convenience. The policy can always obtain the cycle number by calling
IActor.getCurrentCycle().
prepare in interface IPolicyprepare in class Policycycle - the cycle number that is about to be processedpublic Bids formulateBids(long cycle)
Here are some guidelines for implementing this method:
formulateBids in interface IClientPolicyformulateBids in class ServiceManagerPolicycycle - The current time
protected ReservationSet processDemand(long cycle)
throws java.lang.Exception
demand - a set of reservations that indicate the demand for
resourcespending - a set of reservations that are currently pending
java.lang.Exception - rare
protected Term getExtendTerm(Term suggestedTerm,
Term currentTerm)
throws java.lang.Exception
java.lang.Exception
protected ReservationSet processRenewing(long cycle)
throws java.lang.Exception
renewing - a set of reservations that are up for renewalpending - a set of reservations that are pending
java.lang.Exception - rare
public long getClose(ReservationClient reservation,
Term term)
throws java.lang.Exception
ADVANCE_CLOSE
getClose in class BaseServiceManagerCalendarPolicyreservation - the reservationterm - the term
java.lang.Exception
public long getRedeem(ReservationClient reservation)
throws java.lang.Exception
getRedeem in class BaseServiceManagerCalendarPolicyreservation - the reservation
java.lang.Exception
public long getRenew(ReservationClient reservation)
throws java.lang.Exception
getRenew in class BaseServiceManagerCalendarPolicyreservation - the reservation
java.lang.Exceptionpublic void demand(ResourceReservation reservation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||