edu.rit.pj.cluster
Class BackendFileWriter
- java.lang.Object
-
- edu.rit.pj.cluster.BackendFileWriter
-
public class BackendFileWriter extends java.lang.ObjectClass BackendFileWriter provides an object that writes sequential files in the job backend process.Note: Class BackendFileWriter is not multiple thread safe; it assumes it is being called by a synchronized method in the job backend.
-
-
Field Summary
Fields Modifier and Type Field and Description java.io.PrintStreamerrPrint stream for printing on the job frontend's standard error.java.io.PrintStreamoutPrint stream for printing on the job frontend's standard output.
-
Constructor Summary
Constructors Constructor and Description BackendFileWriter(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)Construct a new backend file writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description BackendFileOutputStreamopen(java.io.File file, boolean append)Open a backend file output stream on the given file.voidoutputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Report the result of closing the given output file.voidoutputFileFlushResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Report the result of flushing the given output file.voidoutputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)Report the result of opening the given output file.voidoutputFileWriteResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Report the result of writing the given output file.
-
-
-
Field Detail
-
out
public final java.io.PrintStream out
Print stream for printing on the job frontend's standard output.
-
err
public final java.io.PrintStream err
Print stream for printing on the job frontend's standard error.
-
-
Constructor Detail
-
BackendFileWriter
public BackendFileWriter(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)
Construct a new backend file writer.- Parameters:
theJobFrontend- Job Frontend.theJobBackend- Job Backend.
-
-
Method Detail
-
open
public BackendFileOutputStream open(java.io.File file, boolean append) throws java.io.IOException
Open a backend file output stream on the given file.- Parameters:
file- File.append- True to append, false to overwrite.- Returns:
- Backend file output stream.
- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
outputFileOpenResult
public void outputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)
Report the result of opening the given output file.- 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.
-
outputFileWriteResult
public void outputFileWriteResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Report the result of writing the given output file.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
outputFileFlushResult
public void outputFileFlushResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Report the result of flushing the given output file.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
outputFileCloseResult
public void outputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
Report the result of closing the given output file.- Parameters:
theJobFrontend- Job Frontend that is calling this method.ffd- Frontend file descriptor.exc- Null if success, exception if failure.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG