Class JobEntity
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.JobEntity
- All Implemented Interfaces:
AgentHostnameProjection,AuditProjection,BaseProjection,IdProjection,JobApiProjection,JobApplicationsProjection,JobArchiveLocationProjection,JobClusterProjection,JobCommandProjection,JobCommonFieldsProjection,JobExecutionProjection,JobMetadataProjection,JobProjection,JobSearchProjection,SetupFileProjection,StatusProjection,UniqueIdProjection,FinishedJobProjection,JobRequestProjection,JobSpecificationProjection,Serializable
@Entity
public class JobEntity
extends BaseEntity
implements FinishedJobProjection, JobProjection, JobMetadataProjection, JobExecutionProjection, JobApplicationsProjection, JobClusterProjection, JobCommandProjection, JobSearchProjection, JobRequestProjection, JobSpecificationProjection, JobArchiveLocationProjection, JobApiProjection, StatusProjection
A row in the jobs table.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of theEntityGraphwhich will load all the data needed to get the applications for a job.static final StringThe name of theEntityGraphwhich will load all the data needed to get the cluster for a job.static final StringThe name of theEntityGraphwhich will load all the data needed to get the command for a job.static final StringThe name of theEntityGraphwhich will load all the data needed for a V3 Job DTO.static final StringThe name of theEntityGraphwhich will load all the data needed for a V4 Job Request DTO.static final StringThe name of theEntityGraphwhich will load all the data needed for a V4 Job Specification DTO. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the host name where the agent ran or is running the job.Get the pid of the agent that claimed this job.Get the version of the agent that claimed this job.Get the location where the job was archived.Get the archive status for the job if there is one.Get the cluster that ran or is currently running a given job.Get the name of the cluster that is running or did run this job.Get the command that ran or is currently running a given job.Get the name of the command that is executing this job.Get the number of CPU's used by the job.Get the amount of disk space used for a job.getEmail()Get the email of the user associated with this job if they desire an email notification at completion of the job.Get the exit code from the process that ran the job.Get when the job was finished.Get the user group for this job.Get the number of GPUs used by the job.Get the grouping this job is a part of.Get the instance identifier of a grouping.Optional<com.fasterxml.jackson.databind.JsonNode>Get the set of image configuration used for this job.Get the job directory location the agent should use.Optional<com.fasterxml.jackson.databind.JsonNode>Get any metadata associated with this job pertaining to the launcher that launched it.Get the amount of memory (in MB) that this job is/was run with.Get network bandwidth used for a job if any.Get the previously notified job status if there was one.Get the number of attachments.Get the process id of the job.Get the hostname of the agent that requested this job be run if there was one.Get the PID of the agent that requested this job be run if there was one.Get the version of the agent that requested this job be run if there was one.Get the request api client hostname.Get the user agent.Optional<com.fasterxml.jackson.databind.JsonNode>Get the extension configuration of a job agent configuration.Optional<com.fasterxml.jackson.databind.JsonNode>Get the extension configuration of a job agent environment.Get the number of CPU's requested to run this job.Get the requested disk space for the job if any.Get the number of GPUs requested by the job.Optional<com.fasterxml.jackson.databind.JsonNode>Get the requested container image configurations if there were any.Get the requested directory on disk where the Genie job working directory should be placed if a user asked to override the default.Optional<com.fasterxml.jackson.databind.JsonNode>Get any metadata the user provided with respect to the launcher.Get the memory requested to run this job with.Get the requested network mbps for the job if any.Get the timeout (in seconds) requested by the user for this job.Get when the job was started.Get the current status message of the job.Get the size of standard error for this job.Get the size of standard out for this job.Get the final resolved timeout duration (in seconds) if there was one for this job.Get the total size of the attachments.inthashCode()voidsetApplications(List<ApplicationEntity> applications) Set the applications used to run this job.voidsetArchiveStatus(String archiveStatus) Set the archive status for this job.voidsetCluster(ClusterEntity cluster) Set the cluster this job ran on.voidsetClusterCriteria(List<CriterionEntity> clusterCriteria) Set the cluster criteria set for this job.voidsetCommand(CommandEntity command) Set the command used to run this job.voidsetCommandArgs(List<String> commandArgs) Set the command arguments to use with this job.voidsetCommandCriterion(CriterionEntity commandCriterion) Set the command criterion.voidsetConfigs(Set<FileEntity> configs) Set all the files associated as configuration files for this job.voidsetDependencies(Set<FileEntity> dependencies) Set all the files associated as dependency files for this job.voidsetEnvironmentVariables(Map<String, String> environmentVariables) Set the environment variables for the job.voidsetFinished(Instant finished) Set the finishTime for the job.voidsetLauncherExt(com.fasterxml.jackson.databind.JsonNode launcherExt) Set any metadata pertaining to the launcher that launched this job.voidsetRequestedEnvironmentVariables(Map<String, String> requestedEnvironmentVariables) Set the requested environment variables.voidsetRequestedLauncherExt(com.fasterxml.jackson.databind.JsonNode requestedLauncherExt) Set any metadata pertaining to the launcher that was provided by the user.voidsetStarted(Instant started) Set the start time for the job.voidsetStdErrSize(Long stdErrSize) Set the total size in bytes of the std err file for this job.voidsetStdOutSize(Long stdOutSize) Set the total size in bytes of the std out file for this job.voidSet all the tags associated to this job.voidsetTimeoutUsed(Integer timeoutUsed) Set the final resolved timeout duration for this job.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
getDescription, getName, getStatus, getUser, getVersionMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.v4.FinishedJobProjection
getApplications, getClusterCriteria, getCommandArgs, getCommandCriterion, getMetadata, getTagsMethods 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.JobApiProjection
isApiMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobApplicationsProjection
getApplicationsMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobCommonFieldsProjection
getCommandArgs, getTagsMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobExecutionProjection
getUniqueIdMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobMetadataProjection
getUniqueIdMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobProjection
getApplicationsMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.v4.JobRequestProjection
getClusterCriteria, getCommandArgs, getCommandCriterion, getConfigs, getDependencies, getDescription, getMetadata, getName, getRequestedApplications, getRequestedEnvironmentVariables, getSetupFile, getTags, getUniqueId, getUser, getVersion, isArchivingDisabled, isInteractive, isRequestedIdMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.JobSearchProjection
getName, getUniqueId, getUserMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.v4.JobSpecificationProjection
getApplications, getCommandArgs, getConfigs, getDependencies, getEnvironmentVariables, getSetupFile, isInteractive, isResolvedMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.StatusProjection
getStatusMethods inherited from interface com.netflix.genie.web.data.services.impl.jpa.queries.projections.UniqueIdProjection
getUniqueId
-
Field Details
-
V3_JOB_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed for a V3 Job DTO.- See Also:
-
V4_JOB_REQUEST_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed for a V4 Job Request DTO.- See Also:
-
V4_JOB_SPECIFICATION_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed for a V4 Job Specification DTO.- See Also:
-
JOB_APPLICATIONS_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed to get the applications for a job.- See Also:
-
JOB_CLUSTER_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed to get the cluster for a job.- See Also:
-
JOB_COMMAND_DTO_ENTITY_GRAPH
The name of theEntityGraphwhich will load all the data needed to get the command for a job.- See Also:
-
-
Constructor Details
-
JobEntity
public JobEntity()Default Constructor.
-
-
Method Details
-
getGenieUserGroup
Get the user group for this job.- Specified by:
getGenieUserGroupin interfaceJobRequestProjection- Returns:
- the user group
-
getEmail
Get the email of the user associated with this job if they desire an email notification at completion of the job.- Specified by:
getEmailin interfaceJobRequestProjection- Returns:
- The email
-
getRequestedCpu
Get the number of CPU's requested to run this job.- Specified by:
getRequestedCpuin interfaceJobRequestProjection- Returns:
- The number of CPU's as an Optional
-
getRequestedTimeout
Get the timeout (in seconds) requested by the user for this job.- Specified by:
getRequestedTimeoutin interfaceJobRequestProjection- Returns:
- The number of seconds before a timeout as an Optional
-
getCpuUsed
Get the number of CPU's used by the job.- Specified by:
getCpuUsedin interfaceJobExecutionProjection- Returns:
- The number of CPU's used or
Optional.empty()
-
getGpuUsed
Get the number of GPUs used by the job.- Specified by:
getGpuUsedin interfaceJobExecutionProjection- Returns:
- The number of GPUs used or
Optional.empty()
-
getDiskMbUsed
Get the amount of disk space used for a job.- Specified by:
getDiskMbUsedin interfaceJobExecutionProjection- Returns:
- The amount of disk space in MB or
Optional.empty()
-
getNetworkMbpsUsed
Get network bandwidth used for a job if any.- Specified by:
getNetworkMbpsUsedin interfaceJobExecutionProjection- Returns:
- The network bandwidth in mbps or
Optional.empty()
-
setCommandCriterion
Set the command criterion.- Parameters:
commandCriterion- The criterion. Null clears reference.
-
getGrouping
Get the grouping this job is a part of. e.g. scheduler job name for job run many times- Specified by:
getGroupingin interfaceFinishedJobProjection- Specified by:
getGroupingin interfaceJobCommonFieldsProjection- Specified by:
getGroupingin interfaceJobRequestProjection- Returns:
- The grouping
-
getGroupingInstance
Get the instance identifier of a grouping. e.g. the run id of a given scheduled job- Specified by:
getGroupingInstancein interfaceFinishedJobProjection- Specified by:
getGroupingInstancein interfaceJobCommonFieldsProjection- Specified by:
getGroupingInstancein interfaceJobRequestProjection- Returns:
- The grouping instance
-
getStatusMsg
Get the current status message of the job.- Specified by:
getStatusMsgin interfaceFinishedJobProjection- Specified by:
getStatusMsgin interfaceJobProjection- Returns:
- The status message
-
getStarted
Get when the job was started.- Specified by:
getStartedin interfaceFinishedJobProjection- Specified by:
getStartedin interfaceJobExecutionProjection- Specified by:
getStartedin interfaceJobProjection- Specified by:
getStartedin interfaceJobSearchProjection- Returns:
- The start date
-
setStarted
Set the start time for the job.- Parameters:
started- The started time.
-
getFinished
Get when the job was finished.- Specified by:
getFinishedin interfaceFinishedJobProjection- Specified by:
getFinishedin interfaceJobProjection- Specified by:
getFinishedin interfaceJobSearchProjection- Returns:
- The finish date
-
getRequestedMemory
Get the memory requested to run this job with.- Specified by:
getRequestedMemoryin interfaceFinishedJobProjection- Specified by:
getRequestedMemoryin interfaceJobRequestProjection- Returns:
- The amount of memory the user requested for this job in MB as an Optional
-
getRequestApiClientHostname
Get the request api client hostname.- Specified by:
getRequestApiClientHostnamein interfaceFinishedJobProjection- Specified by:
getRequestApiClientHostnamein interfaceJobMetadataProjection- Returns:
Optionalof the client host
-
getRequestApiClientUserAgent
Get the user agent.- Specified by:
getRequestApiClientUserAgentin interfaceFinishedJobProjection- Specified by:
getRequestApiClientUserAgentin interfaceJobMetadataProjection- Returns:
Optionalof the user agent
-
getNumAttachments
Get the number of attachments.- Specified by:
getNumAttachmentsin interfaceFinishedJobProjection- Specified by:
getNumAttachmentsin interfaceJobMetadataProjection- Returns:
- The number of attachments as an
Optional
-
getRequestAgentClientHostname
Get the hostname of the agent that requested this job be run if there was one.- Specified by:
getRequestAgentClientHostnamein interfaceFinishedJobProjection- Returns:
- The hostname wrapped in an
Optional
-
getRequestAgentClientVersion
Get the version of the agent that requested this job be run if there was one.- Specified by:
getRequestAgentClientVersionin interfaceFinishedJobProjection- Returns:
- The version wrapped in an
Optional
-
getExitCode
Get the exit code from the process that ran the job.- Specified by:
getExitCodein interfaceFinishedJobProjection- Specified by:
getExitCodein interfaceJobExecutionProjection- Returns:
- The exit code or -1 if the job hasn't finished yet
-
getArchiveLocation
Get the location where the job was archived.- Specified by:
getArchiveLocationin interfaceFinishedJobProjection- Specified by:
getArchiveLocationin interfaceJobArchiveLocationProjection- Returns:
- The archive location
-
getMemoryUsed
Get the amount of memory (in MB) that this job is/was run with.- Specified by:
getMemoryUsedin interfaceFinishedJobProjection- Specified by:
getMemoryUsedin interfaceJobExecutionProjection- Returns:
- The memory as an
Optionalas it could be null
-
getCluster
Get the cluster that ran or is currently running a given job.- Specified by:
getClusterin interfaceFinishedJobProjection- Specified by:
getClusterin interfaceJobClusterProjection- Specified by:
getClusterin interfaceJobSpecificationProjection- Returns:
- The cluster entity
-
setCluster
Set the cluster this job ran on.- Parameters:
cluster- The cluster this job ran on
-
getCommand
Get the command that ran or is currently running a given job.- Specified by:
getCommandin interfaceFinishedJobProjection- Specified by:
getCommandin interfaceJobCommandProjection- Specified by:
getCommandin interfaceJobSpecificationProjection- Returns:
- The command entity
-
setCommand
Set the command used to run this job.- Parameters:
command- The command
-
setFinished
Set the finishTime for the job.- Parameters:
finished- The finished time.
-
getTotalSizeOfAttachments
Get the total size of the attachments.- Specified by:
getTotalSizeOfAttachmentsin interfaceJobMetadataProjection- Returns:
- The total size of attachments as an optional
-
getStdOutSize
Get the size of standard out for this job.- Specified by:
getStdOutSizein interfaceJobMetadataProjection- Returns:
- The size (in bytes) of this jobs standard out file as Optional
-
setStdOutSize
Set the total size in bytes of the std out file for this job.- Parameters:
stdOutSize- The size. Null empty's database field
-
getStdErrSize
Get the size of standard error for this job.- Specified by:
getStdErrSizein interfaceJobMetadataProjection- Returns:
- The size (in bytes) of this jobs standard error file as Optional
-
setStdErrSize
Set the total size in bytes of the std err file for this job.- Parameters:
stdErrSize- The size. Null empty's database field
-
getRequestAgentClientPid
Get the PID of the agent that requested this job be run if there was one.- Returns:
- The PID wrapped in an
Optional
-
getClusterName
Get the name of the cluster that is running or did run this job.- Specified by:
getClusterNamein interfaceJobProjection- Specified by:
getClusterNamein interfaceJobSearchProjection- Returns:
- The cluster name or empty Optional if it hasn't been set
-
getCommandName
Get the name of the command that is executing this job.- Specified by:
getCommandNamein interfaceJobProjection- Specified by:
getCommandNamein interfaceJobSearchProjection- Returns:
- The command name or empty Optional if one wasn't set yet
-
getAgentHostname
Get the host name where the agent ran or is running the job.- Specified by:
getAgentHostnamein interfaceAgentHostnameProjection- Returns:
- The host name where the job agent is running or was run wrapped in an
Optional
-
getAgentVersion
Get the version of the agent that claimed this job.- Returns:
- The version wrapped in an
Optionalin case it wasn't set yet in which case it will beOptional.empty()
-
getAgentPid
Get the pid of the agent that claimed this job.- Returns:
- The pid wrapped in an
Optionalin case it wasn't set yet in which case it will beOptional.empty()
-
getProcessId
Get the process id of the job.- Specified by:
getProcessIdin interfaceJobExecutionProjection- Returns:
- the process id
-
getTimeoutUsed
Get the final resolved timeout duration (in seconds) if there was one for this job.- Specified by:
getTimeoutUsedin interfaceJobExecutionProjection- Specified by:
getTimeoutUsedin interfaceJobSpecificationProjection- Returns:
- The timeout value wrapped in an
Optional
-
setTimeoutUsed
Set the final resolved timeout duration for this job.- Parameters:
timeoutUsed- The timeout value (in seconds) after which this job should be killed by the system
-
getArchiveStatus
Get the archive status for the job if there is one.- Specified by:
getArchiveStatusin interfaceJobExecutionProjection- Returns:
- The archive status or
Optional.empty()if there is none
-
setArchiveStatus
Set the archive status for this job.- Parameters:
archiveStatus- The new archive status
-
getLauncherExt
Get any metadata associated with this job pertaining to the launcher that launched it.- Specified by:
getLauncherExtin interfaceJobExecutionProjection- 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 the launcher that launched this job.- Parameters:
launcherExt- The metadata
-
setCommandArgs
Set the command arguments to use with this job.- Parameters:
commandArgs- The command arguments to use
-
setConfigs
Set all the files associated as configuration files for this job.- Parameters:
configs- The configuration files to set
-
setDependencies
Set all the files associated as dependency files for this job.- Parameters:
dependencies- The dependency files to set
-
setTags
Set all the tags associated to this job.- Parameters:
tags- The tags to set
-
setRequestedEnvironmentVariables
public void setRequestedEnvironmentVariables(@Nullable Map<String, String> requestedEnvironmentVariables) Set the requested environment variables.- Parameters:
requestedEnvironmentVariables- The environment variables the user requested be added to the job runtime
-
setEnvironmentVariables
Set the environment variables for the job.- Parameters:
environmentVariables- The final set of environment variables that were set in the job runtime
-
getRequestedJobDirectoryLocation
Get the requested directory on disk where the Genie job working directory should be placed if a user asked to override the default.- Specified by:
getRequestedJobDirectoryLocationin interfaceJobRequestProjection- Returns:
- The requested job directory location wrapped in an
Optional
-
getRequestedAgentEnvironmentExt
Get the extension configuration of a job agent environment.- Specified by:
getRequestedAgentEnvironmentExtin interfaceJobRequestProjection- Returns:
- The extension configuration if it exists wrapped in an
Optional
-
getRequestedAgentConfigExt
Get the extension configuration of a job agent configuration.- Specified by:
getRequestedAgentConfigExtin interfaceJobRequestProjection- Returns:
- The extension configuration if it exists wrapped in an
Optional
-
getRequestedGpu
Get the number of GPUs requested by the job.- Specified by:
getRequestedGpuin interfaceJobRequestProjection- Returns:
- The number of GPUs requested or
Optional.empty()
-
getRequestedDiskMb
Get the requested disk space for the job if any.- Specified by:
getRequestedDiskMbin interfaceJobRequestProjection- Returns:
- The requested amount of disk space in MB or
Optional.empty()
-
getRequestedNetworkMbps
Get the requested network mbps for the job if any.- Specified by:
getRequestedNetworkMbpsin interfaceJobRequestProjection- Returns:
- The requested network bandwidth in mbps or
Optional.empty()
-
getRequestedImages
Get the requested container image configurations if there were any.- Specified by:
getRequestedImagesin interfaceJobRequestProjection- Returns:
- The requested images or
Optional.empty()
-
getJobDirectoryLocation
Get the job directory location the agent should use.- Specified by:
getJobDirectoryLocationin interfaceJobSpecificationProjection- Returns:
- The job directory location if its been set wrapped in an
Optional
-
getImagesUsed
Get the set of image configuration used for this job.- Specified by:
getImagesUsedin interfaceJobExecutionProjection- Returns:
- The images used or
Optional.empty()
-
setApplications
Set the applications used to run this job.- Parameters:
applications- The applications
-
setClusterCriteria
Set the cluster criteria set for this job.- Parameters:
clusterCriteria- The cluster criteria in priority order
-
getNotifiedJobStatus
Get the previously notified job status if there was one.- Returns:
- The previously notified job status wrapped in an
OptionalorOptional.empty()
-
getRequestedLauncherExt
Get any metadata the user provided with respect to the launcher.- Returns:
- The metadata or
Optional.empty()if there isn't any
-
setRequestedLauncherExt
public void setRequestedLauncherExt(@Nullable com.fasterxml.jackson.databind.JsonNode requestedLauncherExt) Set any metadata pertaining to the launcher that was provided by the user.- Parameters:
requestedLauncherExt- The metadata
-
equals
- Overrides:
equalsin classBaseEntity
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEntity
-