Package com.netflix.genie.common.dto
Class Command.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<Command.Builder>
com.netflix.genie.common.dto.Command.Builder
- Enclosing class:
- Command
A builder to create commands.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorDescriptionBuilder
(String name, String user, String version, CommandStatus status, String executable, long ignoredCheckDelay) Deprecated.Builder
(String name, String user, String version, CommandStatus status, List<String> executableAndArguments) Constructor with required fields.Builder
(String name, String user, String version, CommandStatus status, List<String> executableAndArguments, long ignoredCheckDelay) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the command.withCheckDelay
(Long ignoredCheckDelay) Deprecated.withClusterCriteria
(List<Criterion> clusterCriteria) Set the ordered list ofCriterion
that should be used to resolve which clusters this command can run on at any given time.withExecutable
(String executable) Deprecated.this setter is provided transitionally to make both 'executable' and 'executableAndArguments' optional for API backward compatibility.withExecutableAndArguments
(List<String> executableAndArguments) Deprecated.this setter is provided transitionally to make both 'executable' and 'executableAndArguments' optional for API backward compatibility.withMemory
(Integer memory) Deprecated.UsewithRuntime(Runtime)
insteadwithRuntime
(Runtime runtime) Set the runtime for any jobs that use this command.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 Details
-
Builder
@Deprecated public Builder(String name, String user, String version, CommandStatus status, String executable, long ignoredCheckDelay) Deprecated.Constructor which has required fields.- Parameters:
name
- The name to use for the Commanduser
- The user to use for the Commandversion
- The version to use for the Commandstatus
- The status of the Commandexecutable
- The executable for the commandignoredCheckDelay
- Ignored. Here for backwards compatibility.
-
Builder
@Deprecated public Builder(String name, String user, String version, CommandStatus status, List<String> executableAndArguments, long ignoredCheckDelay) Deprecated.Constructor with required fields.- Parameters:
name
- The name to use for the Commanduser
- The user to use for the Commandversion
- The version to use for the Commandstatus
- The status of the CommandexecutableAndArguments
- The executable for the command and its fixed argumentsignoredCheckDelay
- 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 Commanduser
- The user to use for the Commandversion
- The version to use for the Commandstatus
- The status of the CommandexecutableAndArguments
- The executable for the command and its fixed arguments
-
-
Method Details
-
withMemory
Deprecated.UsewithRuntime(Runtime)
insteadSet 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.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 constructorBuilder(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, usewithExecutableAndArguments(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 constructorBuilder(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.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
Set the ordered list ofCriterion
that should be used to resolve which clusters this command can run on at any given time.- Parameters:
clusterCriteria
- TheCriterion
in priority order- Returns:
- The builder
-
withRuntime
Set the runtime for any jobs that use this command.- Parameters:
runtime
- TheRuntime
or null- Returns:
- The builder instance
-
build
Build the command.- Returns:
- Create the final read-only Command instance
-
Builder(String, String, String, CommandStatus, List)