Class StreamHandler

java.lang.Object
org.tasktide.engine.executor.streamhandler.StreamHandler

public class StreamHandler extends Object
Stdout and Stderr log stream handler for ProcessExecutor. Logs lt 1MB stored in DB, otherwise zipped and recorded in DB. Functional Interface and LogTarget could help with sinking to say CloudWatch etc
  • Constructor Details

    • StreamHandler

      public StreamHandler(File stdout, File stderr)
      Construct with log files
      Parameters:
      stdout -
      stderr -
  • Method Details

    • handleLogs

      public void handleLogs() throws IOException
      Measures log file size less than 1MB is stored in DB, otherwise file is retained and logged on database
      Throws:
      IOException
    • measureSizes

      public long measureSizes() throws IOException
      Measure size of both stdout, and stderr
      Returns:
      long
      Throws:
      IOException
    • zipFiles

      public Path zipFiles() throws IOException
      Zip the stdour/stderr logs
      Returns:
      Zip Size
      Throws:
      IOException
    • unpackZip

      public void unpackZip(Path zipFile) throws IOException
      Unpacks zip file
      Parameters:
      zipFile -
      Throws:
      IOException
    • readStderr

      public String[] readStderr() throws IOException
      Read stderr file
      Returns:
      String[]
      Throws:
      IOException
    • readStdout

      public String[] readStdout() throws IOException
      Read stdout file
      Returns:
      String[]
      Throws:
      IOException
    • getStdout

      public File getStdout()
      Gets stdout file
      Returns:
      File
    • getStderr

      public File getStderr()
      Gets stderr file
      Returns:
      File
    • getStderrArr

      public String[] getStderrArr()
      Gets stderr arr
      Returns:
    • setStderrArr

      public void setStderrArr(String[] stderrArr)
      Sets stderr arr
      Parameters:
      stderrArr -
    • getStdoutArr

      public String[] getStdoutArr()
      Get stdout arr
      Returns:
    • setStdoutArr

      public void setStdoutArr(String[] stdoutArr)
      Sets stdout arr
      Parameters:
      stdoutArr -