Class JobEnvironment.Builder

  • Enclosing class:
    JobEnvironment

    public static class JobEnvironment.Builder
    extends java.lang.Object
    Builder to create an immutable JobEnvironment instance.
    Since:
    4.0.0
    • Constructor Detail

      • Builder

        public Builder​(int memory)
        Constructor.
        Parameters:
        memory - The amount of memory (in MB) to allocate for the job
    • Method Detail

      • withCpu

        public JobEnvironment.Builder withCpu​(@Nullable
                                              java.lang.Integer cpu)
        Set the number of CPU cores that should be allocated to run the associated job.
        Parameters:
        cpu - The number of CPU's. Must be greater than or equal to 1.
        Returns:
        The builder
      • withMemory

        public JobEnvironment.Builder withMemory​(int memory)
        Set the amount of memory (in MB) that should be allocated for the job processes.
        Parameters:
        memory - The memory. Must be greater than or equal to 1 but preferably much more
        Returns:
        The builder
      • withEnvironmentVariables

        public JobEnvironment.Builder withEnvironmentVariables​(@Nullable
                                                               java.util.Map<java.lang.String,​java.lang.String> environmentVariables)
        Set any environment variables that the agent should add to the job runtime.
        Parameters:
        environmentVariables - Additional environment variables
        Returns:
        The builder
      • withExt

        public JobEnvironment.Builder withExt​(@Nullable
                                              com.fasterxml.jackson.databind.JsonNode ext)
        Set the extension configuration for the agent. This is generally used for specific implementations of the job launcher e.g. on Titus or local docker etc.
        Parameters:
        ext - The extension configuration which is effectively a DSL per job launch implementation
        Returns:
        The builder
      • build

        public JobEnvironment build()
        Build a new immutable instance of an JobEnvironment.
        Returns:
        An instance containing the fields set in this builder