|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity AllocPolicy ARPolicy ARSimpleSpaceShared
public class ARSimpleSpaceShared
This is a resource scheduler that handles Advanced Reservation functionalities. This scheduler is also able to handle submitted jobs without reserving in the first place.
As this class name suggested, this scheduler is only able to handle some basic AR functionalities, such as:
There are some limitations on this scheduler:
GridSim
,
ResourceCharacteristics
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class ARPolicy |
---|
MILLI_SEC |
Fields inherited from class AllocPolicy |
---|
initTime_, myId_, outputPort_, resCalendar_, resId_, resName_, resource_, totalPE_ |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ARSimpleSpaceShared(String resourceName,
String entityName)
Creates a new scheduler that handles advanced reservations. |
|
ARSimpleSpaceShared(String resourceName,
String entityName,
int commitPeriod)
Creates a new scheduler that handles advanced reservations. |
Method Summary | |
---|---|
void |
body()
Handles internal events that are coming to this entity. |
void |
gridletCancel(int gridletId,
int userId)
Cancels a Gridlet running in this entity. |
void |
gridletMove(int gridletId,
int userId,
int destId,
boolean ack)
Moves a Gridlet from this GridResource entity to a different one. |
void |
gridletPause(int gridletId,
int userId,
boolean ack)
Pauses a Gridlet only if it is currently executing. |
void |
gridletResume(int gridletId,
int userId,
boolean ack)
Resumes a Gridlet only in the paused list. |
int |
gridletStatus(int gridletId,
int userId)
Finds the status of a specified Gridlet ID. |
void |
gridletSubmit(Gridlet gl,
boolean ack)
Schedules a new Gridlet that has been received by the GridResource entity. |
void |
handleCancelReservation(int reservationID,
int senderID,
ArrayList list,
int sendTag)
Handles a cancel reservation request for a given Gridlet ID list. |
void |
handleCancelReservation(int reservationID,
int senderID,
int sendTag)
Handles a cancel reservation request. |
void |
handleCancelReservation(int reservationID,
int senderID,
int gridletID,
int sendTag)
Handles a cancel reservation request. |
void |
handleCommitOnly(int reservationID,
int senderID,
int sendTag)
Handles a commit reservation request. |
void |
handleCommitReservation(int reservationID,
int senderID,
int sendTag,
Gridlet gridlet)
Handles a commit reservation request. |
void |
handleCommitReservation(int reservationID,
int senderID,
int sendTag,
GridletList list)
Handles a commit reservation request. |
void |
handleCreateReservation(ARObject obj,
int senderID,
int sendTag)
Handles an advanced reservation request. |
void |
handleImmediateReservation(ARObject obj,
int senderID,
int sendTag)
Handles an immediate reservation request. NOTE: currently able to handle a case where start time = 0 and duration or end time > 0. |
void |
handleModifyReservation(ARObject obj,
int senderID,
int sendTag)
Handles a modify reservation request (NOTE: NOT YET SUPPORTED). |
void |
handleQueryBusyTime(long from,
long to,
int senderID,
int sendTag,
double userTimeZone)
Handles a query busy time request (NOTE: NOT YET SUPPORTED). |
void |
handleQueryFreeTime(long from,
long to,
int senderID,
int sendTag,
double userTimeZone)
Handles a query free time request (NOTE: NOT YET SUPPORTED). |
void |
handleQueryReservation(int reservationID,
int senderID,
int sendTag)
Handles a query reservation request. |
Methods inherited from class ARPolicy |
---|
approxBusyTime, getCurrentTime, replyCancelReservation, replyCommitReservation, replyCreateReservation, replyModifyReservation, replyQueryReservation, replyTimeReservation, searchReservation |
Methods inherited from class AllocPolicy |
---|
addTotalLoad, calculateTotalLoad, findGridlet, getTotalLoad, gridletMigrate, init, isEndSimulation, processOtherEvent, sendAck, sendCancelGridlet, sendFinishGridlet, sendInternalEvent, sendInternalEvent, setEndSimulation |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ARSimpleSpaceShared(String resourceName, String entityName) throws Exception
resourceName
- the GridResource entity name that will contain
this allocation policyentityName
- this object name. The name of this entity will
be "resourceName_entityName".
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean)
,
GridSim.init(int, Calendar, boolean, String[], String[],
String)
public ARSimpleSpaceShared(String resourceName, String entityName, int commitPeriod) throws Exception
resourceName
- the GridResource entity name that will contain
this allocation policyentityName
- this object name. The name of this entity will
be "resourceName_entityName".commitPeriod
- a default commit period time for a user to commit
a reservation (unit is in second). NOTE: once it is
set, you can not change the time again.
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean)
,
GridSim.init(int, Calendar, boolean, String[], String[],
String)
Method Detail |
---|
public void handleModifyReservation(ARObject obj, int senderID, int sendTag)
handleModifyReservation
in class ARPolicy
obj
- a reservation objectsenderID
- a sender or user IDsendTag
- a tag to send to the userpublic void handleImmediateReservation(ARObject obj, int senderID, int sendTag)
handleImmediateReservation
in class ARPolicy
obj
- a reservation objectsenderID
- a sender or user IDsendTag
- a tag to send the result back to userpublic void handleCreateReservation(ARObject obj, int senderID, int sendTag)
handleCreateReservation
in class ARPolicy
obj
- a reservation objectsenderID
- a sender or user IDsendTag
- a tag to send the result back to userpublic void handleCancelReservation(int reservationID, int senderID, ArrayList list, int sendTag)
handleCancelReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender IDlist
- a list of Gridlet IDssendTag
- a tag to send the result back to userpublic void handleCancelReservation(int reservationID, int senderID, int sendTag)
handleCancelReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender IDsendTag
- a tag to send the result back to userpublic void handleCancelReservation(int reservationID, int senderID, int gridletID, int sendTag)
handleCancelReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender IDgridletID
- a Gridlet IDsendTag
- a tag to send the result back to userpublic void handleQueryBusyTime(long from, long to, int senderID, int sendTag, double userTimeZone)
handleQueryBusyTime
in class ARPolicy
from
- starting period timeto
- ending period timesenderID
- a sender or user IDsendTag
- a tag to send to the userpublic void handleQueryFreeTime(long from, long to, int senderID, int sendTag, double userTimeZone)
handleQueryFreeTime
in class ARPolicy
from
- starting period timeto
- ending period timesenderID
- a sender or user IDsendTag
- a tag to send to the userpublic void handleCommitOnly(int reservationID, int senderID, int sendTag)
handleCommitReservation(int, int, int, Gridlet)
or
handleCommitReservation(int, int, int, GridletList)
method.
handleCommitOnly
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender or user IDsendTag
- a tag to send to the userpublic void handleCommitReservation(int reservationID, int senderID, int sendTag, GridletList list)
handleCommitReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender or user IDsendTag
- a tag to send to the userlist
- a list of Gridlet objectpublic void handleCommitReservation(int reservationID, int senderID, int sendTag, Gridlet gridlet)
handleCommitReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender or user IDsendTag
- a tag to send to the usergridlet
- a Gridlet objectpublic void handleQueryReservation(int reservationID, int senderID, int sendTag)
handleQueryReservation
in class ARPolicy
reservationID
- a reservation IDsenderID
- a sender or user IDsendTag
- a tag to send to the userpublic void body()
body
in class Sim_entity
public void gridletSubmit(Gridlet gl, boolean ack)
gridletSubmit
in class AllocPolicy
gl
- a Gridlet object that is going to be executedack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)ResGridlet
,
ResGridletList
public int gridletStatus(int gridletId, int userId)
gridletStatus
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridlet
Gridlet
public void gridletCancel(int gridletId, int userId)
gridletCancel
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletpublic void gridletPause(int gridletId, int userId, boolean ack)
gridletPause
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletMove(int gridletId, int userId, int destId, boolean ack)
If a Gridlet has finished beforehand, then this method will send back the Gridlet to sender, i.e. the userId and sets the acknowledgment to false (if required).
gridletMove
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this GridletdestId
- a new destination GridResource ID for this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletResume(int gridletId, int userId, boolean ack)
gridletResume
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |