Class

agora.exec.model

OutputSettings

Related Doc: package model

Permalink

case class OutputSettings(streaming: Option[StreamingSettings] = Option(StreamingSettings()), stdOutFileName: Option[String] = None, stdErrFileName: Option[String] = None, canCache: Boolean = false, useCachedValueWhenAvailable: Boolean = true) extends Product with Serializable

Represents a configuration for what to do w/ a process output

If 'canCache' is true, then the output of the standard out and err will be returned if already found.

This is intended to work as follows:

# In the case where no '<workspace>/.cache/<MD5 of the command>' entry exists If there is no cached value, then the command is run as normal. A '.cache' directory will be created in the job's workspace in which we store cache metadata to contain:

<workspace>/.cache/<MD5 of the command>/.stdOutFileName # contains the name of the stdout file name
<workspace>/.cache/<MD5 of the command>/.stdErrFileName # contains the name of the stderr file name
<workspace>/.cache/<MD5 of the command>/.exitCode # set to the exit code
<workspace>/.cache/<MD5 of the command>/.job # a serialized version of the job

If the 'stdOutFileName' or 'stdErrFileName' are left empty when 'canCache' is set, then a unique filename will be used.

This is intended to mitigate the scenario where the same command is run concurrently, both set to allow caching.

This way both jobs will run, writing to different files, and just happily clobber the contents of the cache directory.

another approach would be to detect unfinished jobs (e.g. no .exitCode exists) and tail the existing job.

# In the case where a '<workspace>/.cache/<MD5 of the command>' entry exists

If that directory exists and an .exitCode file exists, then:

## When streaming is set if the exit code is listed in the a 'successExitCodes', then the contents .stdOutFileName is returned. Otherwise the contents of the .stdErrFileName are returned.

## When streaming is not set Then the FileResult is simply returned w/ the cached values (output file names, exit code, etc)

streaming

settings for streaming back the output of the job

stdOutFileName

an option filename to save the output file to. If 'canCache' is set and the 'stdOutFileName' isn't, then a unique output file name is chosen.

stdErrFileName

an option filename to save the output file to. If 'canCache' is set and the 'stdErrFileName' isn't, then a unique output file name is chosen.

canCache

toggle ability to cache as detailed above

useCachedValueWhenAvailable

use the cached value when available

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OutputSettings
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OutputSettings(streaming: Option[StreamingSettings] = Option(StreamingSettings()), stdOutFileName: Option[String] = None, stdErrFileName: Option[String] = None, canCache: Boolean = false, useCachedValueWhenAvailable: Boolean = true)

    Permalink

    streaming

    settings for streaming back the output of the job

    stdOutFileName

    an option filename to save the output file to. If 'canCache' is set and the 'stdOutFileName' isn't, then a unique output file name is chosen.

    stdErrFileName

    an option filename to save the output file to. If 'canCache' is set and the 'stdErrFileName' isn't, then a unique output file name is chosen.

    canCache

    toggle ability to cache as detailed above

    useCachedValueWhenAvailable

    use the cached value when available

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val canCache: Boolean

    Permalink

    toggle ability to cache as detailed above

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  13. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. val stdErrFileName: Option[String]

    Permalink

    an option filename to save the output file to.

    an option filename to save the output file to. If 'canCache' is set and the 'stdErrFileName' isn't, then a unique output file name is chosen.

  15. val stdOutFileName: Option[String]

    Permalink

    an option filename to save the output file to.

    an option filename to save the output file to. If 'canCache' is set and the 'stdOutFileName' isn't, then a unique output file name is chosen.

  16. val streaming: Option[StreamingSettings]

    Permalink

    settings for streaming back the output of the job

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. val useCachedValueWhenAvailable: Boolean

    Permalink

    use the cached value when available

  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def withSettings(settings: StreamingSettings): OutputSettings

    Permalink

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped