edu.rit.pj.cluster
Class JobSchedulerMessage
- java.lang.Object
-
- edu.rit.pj.cluster.Message
-
- edu.rit.pj.cluster.JobSchedulerMessage
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public abstract class JobSchedulerMessage extends Message implements java.io.Externalizable
Class JobSchedulerMessage provides a message sent to a Job Scheduler process (interface JobSchedulerRef) in the PJ cluster middleware.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.rit.pj.cluster.Message
FILE_READ_DATA, FILE_WRITE_DATA, FROM_JOB_BACKEND, FROM_JOB_FRONTEND, FROM_JOB_LAUNCHER, FROM_JOB_SCHEDULER
-
-
Constructor Summary
Constructors Constructor and Description JobSchedulerMessage()Construct a new job scheduler message.JobSchedulerMessage(int theTag)Construct a new job scheduler message with the given message tag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static JobSchedulerMessagebackendFailed(JobFrontendRef theJobFrontend, java.lang.String name)Construct a new "backend failed" message.static JobSchedulerMessagecancelJob(JobFrontendRef theJobFrontend, java.lang.String errmsg)Construct a new "cancel job" message.voidinvoke(JobSchedulerRef theJobScheduler, JobFrontendRef theJobFrontend)Invoke the method corresponding to this job scheduler message on the given Job Scheduler object.static JobSchedulerMessagejobFinished(JobFrontendRef theJobFrontend)Construct a new "job finished" message.voidreadExternal(java.io.ObjectInput in)Read this job scheduler message from the given object input stream.static JobSchedulerMessagerenewLease(JobFrontendRef theJobFrontend)Construct a new "renew lease" message.static JobSchedulerMessagerequestJob(JobFrontendRef theJobFrontend, java.lang.String username, int Nn, int Np, int Nt)Construct a new "request job" message.voidwriteExternal(java.io.ObjectOutput out)Write this job scheduler message to the given object output stream.
-
-
-
Constructor Detail
-
JobSchedulerMessage
public JobSchedulerMessage()
Construct a new job scheduler message.
-
JobSchedulerMessage
public JobSchedulerMessage(int theTag)
Construct a new job scheduler message with the given message tag.- Parameters:
theTag- Message tag to use when sending this message.
-
-
Method Detail
-
backendFailed
public static JobSchedulerMessage backendFailed(JobFrontendRef theJobFrontend, java.lang.String name)
Construct a new "backend failed" message.- Parameters:
theJobFrontend- Job frontend that is calling this method.name- Backend node name.- Returns:
- "Backend failed" message.
-
cancelJob
public static JobSchedulerMessage cancelJob(JobFrontendRef theJobFrontend, java.lang.String errmsg)
Construct a new "cancel job" message.- Parameters:
theJobFrontend- Job frontend that is calling this method.errmsg- Error message string.- Returns:
- "Cancel job" message.
-
jobFinished
public static JobSchedulerMessage jobFinished(JobFrontendRef theJobFrontend)
Construct a new "job finished" message.- Parameters:
theJobFrontend- Job frontend that is calling this method.- Returns:
- "Job finished" message.
-
renewLease
public static JobSchedulerMessage renewLease(JobFrontendRef theJobFrontend)
Construct a new "renew lease" message.- Parameters:
theJobFrontend- Job frontend that is calling this method.- Returns:
- "Renew lease" message.
-
requestJob
public static JobSchedulerMessage requestJob(JobFrontendRef theJobFrontend, java.lang.String username, int Nn, int Np, int Nt)
Construct a new "request job" message.- Parameters:
theJobFrontend- Job frontend that is calling this method.username- User name.Nn- Number of backend nodes.Np- Number of processes.Nt- Number of CPUs per process. 0 means "all CPUs."- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
invoke
public void invoke(JobSchedulerRef theJobScheduler, JobFrontendRef theJobFrontend) throws java.io.IOException
Invoke the method corresponding to this job scheduler message on the given Job Scheduler object. The method arguments come from the fields of this job scheduler message object.- Parameters:
theJobScheduler- Job Scheduler on which to invoke the method.theJobFrontend- Job Frontend that is calling the method.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this job scheduler message to the given object output stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- Object output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOExceptionRead this job scheduler message from the given object input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- Object input stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG