Class FrontendFileWriter

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

public class FrontendFileWriter extends Object
Class FrontendFileWriter provides an object that writes sequential files in the job frontend process.
Version:
21-Jun-2007
Author:
Alan Kaminsky
  • Constructor Details

    • FrontendFileWriter

      public FrontendFileWriter(JobFrontend theJobFrontend)
      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

      public void outputFileWrite(JobBackendRef theJobBackend, int ffd, int len) throws IOException
      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

      public void outputFileFlush(JobBackendRef theJobBackend, int ffd) throws IOException
      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

      public void outputFileClose(JobBackendRef theJobBackend, int ffd) throws IOException
      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.