Class Command.Builder

Enclosing class:
Command

public static class Command.Builder extends ExecutionEnvironmentDTO.Builder<Command.Builder>
A builder to create commands.
Since:
3.0.0
  • Constructor Details

    • Builder

      @Deprecated public Builder(String name, String user, String version, CommandStatus status, String executable, long ignoredCheckDelay)
      Constructor which has required fields.
      Parameters:
      name - The name to use for the Command
      user - The user to use for the Command
      version - The version to use for the Command
      status - The status of the Command
      executable - The executable for the command
      ignoredCheckDelay - Ignored. Here for backwards compatibility.
    • Builder

      @Deprecated public Builder(String name, String user, String version, CommandStatus status, List<String> executableAndArguments, long ignoredCheckDelay)
      Constructor with required fields.
      Parameters:
      name - The name to use for the Command
      user - The user to use for the Command
      version - The version to use for the Command
      status - The status of the Command
      executableAndArguments - The executable for the command and its fixed arguments
      ignoredCheckDelay - Ignored. Here for backwards compatibility.
    • Builder

      public Builder(String name, String user, String version, CommandStatus status, List<String> executableAndArguments)
      Constructor with required fields.
      Parameters:
      name - The name to use for the Command
      user - The user to use for the Command
      version - The version to use for the Command
      status - The status of the Command
      executableAndArguments - The executable for the command and its fixed arguments
  • Method Details

    • withMemory

      @Deprecated public Command.Builder withMemory(@Nullable Integer memory)
      Deprecated.
      Set the amount of memory (in MB) to default jobs run with this command to use.
      Parameters:
      memory - The default amount of memory (in MB) for jobs to use
      Returns:
      The builder
    • withExecutable

      @Deprecated public Command.Builder withExecutable(String executable)
      Deprecated.
      this setter is provided transitionally to make both 'executable' and 'executableAndArguments' optional for API backward compatibility. The proper way to construct a Command is via the constructor Builder(String, String, String, CommandStatus, List, long).
      Set the executable and its fixed arguments for this command. Note that this string is tokenized with a naive strategy (split on space) to break apart the executable from its fixed arguments. Escape characters and quotes are ignored in this process. To avoid this tokenization, use withExecutableAndArguments(List)
      Parameters:
      executable - the executable, possibly followed by arguments
      Returns:
      The builder
    • withExecutableAndArguments

      @Deprecated public Command.Builder withExecutableAndArguments(@Nullable List<String> executableAndArguments)
      Deprecated.
      this setter is provided transitionally to make both 'executable' and 'executableAndArguments' optional for API backward compatibility. The proper way to construct a Command is via the constructor Builder(String, String, String, CommandStatus, List, long).
      Set the executable and its fixed arguments for this command.
      Parameters:
      executableAndArguments - the executable and its argument
      Returns:
      The builder
    • withCheckDelay

      @Deprecated public Command.Builder withCheckDelay(@Nullable Long ignoredCheckDelay)
      Deprecated.
      The check delay for pre-4.x.x Genie backends. This no longer has any impact on the system and is here to maintain backwards compatibility. Will always be set to -1.
      Parameters:
      ignoredCheckDelay - The check delay but this value is ignored
      Returns:
      The current Command.Builder instance
    • withClusterCriteria

      public Command.Builder withClusterCriteria(@Nullable List<Criterion> clusterCriteria)
      Set the ordered list of Criterion that should be used to resolve which clusters this command can run on at any given time.
      Parameters:
      clusterCriteria - The Criterion in priority order
      Returns:
      The builder
    • withRuntime

      public Command.Builder withRuntime(@Nullable Runtime runtime)
      Set the runtime for any jobs that use this command.
      Parameters:
      runtime - The Runtime or null
      Returns:
      The builder instance
    • build

      public Command build()
      Build the command.
      Returns:
      Create the final read-only Command instance