Package com.netflix.genie.common.dto
Class JobRequest.Builder
- java.lang.Object
-
- com.netflix.genie.common.dto.BaseDTO.Builder<T>
-
- com.netflix.genie.common.dto.CommonDTO.Builder<T>
-
- com.netflix.genie.common.dto.ExecutionEnvironmentDTO.Builder<JobRequest.Builder>
-
- com.netflix.genie.common.dto.JobRequest.Builder
-
- Enclosing class:
- JobRequest
public static class JobRequest.Builder extends ExecutionEnvironmentDTO.Builder<JobRequest.Builder>
A builder to create job requests.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String name, java.lang.String user, java.lang.String version, java.lang.String commandArgs, java.util.List<ClusterCriteria> clusterCriterias, java.util.Set<java.lang.String> commandCriteria)Deprecated.Builder(java.lang.String name, java.lang.String user, java.lang.String version, java.util.List<ClusterCriteria> clusterCriterias, java.util.Set<java.lang.String> commandCriteria)Constructor which has required fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JobRequestbuild()Build the job request.JobRequest.BuilderwithApplications(java.util.List<java.lang.String> applications)Set the ids of applications to override the default applications from the command with.JobRequest.BuilderwithCommandArgs(java.lang.String commandArgs)Deprecated.JobRequest.BuilderwithCommandArgs(java.util.List<java.lang.String> commandArgs)The command arguments to use in conjunction with the command executable selected for this job.JobRequest.BuilderwithCpu(java.lang.Integer cpu)Set the number of cpu's being requested to run the job.JobRequest.BuilderwithDisableLogArchival(boolean disableLogArchival)Set whether to disable log archive for the job.JobRequest.BuilderwithEmail(java.lang.String email)Set the email to use for alerting of job completion.JobRequest.BuilderwithGroup(java.lang.String group)Set the group for the job.JobRequest.BuilderwithGrouping(java.lang.String grouping)Set the grouping to use for this job.JobRequest.BuilderwithGroupingInstance(java.lang.String groupingInstance)Set the grouping instance to use for this job.JobRequest.BuilderwithMemory(java.lang.Integer memory)Set the amount of memory being requested to run the job..JobRequest.BuilderwithTimeout(java.lang.Integer timeout)Set the length of the job timeout in seconds after which Genie will kill the client process.-
Methods inherited from class com.netflix.genie.common.dto.ExecutionEnvironmentDTO.Builder
withConfigs, withDependencies, withSetupFile
-
Methods inherited from class com.netflix.genie.common.dto.CommonDTO.Builder
withDescription, withMetadata, withMetadata, withTags
-
Methods inherited from class com.netflix.genie.common.dto.BaseDTO.Builder
withCreated, withId, withUpdated
-
-
-
-
Constructor Detail
-
Builder
public Builder(java.lang.String name, java.lang.String user, java.lang.String version, java.util.List<ClusterCriteria> clusterCriterias, java.util.Set<java.lang.String> commandCriteria)Constructor which has required fields.- Parameters:
name- The name to use for the Jobuser- The user to use for the Jobversion- The version to use for the JobclusterCriterias- The list of cluster criteria for the JobcommandCriteria- The list of command criteria for the Job- Since:
- 3.3.0
-
Builder
@Deprecated public Builder(java.lang.String name, java.lang.String user, java.lang.String version, @Nullable java.lang.String commandArgs, java.util.List<ClusterCriteria> clusterCriterias, java.util.Set<java.lang.String> commandCriteria)Deprecated.Constructor which has required fields.DEPRECATED: Will be removed in 4.0.0 as command args are optional and should be a List now
- Parameters:
name- The name to use for the Jobuser- The user to use for the Jobversion- The version to use for the JobcommandArgs- The command line arguments for the JobclusterCriterias- The list of cluster criteria for the JobcommandCriteria- The list of command criteria for the Job
-
-
Method Detail
-
withCommandArgs
@Deprecated public JobRequest.Builder withCommandArgs(@Nullable java.lang.String commandArgs)
Deprecated.The command arguments to use in conjunction witOh the command executable selected for this job.DEPRECATED: This API will be removed in 4.0.0 in favor of the List based method for improved control over escaping of arguments.
- Parameters:
commandArgs- The command args. Max length is 10,000 characters- Returns:
- The builder
- Since:
- 3.3.0
-
withCommandArgs
public JobRequest.Builder withCommandArgs(@Nullable java.util.List<java.lang.String> commandArgs)
The command arguments to use in conjunction with the command executable selected for this job.- Parameters:
commandArgs- The command args. The maximum combined length of the command args plus one space between each argument must be less than or equal to 10,000 characters- Returns:
- The builder
- Since:
- 3.3.0
-
withGroup
public JobRequest.Builder withGroup(@Nullable java.lang.String group)
Set the group for the job.- Parameters:
group- The group- Returns:
- The builder
-
withDisableLogArchival
public JobRequest.Builder withDisableLogArchival(boolean disableLogArchival)
Set whether to disable log archive for the job.- Parameters:
disableLogArchival- true if you want to disable log archival- Returns:
- The builder
-
withEmail
public JobRequest.Builder withEmail(@Nullable java.lang.String email)
Set the email to use for alerting of job completion. If no alert desired leave blank.- Parameters:
email- the email address to use- Returns:
- The builder
-
withCpu
public JobRequest.Builder withCpu(@Nullable java.lang.Integer cpu)
Set the number of cpu's being requested to run the job. Defaults to 1 if not set.- Parameters:
cpu- The number of cpu's. Must be greater than 0.- Returns:
- The builder
-
withMemory
public JobRequest.Builder withMemory(@Nullable java.lang.Integer memory)
Set the amount of memory being requested to run the job..- Parameters:
memory- The amount of memory in terms of MB's. Must be greater than 0.- Returns:
- The builder
-
withApplications
public JobRequest.Builder withApplications(@Nullable java.util.List<java.lang.String> applications)
Set the ids of applications to override the default applications from the command with.- Parameters:
applications- The ids of applications to override- Returns:
- The builder
-
withTimeout
public JobRequest.Builder withTimeout(@Nullable java.lang.Integer timeout)
Set the length of the job timeout in seconds after which Genie will kill the client process.- Parameters:
timeout- The timeout to use- Returns:
- The builder
-
withGrouping
public JobRequest.Builder withGrouping(@Nullable java.lang.String grouping)
Set the grouping to use for this job.- Parameters:
grouping- The grouping- Returns:
- The builder
- Since:
- 3.3.0
-
withGroupingInstance
public JobRequest.Builder withGroupingInstance(@Nullable java.lang.String groupingInstance)
Set the grouping instance to use for this job.- Parameters:
groupingInstance- The grouping instance- Returns:
- The builder
- Since:
- 3.3.0
-
build
public JobRequest build()
Build the job request.- Returns:
- Create the final read-only JobRequest instance
-
-