Class JobSchedulerMessage

java.lang.Object
edu.rit.pj.cluster.Message
edu.rit.pj.cluster.JobSchedulerMessage
All Implemented Interfaces:
Externalizable, Serializable

public abstract class JobSchedulerMessage extends Message implements Externalizable
Class JobSchedulerMessage provides a message sent to a Job Scheduler process (interface JobSchedulerRef) in the PJ cluster middleware.
Version:
24-Jan-2012
Author:
Alan Kaminsky
See Also:
  • Constructor Details

    • 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 Details

    • backendFailed

      public static JobSchedulerMessage backendFailed(JobFrontendRef theJobFrontend, String name)
      Construct a new "backend failed" message.
      Parameters:
      theJobFrontend - Job frontend that is calling this method.
      name - Backend node name.
      Returns:
      a JobSchedulerMessage object.
    • cancelJob

      public static JobSchedulerMessage cancelJob(JobFrontendRef theJobFrontend, String errmsg)
      Construct a new "cancel job" message.
      Parameters:
      theJobFrontend - Job frontend that is calling this method.
      errmsg - Error message string.
      Returns:
      a JobSchedulerMessage object.
    • jobFinished

      public static JobSchedulerMessage jobFinished(JobFrontendRef theJobFrontend)
      Construct a new "job finished" message.
      Parameters:
      theJobFrontend - Job frontend that is calling this method.
      Returns:
      a JobSchedulerMessage object.
    • renewLease

      public static JobSchedulerMessage renewLease(JobFrontendRef theJobFrontend)
      Construct a new "renew lease" message.
      Parameters:
      theJobFrontend - Job frontend that is calling this method.
      Returns:
      a JobSchedulerMessage object.
    • reportComment

      public static JobSchedulerMessage reportComment(JobFrontendRef theJobFrontend, int rank, String comment)
      Construct a new "report comment" message.
      Parameters:
      theJobFrontend - Job frontend that is calling this method.
      rank - Process rank.
      comment - Comment string.
      Returns:
      a JobSchedulerMessage object.
    • requestJob

      public static JobSchedulerMessage requestJob(JobFrontendRef theJobFrontend, 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."
      Returns:
      a JobSchedulerMessage object.
    • invoke

      public void invoke(JobSchedulerRef theJobScheduler, JobFrontendRef theJobFrontend) throws 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:
      IOException - Thrown if an I/O error occurred.
      IOException - if any.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Write this job scheduler message to the given object output stream.
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException - Thrown if an I/O error occurred.
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      Read this job scheduler message from the given object input stream.
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException - Thrown if an I/O error occurred.