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,java.io.Serializable
@Entity public class CommandEntity extends BaseEntity
Representation of the state of the Command Object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPPLICATIONS_DTO_ENTITY_GRAPHThe name of theEntityGraphwhich will eagerly load the command base fields and its associated applications dto fields.static java.lang.StringAPPLICATIONS_ENTITY_GRAPHThe name of theEntityGraphwhich will eagerly load the command base fields and its associated applications base fields.static java.lang.StringCLUSTER_CRITERIA_ENTITY_GRAPHThe name of theEntityGraphwhich will eagerly load the command base fields and its associated cluster criteria.static java.lang.StringDTO_ENTITY_GRAPHThe name of theEntityGraphwhich will eagerly load everything needed to construct a Command DTO.
-
Constructor Summary
Constructors Constructor Description CommandEntity()Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddApplication(@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.booleanequals(java.lang.Object o)java.util.Optional<com.fasterxml.jackson.databind.JsonNode>getLauncherExt()Get any metadata associated with this command pertaining to specifying details for various agent launchers.java.util.Optional<java.lang.Integer>getMemory()Get the default memory for a job using this command.inthashCode()voidremoveApplication(@NotNull ApplicationEntity application)Remove an application from this command.CriterionEntityremoveClusterCriterion(int priority)Remove the criterion with the given priority from the list of available criterion for this command.voidsetApplications(java.util.List<ApplicationEntity> applications)Sets the applications for this command.voidsetClusterCriteria(java.util.List<CriterionEntity> clusterCriteria)Set the criteria, in priority order, that this command has for determining which available clusters to use for a job.voidsetConfigs(java.util.Set<FileEntity> configs)Set all the files associated as configuration files for this cluster.voidsetDependencies(java.util.Set<FileEntity> dependencies)Set all the files associated as dependency files for this cluster.voidsetExecutable(@NotEmpty java.util.List<@NotBlank @Size(max=1024) java.lang.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.voidsetTags(java.util.Set<TagEntity> tags)Set 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, setSetupFile
-
Methods inherited from class com.netflix.genie.web.data.services.impl.jpa.entities.AuditEntity
getCreated, getUpdated, onCreateBaseEntity, onUpdateBaseEntity
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.AuditProjection
getCreated, getUpdated
-
Methods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.BaseProjection
getName, getStatus, getUser, getVersion
-
Methods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.IdProjection
getId
-
Methods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.UniqueIdProjection
getUniqueId
-
-
-
-
Field Detail
-
APPLICATIONS_ENTITY_GRAPH
public static final java.lang.String APPLICATIONS_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated applications base fields.- See Also:
- Constant Field Values
-
APPLICATIONS_DTO_ENTITY_GRAPH
public static final java.lang.String APPLICATIONS_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated applications dto fields.- See Also:
- Constant Field Values
-
CLUSTER_CRITERIA_ENTITY_GRAPH
public static final java.lang.String CLUSTER_CRITERIA_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load the command base fields and its associated cluster criteria.- See Also:
- Constant Field Values
-
DTO_ENTITY_GRAPH
public static final java.lang.String DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will eagerly load everything needed to construct a Command DTO.- See Also:
- Constant Field Values
-
-
Method Detail
-
setExecutable
public void setExecutable(@NotEmpty @NotEmpty java.util.List<@NotBlank @Size(max=1024) java.lang.String> executable)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
public void setConfigs(@Nullable java.util.Set<FileEntity> configs)Set all the files associated as configuration files for this cluster.- Parameters:
configs- The configuration files to set
-
setDependencies
public void setDependencies(@Nullable java.util.Set<FileEntity> dependencies)Set all the files associated as dependency files for this cluster.- Parameters:
dependencies- The dependency files to set
-
setTags
public void setTags(@Nullable java.util.Set<TagEntity> tags)Set all the tags associated to this cluster.- Parameters:
tags- The dependency tags to set
-
getMemory
public java.util.Optional<java.lang.Integer> getMemory()
Get the default memory for a job using this command.- Returns:
- Optional of Integer as it could be null
-
getLauncherExt
public java.util.Optional<com.fasterxml.jackson.databind.JsonNode> 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 java.util.List<ApplicationEntity> applications) throws PreconditionFailedExceptionSets 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 PreconditionFailedExceptionAppend 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
public void removeApplication(@NotNull @NotNull ApplicationEntity application)Remove an application from this command. Manages both sides of relationship.- Parameters:
application- The application to remove. Not null.
-
setClusterCriteria
public void setClusterCriteria(@Nullable java.util.List<CriterionEntity> clusterCriteria)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
public void addClusterCriterion(CriterionEntity criterion)
Add a new cluster criterion as the lowest priority criterion to evaluate for this command.- Parameters:
criterion- TheCriterionEntityto add
-
addClusterCriterion
public void addClusterCriterion(CriterionEntity criterion, int priority)
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
public CriterionEntity removeClusterCriterion(int priority) throws java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException- If this value is< 0or> {@link List#size()}as it becomes unclear what the user wants to do
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classBaseEntity
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseEntity
-
-