edu.rit.pj.cluster
Class JobFrontendMessage
- java.lang.Object
-
- edu.rit.pj.cluster.Message
-
- edu.rit.pj.cluster.JobFrontendMessage
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public abstract class JobFrontendMessage extends Message implements java.io.Externalizable
Class JobFrontendMessage provides a message sent to a Job Frontend process (interface JobFrontendRef) 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 JobFrontendMessage()Construct a new job frontend message.JobFrontendMessage(int theTag)Construct a new job frontend message with the given message tag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static JobFrontendMessageassignBackend(JobSchedulerRef theJobScheduler, java.lang.String name, java.lang.String host, java.lang.String jvm, java.lang.String classpath, java.lang.String[] jvmflags, int Nt)Construct a new "assign backend" message.static JobFrontendMessageassignJobNumber(JobSchedulerRef theJobScheduler, int jobnum, java.lang.String pjhost)Construct a new "assign job number" message.static JobFrontendMessagebackendFinished(JobBackendRef theJobBackend)Construct a new "backend finished" message.static JobFrontendMessagebackendReady(JobBackendRef theJobBackend, int rank, java.net.InetSocketAddress middlewareAddress, java.net.InetSocketAddress worldAddress, java.net.InetSocketAddress frontendAddress)Construct a new "backend ready" message.static JobFrontendMessagecancelJob(JobBackendRef theJobBackend, java.lang.String errmsg)Construct a new "cancel job" message.static JobFrontendMessagecancelJob(JobSchedulerRef theJobScheduler, java.lang.String errmsg)Construct a new "cancel job" message.static JobFrontendMessageinputFileClose(JobBackendRef theJobBackend, int ffd)Construct a new "input file close" message.static JobFrontendMessageinputFileOpen(JobBackendRef theJobBackend, int bfd, java.io.File file)Construct a new "input file open" message.static JobFrontendMessageinputFileRead(JobBackendRef theJobBackend, int ffd, int len)Construct a new "input file read" message.static JobFrontendMessageinputFileSkip(JobBackendRef theJobBackend, int ffd, long len)Construct a new "input file skip" message.voidinvoke(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)Invoke the method corresponding to this job frontend message on the given Job Frontend object.voidinvoke(JobFrontendRef theJobFrontend, JobSchedulerRef theJobScheduler)Invoke the method corresponding to this job frontend message on the given Job Frontend object.static JobFrontendMessageoutputFileClose(JobBackendRef theJobBackend, int ffd)Construct a new "output file close" message.static JobFrontendMessageoutputFileFlush(JobBackendRef theJobBackend, int ffd)Construct a new "output file flush" message.static JobFrontendMessageoutputFileOpen(JobBackendRef theJobBackend, int bfd, java.io.File file, boolean append)Construct a new "output file open" message.static JobFrontendMessageoutputFileWrite(JobBackendRef theJobBackend, int ffd, int len)Construct a new "output file write" message.voidreadExternal(java.io.ObjectInput in)Read this job frontend message from the given object input stream.static JobFrontendMessagerenewLease(JobBackendRef theJobBackend)Construct a new "renew lease" message.static JobFrontendMessagerenewLease(JobSchedulerRef theJobScheduler)Construct a new "renew lease" message.static JobFrontendMessagerequestResource(JobBackendRef theJobBackend, java.lang.String resourceName)Construct a new "request resource" message.voidwriteExternal(java.io.ObjectOutput out)Write this job frontend message to the given object output stream.
-
-
-
Constructor Detail
-
JobFrontendMessage
public JobFrontendMessage()
Construct a new job frontend message.
-
JobFrontendMessage
public JobFrontendMessage(int theTag)
Construct a new job frontend message with the given message tag.- Parameters:
theTag- Message tag to use when sending this message.
-
-
Method Detail
-
assignBackend
public static JobFrontendMessage assignBackend(JobSchedulerRef theJobScheduler, java.lang.String name, java.lang.String host, java.lang.String jvm, java.lang.String classpath, java.lang.String[] jvmflags, int Nt)
Construct a new "assign backend" message.- Parameters:
theJobScheduler- Job Scheduler that is calling this method.name- Backend node name.host- Host name for SSH remote login.jvm- Full pathname of Java Virtual Machine.classpath- Java class path for PJ Library.jvmflags- Array of JVM command line flags.Nt- Number of CPUs assigned to the process.- Returns:
- "Assign backend" message.
-
assignJobNumber
public static JobFrontendMessage assignJobNumber(JobSchedulerRef theJobScheduler, int jobnum, java.lang.String pjhost)
Construct a new "assign job number" message.- Parameters:
theJobScheduler- Job Scheduler that is calling this method.jobnum- Job number.pjhost- Host name for middleware channel group.- Returns:
- "Assign job number" message.
-
cancelJob
public static JobFrontendMessage cancelJob(JobSchedulerRef theJobScheduler, java.lang.String errmsg)
Construct a new "cancel job" message.- Parameters:
theJobScheduler- Job Scheduler that is calling this method.errmsg- Error message string.- Returns:
- "Cancel job" message.
-
renewLease
public static JobFrontendMessage renewLease(JobSchedulerRef theJobScheduler)
Construct a new "renew lease" message.- Parameters:
theJobScheduler- Job Scheduler that is calling this method.- Returns:
- "Renew lease" message.
-
backendFinished
public static JobFrontendMessage backendFinished(JobBackendRef theJobBackend)
Construct a new "backend finished" message.- Parameters:
theJobBackend- Job Backend that is calling this method.- Returns:
- "Backend finished" message.
-
backendReady
public static JobFrontendMessage backendReady(JobBackendRef theJobBackend, int rank, java.net.InetSocketAddress middlewareAddress, java.net.InetSocketAddress worldAddress, java.net.InetSocketAddress frontendAddress)
Construct a new "backend ready" message.- Parameters:
theJobBackend- Job Backend that is calling this method.rank- Rank of the job backend process.middlewareAddress- Host/port to which the job backend process is listening for middleware messages.worldAddress- Host/port to which the job backend process is listening for the world communicator.frontendAddress- Host/port to which the job backend process is listening for the frontend communicator, or null if the frontend communicator does not exist.- Returns:
- "Backend ready" message.
-
cancelJob
public static JobFrontendMessage cancelJob(JobBackendRef theJobBackend, java.lang.String errmsg)
Construct a new "cancel job" message.- Parameters:
theJobBackend- Job Backend that is calling this method.errmsg- Error message string.- Returns:
- "Cancel job" message.
-
renewLease
public static JobFrontendMessage renewLease(JobBackendRef theJobBackend)
Construct a new "renew lease" message.- Parameters:
theJobBackend- Job Backend that is calling this method.- Returns:
- "Renew lease" message.
-
requestResource
public static JobFrontendMessage requestResource(JobBackendRef theJobBackend, java.lang.String resourceName)
Construct a new "request resource" message.- Parameters:
theJobBackend- Job Backend that is calling this method.resourceName- Resource name.- Returns:
- "Request resource" message.
-
outputFileOpen
public static JobFrontendMessage outputFileOpen(JobBackendRef theJobBackend, int bfd, java.io.File file, boolean append)
Construct a new "output file open" message.- Parameters:
theJobBackend- Job Backend that is calling this method.bfd- Backend file descriptor.file- File.append- True to append, false to overwrite.- Returns:
- "Output file open" message.
-
outputFileWrite
public static JobFrontendMessage outputFileWrite(JobBackendRef theJobBackend, int ffd, int len)
Construct a new "output file write" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.len- Number of bytes to write.- Returns:
- "Output file write" message.
-
outputFileFlush
public static JobFrontendMessage outputFileFlush(JobBackendRef theJobBackend, int ffd)
Construct a new "output file flush" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.- Returns:
- "Flush file" message.
-
outputFileClose
public static JobFrontendMessage outputFileClose(JobBackendRef theJobBackend, int ffd)
Construct a new "output file close" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.- Returns:
- "Output file close" message.
-
inputFileOpen
public static JobFrontendMessage inputFileOpen(JobBackendRef theJobBackend, int bfd, java.io.File file)
Construct a new "input file open" message.- Parameters:
theJobBackend- Job Backend that is calling this method.bfd- Backend file descriptor.file- File.- Returns:
- "Input file open" message.
-
inputFileRead
public static JobFrontendMessage inputFileRead(JobBackendRef theJobBackend, int ffd, int len)
Construct a new "input file read" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.len- Number of bytes to read.- Returns:
- "Input file read" message.
-
inputFileSkip
public static JobFrontendMessage inputFileSkip(JobBackendRef theJobBackend, int ffd, long len)
Construct a new "input file skip" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.len- Number of bytes to skip.- Returns:
- "Input file skip" message.
-
inputFileClose
public static JobFrontendMessage inputFileClose(JobBackendRef theJobBackend, int ffd)
Construct a new "input file close" message.- Parameters:
theJobBackend- Job Backend that is calling this method.ffd- Frontend file descriptor.- Returns:
- "Input file close" message.
-
invoke
public void invoke(JobFrontendRef theJobFrontend, JobSchedulerRef theJobScheduler) throws java.io.IOException
Invoke the method corresponding to this job frontend message on the given Job Frontend object. The method arguments come from the fields of this job frontend message object.- Parameters:
theJobFrontend- Job Frontend on which to invoke the method.theJobScheduler- Job Scheduler that is calling the method.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
invoke
public void invoke(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend) throws java.io.IOException
Invoke the method corresponding to this job frontend message on the given Job Frontend object. The method arguments come from the fields of this job frontend message object.- Parameters:
theJobFrontend- Job Frontend on which to invoke the method.theJobBackend- Job Backend 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 frontend 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.IOException, java.lang.ClassNotFoundExceptionRead this job frontend 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.java.lang.ClassNotFoundException- Thrown if a class needed to read this job backend message could not be found.
-
-
DMelt 3.0 © DataMelt by jWork.ORG