orca.tests.core
Class SimpleLoadSource

java.lang.Object
  extended by orca.tests.core.SimpleLoadSource
All Implemented Interfaces:
IInitialize, ILoadSource

public class SimpleLoadSource
extends java.lang.Object
implements ILoadSource

Very simple demand. Creates demand either once (if oneRequestOnly used) or on every cycle. Only bids for one resource type and the same number of resources and term length every time.

Author:
grit

Field Summary
protected  long advanceTime
          The advance time.
protected  ActorClock clock
          The clock
static long CLOCK_SKEW
          The amount of time over specific policy decisions the SM must add when communicating with other actors (e.g.
protected  boolean firstDemand
          Indicates if the load source is on its first demand or not
protected  int leaseLength
          The length of the lease
protected  LoggingTool logger
          The logger
protected  long previousCycle
          What the previous cycle was
static java.lang.String PropertyLeaseLength
           
static java.lang.String PropertyOneRequest
           
static java.lang.String PropertyResourceType
           
static java.lang.String PropertySliceName
           
static java.lang.String PropertyUnits
           
protected  ResourceType resourceType
          The resource type the SM wants
protected  CodSlice slice
          The slice
protected  java.lang.String sliceName
          The name of the slice the SM is requesting from
protected  ServiceManager sm
          The service manager
protected  int units
          Number of units the SM wants
protected  boolean unsetAdvance
          If the advance time has been set
 
Constructor Summary
SimpleLoadSource()
           
 
Method Summary
protected  void bid(long cycle)
          Make a bid to the SM.
 void configure(java.util.Properties p)
           
 LoggingTool getLogger()
          Returns the logger associated with the controller.
 void initialize()
          Initializes the object.
 void setActor(IActor serviceManager)
          Attach the actor
protected  void setAdvanceTime()
          Calls up to a default broker to query and set the advance time.
 void setLeaseLength(int lease)
          Set the lease length
 void setLeaseLength(java.lang.Integer lease)
          Set the lease length
 void setOneRequestOnly(boolean value)
          Set one request or multiple
 void setOneRequestOnly(java.lang.Boolean value)
          Set one request or multiple
 void setResourceType(ResourceType resType)
          Set the resource type
 void setResourceType(java.lang.String resType)
          Set the resource type
 void setUnits(int u)
          Set the units
 void setUnits(java.lang.Integer u)
          Set the units
 void tick(long cycle)
          Informs the load source that another cycle has passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PropertyUnits

public static final java.lang.String PropertyUnits
See Also:
Constant Field Values

PropertyResourceType

public static final java.lang.String PropertyResourceType
See Also:
Constant Field Values

PropertyLeaseLength

public static final java.lang.String PropertyLeaseLength
See Also:
Constant Field Values

PropertyOneRequest

public static final java.lang.String PropertyOneRequest
See Also:
Constant Field Values

PropertySliceName

public static final java.lang.String PropertySliceName
See Also:
Constant Field Values

slice

protected CodSlice slice
The slice


sm

protected ServiceManager sm
The service manager


clock

protected ActorClock clock
The clock


logger

protected LoggingTool logger
The logger


CLOCK_SKEW

public static final long CLOCK_SKEW
The amount of time over specific policy decisions the SM must add when communicating with other actors (e.g. redeem() and renew()). Clock skew must be at least one if the SM is ticked after the agent and/or authority At some point in time we may want this to not be static and learn it from what we see in the system, but for now it is static.

See Also:
Constant Field Values

previousCycle

protected long previousCycle
What the previous cycle was


firstDemand

protected boolean firstDemand
Indicates if the load source is on its first demand or not


unsetAdvance

protected boolean unsetAdvance
If the advance time has been set


advanceTime

protected long advanceTime
The advance time. Indicates how early the SM needs to bid to a particular broker to make the correct allocation cycle.


units

protected int units
Number of units the SM wants


resourceType

protected ResourceType resourceType
The resource type the SM wants


leaseLength

protected int leaseLength
The length of the lease


sliceName

protected java.lang.String sliceName
The name of the slice the SM is requesting from

Constructor Detail

SimpleLoadSource

public SimpleLoadSource()
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Description copied from interface: IInitialize
Initializes the object.

Specified by:
initialize in interface IInitialize
Throws:
java.lang.Exception

tick

public void tick(long cycle)
Informs the load source that another cycle has passed. Initiates the formation of demand for the service manager.

Specified by:
tick in interface ILoadSource
Parameters:
cycle - this cycle

setAdvanceTime

protected void setAdvanceTime()
Calls up to a default broker to query and set the advance time.


bid

protected void bid(long cycle)
Make a bid to the SM. This policy makes one reservation request per bidding cycle.

Parameters:
cycle - the current cycle

configure

public void configure(java.util.Properties p)
               throws java.lang.Exception
Throws:
java.lang.Exception

setActor

public void setActor(IActor serviceManager)
Attach the actor

Specified by:
setActor in interface ILoadSource
Parameters:
serviceManager - the service manager

setUnits

public void setUnits(int u)
Set the units

Parameters:
u - units

setUnits

public void setUnits(java.lang.Integer u)
Set the units

Parameters:
u - units

setResourceType

public void setResourceType(ResourceType resType)
Set the resource type

Parameters:
resType - resource type

setResourceType

public void setResourceType(java.lang.String resType)
Set the resource type

Parameters:
resType - resource type

setLeaseLength

public void setLeaseLength(int lease)
Set the lease length

Parameters:
lease - length of the lease

setLeaseLength

public void setLeaseLength(java.lang.Integer lease)
Set the lease length

Parameters:
lease - length of the lease

setOneRequestOnly

public void setOneRequestOnly(boolean value)
Set one request or multiple

Parameters:
value - true if one request only

setOneRequestOnly

public void setOneRequestOnly(java.lang.Boolean value)
Set one request or multiple

Parameters:
value - true if one request only

getLogger

public LoggingTool getLogger()
Description copied from interface: ILoadSource
Returns the logger associated with the controller.

Specified by:
getLogger in interface ILoadSource
Returns:
logger associated with the controller


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