edu.rit.pj.cluster
Class FrontendFileReader

java.lang.Object
  extended by edu.rit.pj.cluster.FrontendFileReader

public class FrontendFileReader
extends Object

Class FrontendFileReader provides an object that reads sequential files in the job frontend process.


Constructor Summary
FrontendFileReader(JobFrontend theJobFrontend)
          Construct a new frontend file reader.
 
Method Summary
 void inputFileClose(JobBackendRef theJobBackend, int ffd)
          Close the given input file.
 void inputFileOpen(JobBackendRef theJobBackend, int bfd, File file)
          Open the given input file for reading.
 void inputFileRead(JobBackendRef theJobBackend, int ffd, int len)
          Read bytes from the given input file.
 void inputFileSkip(JobBackendRef theJobBackend, int ffd, long len)
          Skip bytes from the given input file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrontendFileReader

public FrontendFileReader(JobFrontend theJobFrontend)
Construct a new frontend file reader.

Parameters:
theJobFrontend - Job Frontend.
Method Detail

inputFileOpen

public void inputFileOpen(JobBackendRef theJobBackend,
                          int bfd,
                          File file)
                   throws IOException
Open the given input file for reading.

Parameters:
theJobBackend - Job Backend that is calling this method.
bfd - Backend file descriptor.
file - File.
Throws:
IOException - Thrown if an I/O error occurred.

inputFileRead

public void inputFileRead(JobBackendRef theJobBackend,
                          int ffd,
                          int len)
                   throws IOException
Read bytes from the given input file. ffd = 1 refers to the job's standard input 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 read.
Throws:
IOException - Thrown if an I/O error occurred.

inputFileSkip

public void inputFileSkip(JobBackendRef theJobBackend,
                          int ffd,
                          long len)
                   throws IOException
Skip bytes from the given input file.

Parameters:
theJobBackend - Job Backend that is calling this method.
ffd - Frontend file descriptor.
len - Number of bytes to skip.
Throws:
IOException - Thrown if an I/O error occurred.

inputFileClose

public void inputFileClose(JobBackendRef theJobBackend,
                           int ffd)
                    throws IOException
Close the given input file.

Parameters:
theJobBackend - Job Backend that is calling this method.
ffd - Frontend file descriptor.
Throws:
IOException - Thrown if an I/O error occurred.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.