edu.rit.pj.cluster
Class JobBackendMessage
- java.lang.Object
-
- edu.rit.pj.cluster.Message
-
- edu.rit.pj.cluster.JobBackendMessage
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public abstract class JobBackendMessage extends Message implements java.io.Externalizable
Class JobBackendMessage provides a message sent to a Job Backend process (interface JobBackendRef) 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 JobBackendMessage()Construct a new job backend message.JobBackendMessage(int theTag)Construct a new job backend message with the given message tag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static JobBackendMessagecancelJob(JobFrontendRef theJobFrontend, java.lang.String errmsg)Construct a new "cancel job" message.static JobBackendMessagecommenceJob(JobFrontendRef theJobFrontend, java.net.InetSocketAddress[] middlewareAddress, java.net.InetSocketAddress[] worldAddress, java.net.InetSocketAddress[] frontendAddress, java.util.Properties properties, java.lang.String mainClassName, java.lang.String[] args)Construct a new "commence job" message.static JobBackendMessageinputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Construct a new "input file close result" message.static JobBackendMessageinputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)Construct a new "input file open result" message.static JobBackendMessageinputFileReadResult(JobFrontendRef theJobFrontend, int ffd, int len, java.io.IOException exc)Construct a new "input file read result" message.static JobBackendMessageinputFileSkipResult(JobFrontendRef theJobFrontend, int ffd, long len, java.io.IOException exc)Construct a new "input file skip result" message.voidinvoke(JobBackendRef theJobBackend, JobFrontendRef theJobFrontend)Invoke the method corresponding to this job backend message on the given Job Backend object.static JobBackendMessagejobFinished(JobFrontendRef theJobFrontend)Construct a new "job finished" message.static JobBackendMessageoutputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Construct a new "output file close result" message.static JobBackendMessageoutputFileFlushResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Construct a new "output file flush result" message.static JobBackendMessageoutputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)Construct a new "output file open result" message.static JobBackendMessageoutputFileWriteResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Construct a new "output file write result" message.voidreadExternal(java.io.ObjectInput in)Read this job backend message from the given object input stream.static JobBackendMessagerenewLease(JobFrontendRef theJobFrontend)Construct a new "renew lease" message.static JobBackendMessagereportResource(JobFrontendRef theJobFrontend, java.lang.String resourceName, byte[] content)Construct a new "report resource" message.static JobBackendMessagereportResource(JobFrontendRef theJobFrontend, java.lang.String resourceName, ByteSequence content)Construct a new "report resource" message.voidwriteExternal(java.io.ObjectOutput out)Write this job backend message to the given object output stream.
-
-
-
Constructor Detail
-
JobBackendMessage
public JobBackendMessage()
Construct a new job backend message.
-
JobBackendMessage
public JobBackendMessage(int theTag)
Construct a new job backend message with the given message tag.- Parameters:
theTag- Message tag to use when sending this message.
-
-
Method Detail
-
cancelJob
public static JobBackendMessage 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.
-
commenceJob
public static JobBackendMessage commenceJob(JobFrontendRef theJobFrontend, java.net.InetSocketAddress[] middlewareAddress, java.net.InetSocketAddress[] worldAddress, java.net.InetSocketAddress[] frontendAddress, java.util.Properties properties, java.lang.String mainClassName, java.lang.String[] args)
Construct a new "commence job" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.middlewareAddress- Array of hosts/ports for middleware messages. The first K elements are for the job backend processes in rank order, the K+1st element is for the job frontend process. If theworldAddress- Array of hosts/ports for the world communicator. The K elements are for the job backend processes in rank order.frontendAddress- Array of hosts/ports for the frontend communicator. The first K elements are for the job backend processes in rank order, the K+1st element is for the job frontend process. If the frontend communicator does not exist, frontendAddress is null.properties- Java system properties.mainClassName- Fully qualified class name of the Java main program class to execute.args- Array of 0 or more Java command line arguments.- Returns:
- "Commence job" message.
-
jobFinished
public static JobBackendMessage 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 JobBackendMessage renewLease(JobFrontendRef theJobFrontend)
Construct a new "renew lease" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.- Returns:
- "Renew lease" message.
-
reportResource
public static JobBackendMessage reportResource(JobFrontendRef theJobFrontend, java.lang.String resourceName, byte[] content)
Construct a new "report resource" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.resourceName- Resource name.content- Resource content, or null if resource not found.- Returns:
- "Report resource" message.
-
reportResource
public static JobBackendMessage reportResource(JobFrontendRef theJobFrontend, java.lang.String resourceName, ByteSequence content)
Construct a new "report resource" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.resourceName- Resource name.content- Resource content, or null if resource not found.- Returns:
- "Report resource" message.
-
outputFileOpenResult
public static JobBackendMessage outputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)
Construct a new "output file open result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.bfd- Backend file descriptor.ffd- Frontend file descriptor if success.exc- Null if success, exception if failure.- Returns:
- "Output file open result" message.
-
outputFileWriteResult
public static JobBackendMessage outputFileWriteResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Construct a new "output file write result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Returns:
- "Output file write result" message.
-
outputFileFlushResult
public static JobBackendMessage outputFileFlushResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Construct a new "output file flush result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Returns:
- "Output file flush result" message.
-
outputFileCloseResult
public static JobBackendMessage outputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Construct a new "output file close result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Returns:
- "Output file close result" message.
-
inputFileOpenResult
public static JobBackendMessage inputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)
Construct a new "input file open result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.bfd- Backend file descriptor.ffd- Frontend file descriptor if success.exc- Null if success, exception if failure.- Returns:
- "Input file open result" message.
-
inputFileReadResult
public static JobBackendMessage inputFileReadResult(JobFrontendRef theJobFrontend, int ffd, int len, java.io.IOException exc)
Construct a new "input file read result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.len- Number of bytes read, or -1 if EOF.exc- Null if success, exception if failure.- Returns:
- "Input file read result" message.
-
inputFileSkipResult
public static JobBackendMessage inputFileSkipResult(JobFrontendRef theJobFrontend, int ffd, long len, java.io.IOException exc)
Construct a new "input file skip result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.len- Number of bytes skipped.exc- Null if success, exception if failure.- Returns:
- "Input file skip result" message.
-
inputFileCloseResult
public static JobBackendMessage inputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Construct a new "input file close result" message.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Returns:
- "Input file close result" message.
-
invoke
public void invoke(JobBackendRef theJobBackend, JobFrontendRef theJobFrontend) throws java.io.IOException
Invoke the method corresponding to this job backend message on the given Job Backend object. The method arguments come from the fields of this job backend message object.- Parameters:
theJobBackend- Job Backend 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 backend 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 backend 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