Class 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 Details

    • Builder

      public Builder(String name, String user, String version, List<ClusterCriteria> clusterCriterias, Set<String> commandCriteria)
      Constructor which has required fields.
      Parameters:
      name - The name to use for the Job
      user - The user to use for the Job
      version - The version to use for the Job
      clusterCriterias - The list of cluster criteria for the Job
      commandCriteria - The list of command criteria for the Job
      Since:
      3.3.0
    • Builder

      @Deprecated public Builder(String name, String user, String version, @Nullable String commandArgs, List<ClusterCriteria> clusterCriterias, Set<String> commandCriteria)
      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 Job
      user - The user to use for the Job
      version - The version to use for the Job
      commandArgs - The command line arguments for the Job
      clusterCriterias - The list of cluster criteria for the Job
      commandCriteria - The list of command criteria for the Job
  • Method Details

    • withCommandArgs

      @Deprecated public JobRequest.Builder withCommandArgs(@Nullable 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 List<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 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 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

      @Deprecated public JobRequest.Builder withCpu(@Nullable Integer cpu)
      Deprecated.
      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

      @Deprecated public JobRequest.Builder withMemory(@Nullable Integer memory)
      Deprecated.
      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 List<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 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 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 String groupingInstance)
      Set the grouping instance to use for this job.
      Parameters:
      groupingInstance - The grouping instance
      Returns:
      The builder
      Since:
      3.3.0
    • withRuntime

      public JobRequest.Builder withRuntime(@Nullable Runtime runtime)
      Set the requested job runtime environment details.
      Parameters:
      runtime - The Runtime information or null
      Returns:
      The JobRequest.Builder instance
    • build

      public JobRequest build()
      Build the job request.
      Returns:
      Create the final read-only JobRequest instance