Class BackendFileWriter

java.lang.Object
edu.rit.pj.cluster.BackendFileWriter

public class BackendFileWriter extends Object
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 Details

    • out

      public final PrintStream out
      Print stream for printing on the job frontend's standard output.
    • err

      public final PrintStream err
      Print stream for printing on the job frontend's standard error.
  • Constructor Details

    • BackendFileWriter

      public BackendFileWriter(JobFrontendRef theJobFrontend, JobBackendRef theJobBackend)
      Construct a new backend file writer.
      Parameters:
      theJobFrontend - Job Frontend.
      theJobBackend - Job Backend.
  • Method Details

    • open

      public BackendFileOutputStream open(File file, boolean append) throws IOException
      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

      public void outputFileOpenResult(JobFrontendRef theJobFrontend, int bfd, int ffd, IOException exc)
      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

      public void outputFileWriteResult(JobFrontendRef theJobFrontend, int ffd, IOException exc)
      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

      public void outputFileFlushResult(JobFrontendRef theJobFrontend, int ffd, IOException exc)
      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

      public void outputFileCloseResult(JobFrontendRef theJobFrontend, int ffd, IOException exc)
      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.