|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
edu.rit.pj.cluster.test.JobFrontendStub
public class JobFrontendStub
Class JobFrontendStub provides a stub for the PJ job frontend process. It receives job frontend messages from a channel and prints each message on the console.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
JobFrontendStub(ChannelGroup theChannelGroup)
Construct a new job frontend stub. |
|
| Method Summary | |
|---|---|
void |
assignBackend(JobSchedulerRef theJobScheduler,
String name,
String host,
String jvm,
String classpath,
String[] jvmflags,
String shellCommand,
int Nt)
Assign a backend process to the job. |
void |
assignJobNumber(JobSchedulerRef theJobScheduler,
int jobnum,
String pjhost)
Assign a job number to the job. |
void |
backendFinished(JobBackendRef theJobBackend)
Report that a backend process has finished executing the job. |
void |
backendReady(JobBackendRef theJobBackend,
int rank,
InetSocketAddress middlewareAddress,
InetSocketAddress worldAddress,
InetSocketAddress frontendAddress)
Report that a backend process is ready to commence executing the job. |
void |
cancelJob(JobBackendRef theJobBackend,
String errmsg)
Cancel the job. |
void |
cancelJob(JobSchedulerRef theJobScheduler,
String errmsg)
Cancel the job. |
void |
close()
Close communication with this Job Frontend. |
void |
inputFileClose(JobBackendRef theJobBackend,
int ffd)
Close the given input file. |
void |
inputFileOpen(JobBackendRef theJobBackend,
int bfd,
File file)
Open the given input file for reading. |
void |
inputFileRead(JobBackendRef theJobBackend,
int ffd,
int len)
Read bytes from the given input file. |
void |
inputFileSkip(JobBackendRef theJobBackend,
int ffd,
long len)
Skip bytes from the given input file. |
void |
outputFileClose(JobBackendRef theJobBackend,
int ffd)
Close the given output file. |
void |
outputFileFlush(JobBackendRef theJobBackend,
int ffd)
Flush accumulated bytes to the given output file. |
void |
outputFileOpen(JobBackendRef theJobBackend,
int bfd,
File file,
boolean append)
Open the given output file for writing or appending. |
void |
outputFileWrite(JobBackendRef theJobBackend,
int ffd,
byte[] buf,
int off,
int len)
Write the given bytes to the given output file. |
void |
renewLease(JobBackendRef theJobBackend)
Renew the lease on the job. |
void |
renewLease(JobSchedulerRef theJobScheduler)
Renew the lease on the job. |
void |
reportComment(JobBackendRef theJobBackend,
int rank,
String comment)
Report a comment for a process. |
void |
requestResource(JobBackendRef theJobBackend,
String resourceName)
Request the given resource from this job frontend's class loader. |
void |
run()
Run this job frontend stub. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, 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 java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JobFrontendStub(ChannelGroup theChannelGroup)
theChannelGroup - Channel group.| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Thread
public void assignBackend(JobSchedulerRef theJobScheduler,
String name,
String host,
String jvm,
String classpath,
String[] jvmflags,
String shellCommand,
int Nt)
assignBackend in interface JobFrontendReftheJobScheduler - 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.shellCommand - Shell command string.Nt - Number of CPUs assigned to the process.
IOException - Thrown if an I/O error occurred.
public void assignJobNumber(JobSchedulerRef theJobScheduler,
int jobnum,
String pjhost)
assignJobNumber in interface JobFrontendReftheJobScheduler - Job Scheduler that is calling this method.jobnum - Job number.pjhost - Host name for middleware channel group.
IOException - Thrown if an I/O error occurred.
public void cancelJob(JobSchedulerRef theJobScheduler,
String errmsg)
cancelJob in interface JobFrontendReftheJobScheduler - Job Scheduler that is calling this method.errmsg - Error message string.
IOException - Thrown if an I/O error occurred.public void renewLease(JobSchedulerRef theJobScheduler)
renewLease in interface JobFrontendReftheJobScheduler - Job Scheduler that is calling this method.
IOException - Thrown if an I/O error occurred.public void backendFinished(JobBackendRef theJobBackend)
backendFinished in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.
IOException - Thrown if an I/O error occurred.
public void backendReady(JobBackendRef theJobBackend,
int rank,
InetSocketAddress middlewareAddress,
InetSocketAddress worldAddress,
InetSocketAddress frontendAddress)
backendReady in interface JobFrontendReftheJobBackend - 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.
IOException - Thrown if an I/O error occurred.
public void cancelJob(JobBackendRef theJobBackend,
String errmsg)
cancelJob in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.errmsg - Error message string.
IOException - Thrown if an I/O error occurred.public void renewLease(JobBackendRef theJobBackend)
renewLease in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.
IOException - Thrown if an I/O error occurred.
public void requestResource(JobBackendRef theJobBackend,
String resourceName)
requestResource in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.resourceName - Resource name.
IOException - Thrown if an I/O error occurred.
public void outputFileOpen(JobBackendRef theJobBackend,
int bfd,
File file,
boolean append)
outputFileOpen in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.bfd - Backend file descriptor.file - File.append - True to append, false to overwrite.
IOException - Thrown if an I/O error occurred.
public void outputFileWrite(JobBackendRef theJobBackend,
int ffd,
byte[] buf,
int off,
int len)
outputFileWrite in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.buf - Array of bytes to write.off - Index of first byte to write.len - Number of bytes to write.
IOException - Thrown if an I/O error occurred.
public void outputFileFlush(JobBackendRef theJobBackend,
int ffd)
outputFileFlush in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.
IOException - Thrown if an I/O error occurred.
public void outputFileClose(JobBackendRef theJobBackend,
int ffd)
outputFileClose in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.
IOException - Thrown if an I/O error occurred.
public void inputFileOpen(JobBackendRef theJobBackend,
int bfd,
File file)
inputFileOpen in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.bfd - Backend file descriptor.file - File.
IOException - Thrown if an I/O error occurred.
public void inputFileRead(JobBackendRef theJobBackend,
int ffd,
int len)
inputFileRead in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.len - Number of bytes to read.
IOException - Thrown if an I/O error occurred.
public void inputFileSkip(JobBackendRef theJobBackend,
int ffd,
long len)
inputFileSkip in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.len - Number of bytes to skip.
IOException - Thrown if an I/O error occurred.
public void inputFileClose(JobBackendRef theJobBackend,
int ffd)
inputFileClose in interface JobFrontendReftheJobBackend - Job Backend that is calling this method.ffd - Frontend file descriptor.
IOException - Thrown if an I/O error occurred.
public void reportComment(JobBackendRef theJobBackend,
int rank,
String comment)
reportComment in interface JobFrontendReftheJobBackend - Job backend that is calling this method.rank - Process rank.comment - Comment string.
IOException - Thrown if an I/O error occurred.public void close()
close in interface JobFrontendRef
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||