public class JobStateServiceImpl extends java.lang.Object implements JobStateService
| Modifier and Type | Field and Description |
|---|---|
protected GenieEventBus |
genieEventBus |
protected io.micrometer.core.instrument.MeterRegistry |
registry |
protected org.springframework.scheduling.TaskScheduler |
scheduler |
| Constructor and Description |
|---|
JobStateServiceImpl(JobSubmitterService jobSubmitterService,
org.springframework.scheduling.TaskScheduler scheduler,
GenieEventBus genieEventBus,
io.micrometer.core.instrument.MeterRegistry registry)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
done(java.lang.String jobId)
Called when the job is done.
|
int |
getNumActiveJobs()
Get the number of jobs active on this node.
|
int |
getUsedMemory()
Get the amount of memory currently used by jobs in MB.
|
void |
init(java.lang.String jobId)
Initialize the job.
|
boolean |
jobExists(java.lang.String jobId)
Returns true if the job exists locally.
|
void |
schedule(java.lang.String jobId,
com.netflix.genie.common.dto.JobRequest jobRequest,
com.netflix.genie.common.internal.dto.v4.Cluster cluster,
com.netflix.genie.common.internal.dto.v4.Command command,
java.util.List<com.netflix.genie.common.internal.dto.v4.Application> applications,
int memory)
Schedules the job.
|
protected void |
setMemoryAndTask(java.lang.String jobId,
int memory,
java.util.concurrent.Future<?> task) |
protected final org.springframework.scheduling.TaskScheduler scheduler
protected final io.micrometer.core.instrument.MeterRegistry registry
protected final GenieEventBus genieEventBus
public JobStateServiceImpl(JobSubmitterService jobSubmitterService, org.springframework.scheduling.TaskScheduler scheduler, GenieEventBus genieEventBus, io.micrometer.core.instrument.MeterRegistry registry)
jobSubmitterService - implementation of the job submitter servicescheduler - The task scheduler to use to register scheduling of job checkersgenieEventBus - The event bus to use to publish eventsregistry - The metrics registrypublic void init(java.lang.String jobId)
init in interface JobStateServicejobId - job idpublic void schedule(java.lang.String jobId,
com.netflix.genie.common.dto.JobRequest jobRequest,
com.netflix.genie.common.internal.dto.v4.Cluster cluster,
com.netflix.genie.common.internal.dto.v4.Command command,
java.util.List<com.netflix.genie.common.internal.dto.v4.Application> applications,
int memory)
schedule in interface JobStateServicejobId - job idjobRequest - job requestcluster - cluster for the job request based on the tags specifiedcommand - command for the job request based on command tags and cluster chosenapplications - applications to use based on the command that was selectedmemory - job memorypublic void done(java.lang.String jobId)
throws com.netflix.genie.common.exceptions.GenieException
done in interface JobStateServicejobId - job idcom.netflix.genie.common.exceptions.GenieException - on unrecoverable errorpublic boolean jobExists(java.lang.String jobId)
jobExists in interface JobStateServicejobId - job idprotected void setMemoryAndTask(java.lang.String jobId,
int memory,
java.util.concurrent.Future<?> task)
public int getNumActiveJobs()
getNumActiveJobs in interface JobMetricsServicepublic int getUsedMemory()
getUsedMemory in interface JobMetricsService