Class JobExecution.Builder

java.lang.Object
com.netflix.genie.common.dto.BaseDTO.Builder<JobExecution.Builder>
com.netflix.genie.common.dto.JobExecution.Builder
Enclosing class:
JobExecution

public static class JobExecution.Builder extends BaseDTO.Builder<JobExecution.Builder>
A builder to create job requests.
Since:
3.0.0
  • Constructor Details

    • Builder

      public Builder(String hostName)
      Constructor which has required fields.
      Parameters:
      hostName - The hostname where the job is running
  • Method Details

    • withProcessId

      public JobExecution.Builder withProcessId(@Nullable Integer processId)
      Set the process id for the jobs' execution.
      Parameters:
      processId - The process id
      Returns:
      The builder
    • withCheckDelay

      public JobExecution.Builder withCheckDelay(@Nullable Long checkDelay)
      Set the amount of time (in milliseconds) to delay between checks of the process.
      Parameters:
      checkDelay - The check delay to use
      Returns:
      The builder
    • withTimeout

      public JobExecution.Builder withTimeout(@Nullable Instant timeout)
      Set the timeout date when the job will be failed if it hasn't completed by.
      Parameters:
      timeout - The timeout date
      Returns:
      The builder
    • withExitCode

      public JobExecution.Builder withExitCode(@Nullable Integer exitCode)
      Set the exit code for the jobs' execution. If not set will default to -1.
      Parameters:
      exitCode - The exit code.
      Returns:
      The builder
    • withMemory

      @Deprecated public JobExecution.Builder withMemory(@Nullable Integer memory)
      Deprecated.
      Set the amount of memory (in MB) to use for this job execution.
      Parameters:
      memory - The amount of memory in megabytes
      Returns:
      The builder
    • withArchiveStatus

      public JobExecution.Builder withArchiveStatus(@Nullable ArchiveStatus archiveStatus)
      Set the archive status for this job.
      Parameters:
      archiveStatus - The archive status
      Returns:
      The builder
    • withLauncherExt

      public JobExecution.Builder withLauncherExt(@Nullable com.fasterxml.jackson.databind.JsonNode launcherExt)
      Set the launcher extension for this job.
      Parameters:
      launcherExt - The launcher extension
      Returns:
      The builder
    • withRuntime

      public JobExecution.Builder withRuntime(@Nullable Runtime runtime)
      Set the runtime this job is executing with.
      Parameters:
      runtime - The runtime
      Returns:
      This JobExecution.Builder instance
    • build

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