orca.shirako.api
Interface IServerPolicy

All Superinterfaces:
IInitialize, IPolicy, IRecover, ISerialize
All Known Subinterfaces:
IAuthorityPolicy, IBrokerPolicy
All Known Implementing Classes:
AgentQueuedBestFitPolicyPlugin, AuthorityBasePolicyPlugin, AuthorityPolicy, BrokerBasePolicyPlugin, BrokerBestFitPolicyPlugin, BrokerPolicy, BrokerPriorityPolicyPlugin, BrokerQueuedWorstFitPolicyPlugin, BrokerSimplePolicyPlugin, BrokerWorstFitMultiplePoolsPolicyPlugin, BrokerWorstFitPolicyPlugin

public interface IServerPolicy
extends IPolicy

IServerPolicy defines the policy interface for an actor acting as a server for another actor (broker or a site authority).


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 donate(ReservationClient r)
          Accepts ticketed resources to be used for allocation of client requests.
 boolean extend(BrokerReservation r)
          Handles an incoming request to extend previously allocated resources and issue a ticket for the reservation.
 
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

donate

void donate(ReservationClient r)
            throws java.lang.Exception
Accepts ticketed resources to be used for allocation of client requests. The policy should add the resources represented by this reservation to its inventory. This method is invoked with the kernel lock on.

Note: 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.

Parameters:
resources - reservation representing resources to be used for allocation
Throws:
java.lang.Exception

bind

boolean bind(BrokerReservation reservation)
             throws java.lang.Exception
Handles an incoming request to allocate resources and issue a ticket for the reservation. The requested resources can be obtained by calling reservation.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.

Parameters:
reservation - reservation to allocate resources for.
Returns:
true, if the request has been fulfilled, false, if the allocation of resources will be delayed until a later time.
Throws:
java.lang.Exception

extend

boolean extend(BrokerReservation r)
               throws java.lang.Exception
Handles an incoming request to extend previously allocated resources and issue a ticket for the reservation. The requested resources can be obtained by calling reservation.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.

Parameters:
reservation - reservation to allocate resources for.
Returns:
true, if the request has been fulfilled, false, if the allocation of resources will be delayed until a later time.
Throws:
java.lang.Exception

allocate

void allocate(long cycle)
              throws java.lang.Exception
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.

Parameters:
cycle - the cycle for this allocation
Throws:
java.lang.Exception


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