Package edu.rit.pj.cluster
Class BackendFileReader
java.lang.Object
edu.rit.pj.cluster.BackendFileReader
Class BackendFileReader provides an object that reads sequential files in the
job backend process.
Note: Class BackendFileReader is not multiple thread safe; it assumes it is being called by a synchronized method in the job backend.
- Version:
- 20-Nov-2006
- Author:
- Alan Kaminsky
-
Field Summary
Modifier and TypeFieldDescriptionfinal BackendFileInputStream
Input stream for reading from the job frontend's standard input. -
Constructor Summary
ConstructorDescriptionBackendFileReader
(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend) Construct a new backend file reader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
inputFileCloseResult
(JobFrontendRef theJobFrontend, int ffd, IOException exc) Report the result of closing the given input file.void
inputFileOpenResult
(JobFrontendRef theJobFrontend, int bfd, int ffd, IOException exc) Report the result of opening the given input file.void
inputFileReadResult
(JobFrontendRef theJobFrontend, int ffd, int len, IOException exc) Report the result of reading the given input file.void
inputFileSkipResult
(JobFrontendRef theJobFrontend, int ffd, long len, IOException exc) Report the result of skipping the given input file.Open a backend file input stream on the given file.
-
Field Details
-
in
Input stream for reading from the job frontend's standard input.
-
-
Constructor Details
-
BackendFileReader
Construct a new backend file reader.- Parameters:
theJobFrontend
- Job Frontend.theJobBackend
- Job Backend.
-
-
Method Details
-
open
Open a backend file input stream on the given file.- Parameters:
file
- File.- Returns:
- Backend file input stream.
- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
inputFileOpenResult
Report the result of opening the given input 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.
-
inputFileReadResult
Report the result of reading the given input file.- 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.
-
inputFileSkipResult
Report the result of skipping the given input file.- 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.
-
inputFileCloseResult
Report the result of closing the given input file.- Parameters:
theJobFrontend
- Job Frontend that is calling this method.ffd
- Frontend file descriptor.exc
- Null if success, exception if failure.
-