Package edu.rit.pj.cluster
Class BackendFileWriter
java.lang.Object
edu.rit.pj.cluster.BackendFileWriter
Class 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.
- Version:
- 05-Nov-2006
- Author:
- Alan Kaminsky
-
Field Summary
Modifier and TypeFieldDescriptionfinal PrintStream
Print stream for printing on the job frontend's standard error.final PrintStream
Print stream for printing on the job frontend's standard output. -
Constructor Summary
ConstructorDescriptionBackendFileWriter
(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend) Construct a new backend file writer. -
Method Summary
Modifier and TypeMethodDescriptionOpen a backend file output stream on the given file.void
outputFileCloseResult
(JobFrontendRef theJobFrontend, int ffd, IOException exc) Report the result of closing the given output file.void
outputFileFlushResult
(JobFrontendRef theJobFrontend, int ffd, IOException exc) Report the result of flushing the given output file.void
outputFileOpenResult
(JobFrontendRef theJobFrontend, int bfd, int ffd, IOException exc) Report the result of opening the given output file.void
outputFileWriteResult
(JobFrontendRef theJobFrontend, int ffd, IOException exc) Report the result of writing the given output file.
-
Field Details
-
out
Print stream for printing on the job frontend's standard output. -
err
Print stream for printing on the job frontend's standard error.
-
-
Constructor Details
-
BackendFileWriter
Construct a new backend file writer.- Parameters:
theJobFrontend
- Job Frontend.theJobBackend
- Job Backend.
-
-
Method Details
-
open
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:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
outputFileOpenResult
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
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.
-
outputFileFlushResult
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.
-
outputFileCloseResult
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.
-