Package edu.rit.pj.cluster
Class FrontendFileWriter
java.lang.Object
edu.rit.pj.cluster.FrontendFileWriter
Class FrontendFileWriter provides an object that writes sequential files in
the job frontend process.
- Version:
- 21-Jun-2007
- Author:
- Alan Kaminsky
-
Constructor Summary
ConstructorDescriptionFrontendFileWriter
(JobFrontend theJobFrontend) Construct a new frontend file writer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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, int len) Write the given bytes to the given output file.
-
Constructor Details
-
FrontendFileWriter
Construct a new frontend file writer.- Parameters:
theJobFrontend
- Job Frontend.
-
-
Method Details
-
outputFileOpen
public void outputFileOpen(JobBackendRef theJobBackend, int bfd, File file, boolean append) throws IOException Open the given output file for writing or appending.- Parameters:
theJobBackend
- Job Backend that is calling this method.bfd
- Backend file descriptor.file
- File.append
- True to append, false to overwrite.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
outputFileWrite
Write the given bytes to the given output file.ffd
= 1 refers to the job's standard output stream;ffd
= 2 refers to the job's standard error stream; other values refer to a previously opened file.- Parameters:
theJobBackend
- Job Backend that is calling this method.ffd
- Frontend file descriptor.len
- Number of bytes to write.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
outputFileFlush
Flush accumulated bytes to the given output file.- Parameters:
theJobBackend
- Job Backend that is calling this method.ffd
- Frontend file descriptor.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
outputFileClose
Close the given output file.- Parameters:
theJobBackend
- Job Backend that is calling this method.ffd
- Frontend file descriptor.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-