edu.rit.pj.cluster
Class BackendFileReader
- java.lang.Object
-
- edu.rit.pj.cluster.BackendFileReader
-
public class BackendFileReader extends java.lang.ObjectClass 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.
-
-
Field Summary
Fields Modifier and Type Field and Description BackendFileInputStreaminInput stream for reading from the job frontend's standard input.
-
Constructor Summary
Constructors Constructor and Description BackendFileReader(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)Construct a new backend file reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidinputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)Report the result of closing the given input file.voidinputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)Report the result of opening the given input file.voidinputFileReadResult(JobFrontendRef theJobFrontend, int ffd, int len, java.io.IOException exc)Report the result of reading the given input file.voidinputFileSkipResult(JobFrontendRef theJobFrontend, int ffd, long len, java.io.IOException exc)Report the result of skipping the given input file.BackendFileInputStreamopen(java.io.File file)Open a backend file input stream on the given file.
-
-
-
Field Detail
-
in
public final BackendFileInputStream in
Input stream for reading from the job frontend's standard input.
-
-
Constructor Detail
-
BackendFileReader
public BackendFileReader(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)
Construct a new backend file reader.- Parameters:
theJobFrontend- Job Frontend.theJobBackend- Job Backend.
-
-
Method Detail
-
open
public BackendFileInputStream open(java.io.File file) throws java.io.IOException
Open a backend file input stream on the given file.- Parameters:
file- File.- Returns:
- Backend file input stream.
- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
inputFileOpenResult
public void inputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, java.io.IOException exc)
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
public void inputFileReadResult(JobFrontendRef theJobFrontend, int ffd, int len, java.io.IOException exc)
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.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
inputFileSkipResult
public void inputFileSkipResult(JobFrontendRef theJobFrontend, int ffd, long len, java.io.IOException exc)
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.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
inputFileCloseResult
public void inputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, java.io.IOException exc)
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.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG