Class CommandEntity
java.lang.Object
com.netflix.genie.web.data.services.impl.jpa.entities.IdEntity
com.netflix.genie.web.data.services.impl.jpa.entities.AuditEntity
com.netflix.genie.web.data.services.impl.jpa.entities.UniqueIdEntity
com.netflix.genie.web.data.services.impl.jpa.entities.BaseEntity
com.netflix.genie.web.data.services.impl.jpa.entities.CommandEntity
- All Implemented Interfaces:
AuditProjection,BaseProjection,IdProjection,SetupFileProjection,UniqueIdProjection,Serializable
Representation of the state of the Command Object.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of theEntityGraphwhich will eagerly load the command base fields and its associated applications dto fields.static final StringThe name of theEntityGraphwhich will eagerly load the command base fields and its associated applications base fields.static final StringThe name of theEntityGraphwhich will eagerly load the command base fields and its associated cluster criteria.static final StringThe name of theEntityGraphwhich will eagerly load everything needed to construct a Command DTO. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddApplication(@NotNull ApplicationEntity application) Append an application to the list of applications this command uses.voidaddClusterCriterion(CriterionEntity criterion) Add a new cluster criterion as the lowest priority criterion to evaluate for this command.voidaddClusterCriterion(CriterionEntity criterion, int priority) Add a new cluster criterion with the given priority.booleangetCpu()Get the default number of CPUs for a job using this command.Get the default amount of disk space for the job using this command in MB.getGpu()Get the default number of GPUs for a job using this command.Optional<com.fasterxml.jackson.databind.JsonNode>Get the default set of images to run this job with if this command is selected.Optional<com.fasterxml.jackson.databind.JsonNode>Get any metadata associated with this command pertaining to specifying details for various agent launchers.Get the default memory for a job using this command.Get the default amount of network bandwidth to allocate to the job using this command in mbps.inthashCode()voidremoveApplication(@NotNull ApplicationEntity application) Remove an application from this command.removeClusterCriterion(int priority) Remove the criterion with the given priority from the list of available criterion for this command.voidsetApplications(List<ApplicationEntity> applications) Sets the applications for this command.voidsetClusterCriteria(List<CriterionEntity> clusterCriteria) Set the criteria, in priority order, that this command has for determining which available clusters to use for a job.voidsetConfigs(Set<FileEntity> configs) Set all the files associated as configuration files for this cluster.voidsetDependencies(Set<FileEntity> dependencies) Set all the files associated as dependency files for this cluster.voidsetExecutable(@NotEmpty List<@NotBlank @Size(max=1024) String> executable) Set the executable and any default arguments for this command.voidsetLauncherExt(com.fasterxml.jackson.databind.JsonNode launcherExt) Set any metadata pertaining to additional instructions for various launchers if this command is used.voidSet all the tags associated to this cluster.Methods inherited from class com.netflix.genie.web.data.services.impl.jpa.entities.BaseEntity
getDescription, getMetadata, getSetupFile, setDescription, setMetadata, setSetupFileMethods inherited from class com.netflix.genie.web.data.services.impl.jpa.entities.AuditEntity
getCreated, getUpdated, onCreateBaseEntity, onUpdateBaseEntityMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.AuditProjection
getCreated, getUpdatedMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.BaseProjection
getName, getStatus, getUser, getVersionMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.IdProjection
getIdMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.UniqueIdProjection
getUniqueId
-
Field Details
-
APPLICATIONS_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated applications base fields.- See Also:
-
APPLICATIONS_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated applications dto fields.- See Also:
-
CLUSTER_CRITERIA_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated cluster criteria.- See Also:
-
DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load everything needed to construct a Command DTO.- See Also:
-
-
Constructor Details
-
CommandEntity
public CommandEntity()Default Constructor.
-
-
Method Details
-
setExecutable
Set the executable and any default arguments for this command.- Parameters:
executable- The executable and default arguments which can't be blank and there must be at least one
-
setConfigs
Set all the files associated as configuration files for this cluster.- Parameters:
configs- The configuration files to set
-
setDependencies
Set all the files associated as dependency files for this cluster.- Parameters:
dependencies- The dependency files to set
-
setTags
Set all the tags associated to this cluster.- Parameters:
tags- The dependency tags to set
-
getCpu
Get the default number of CPUs for a job using this command.- Returns:
- The number of CPUs or
Optional.empty()
-
getGpu
Get the default number of GPUs for a job using this command.- Returns:
- The number of GPUs or
Optional.empty()
-
getMemory
Get the default memory for a job using this command.- Returns:
- Optional of Integer as it could be null
-
getDiskMb
Get the default amount of disk space for the job using this command in MB.- Returns:
- The amount of disk space in MB or
Optional.empty()
-
getNetworkMbps
Get the default amount of network bandwidth to allocate to the job using this command in mbps.- Returns:
- The amount of network bandwidth in mbps or
Optional.empty()
-
getImages
Get the default set of images to run this job with if this command is selected.- Returns:
- The default set of images or
Optional.empty()
-
getLauncherExt
Get any metadata associated with this command pertaining to specifying details for various agent launchers.- Returns:
- The metadata or
Optional.empty()if there isn't any
-
setLauncherExt
public void setLauncherExt(@Nullable com.fasterxml.jackson.databind.JsonNode launcherExt) Set any metadata pertaining to additional instructions for various launchers if this command is used.- Parameters:
launcherExt- The metadata
-
setApplications
public void setApplications(@Nullable List<ApplicationEntity> applications) throws PreconditionFailedException Sets the applications for this command.- Parameters:
applications- The application that this command uses- Throws:
PreconditionFailedException- if the list of applications contains duplicates
-
addApplication
public void addApplication(@NotNull @NotNull ApplicationEntity application) throws PreconditionFailedException Append an application to the list of applications this command uses.- Parameters:
application- The application to add. Not null.- Throws:
PreconditionFailedException- If the application is a duplicate of an existing application
-
removeApplication
Remove an application from this command. Manages both sides of relationship.- Parameters:
application- The application to remove. Not null.
-
setClusterCriteria
Set the criteria, in priority order, that this command has for determining which available clusters to use for a job.- Parameters:
clusterCriteria- The cluster criteria
-
addClusterCriterion
Add a new cluster criterion as the lowest priority criterion to evaluate for this command.- Parameters:
criterion- TheCriterionEntityto add
-
addClusterCriterion
Add a new cluster criterion with the given priority.- Parameters:
criterion- The new criterion to addpriority- The priority with which this criterion should be considered. 0 would be the highest priority and anything greater than the current size of the existing criteria will just be added to the end of the list. If a priority of< 0is passed in the criterion is added as the highest priority (0).
-
removeClusterCriterion
Remove the criterion with the given priority from the list of available criterion for this command.- Parameters:
priority- The priority of the criterion to remove.- Returns:
- The
CriterionEntitywhich was removed by this operation - Throws:
IllegalArgumentException- If this value is< 0or> {@link List#size()}as it becomes unclear what the user wants to do
-
equals
- Overrides:
equalsin classBaseEntity
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEntity
-