Class JobEnvironment.Builder
- java.lang.Object
-
- com.netflix.genie.common.external.dtos.v4.JobEnvironment.Builder
-
- Enclosing class:
- JobEnvironment
public static class JobEnvironment.Builder extends java.lang.ObjectBuilder to create an immutableJobEnvironmentinstance.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description Builder(int memory)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobEnvironmentbuild()Build a new immutable instance of anJobEnvironment.JobEnvironment.BuilderwithCpu(java.lang.Integer cpu)Set the number of CPU cores that should be allocated to run the associated job.JobEnvironment.BuilderwithEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environmentVariables)Set any environment variables that the agent should add to the job runtime.JobEnvironment.BuilderwithExt(com.fasterxml.jackson.databind.JsonNode ext)Set the extension configuration for the agent.JobEnvironment.BuilderwithMemory(int memory)Set the amount of memory (in MB) that should be allocated for the job processes.
-
-
-
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 anJobEnvironment.- Returns:
- An instance containing the fields set in this builder
-
-