public interface SchedulerService extends LensService, SessionValidator
Modifier and Type | Field and Description |
---|---|
static String |
NAME
The constant name for scheduler service.
|
Modifier and Type | Method and Description |
---|---|
boolean |
deleteJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Delete a job.
|
boolean |
expireJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
End a job by specifying an expiry time.
|
Collection<SchedulerJobStats> |
getAllJobStats(String state,
String user,
String jobName,
long startTime,
long endTime) |
SchedulerJobInstanceInfo |
getInstanceDetails(SchedulerJobInstanceHandle instanceHandle)
Instance details for an instance.
|
XJob |
getJobDefinition(SchedulerJobHandle jobHandle)
Returns the definition of a job.
|
SchedulerJobInfo |
getJobDetails(SchedulerJobHandle jobHandle)
Returns the details of a job.
|
List<SchedulerJobInstanceInfo> |
getJobInstances(SchedulerJobHandle jobHandle,
Long numResults)
Returns handles for last
numResults instances for the job. |
SchedulerJobStats |
getJobStats(SchedulerJobHandle handle,
String state,
long startTime,
long endTime)
Returns stats for a job.
|
boolean |
killInstance(LensSessionHandle sessionHandle,
SchedulerJobInstanceHandle instanceHandle)
Kills a running job instance.
|
LensSessionHandle |
openSessionAsUser(String user)
Create session as user for scheduling the job with no auth.
|
boolean |
rerunInstance(LensSessionHandle sessionHandle,
SchedulerJobInstanceHandle instanceHandle)
Reruns a failed/killed/completed job instance.
|
boolean |
resumeJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Resume a job from a given time.
|
boolean |
scheduleJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Schedule a job.
|
SchedulerJobHandle |
submitAndScheduleJob(LensSessionHandle sessionHandle,
XJob job)
Submit a job and also schedule it.
|
SchedulerJobHandle |
submitJob(LensSessionHandle sessionHandle,
XJob job)
Submit a job.
|
boolean |
suspendJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Suspend a job.
|
boolean |
updateJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle,
XJob newJobDefinition)
Update a job with new definition.
|
getHealthStatus
validateSession
static final String NAME
SchedulerJobHandle submitJob(LensSessionHandle sessionHandle, XJob job) throws LensException
sessionHandle
- handle for this session.job
- job to be submitted.LensException
- the lens exceptionboolean scheduleJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
sessionHandle
- handle for the current session.jobHandle
- handle for the job to be scheduled.LensException
- the lens exceptionSchedulerJobHandle submitAndScheduleJob(LensSessionHandle sessionHandle, XJob job) throws LensException
sessionHandle
- handle for the session.job
- job definition.LensException
- the lens exceptionXJob getJobDefinition(SchedulerJobHandle jobHandle) throws LensException
jobHandle
- handle for the jobLensException
- the lens exceptionSchedulerJobInfo getJobDetails(SchedulerJobHandle jobHandle) throws LensException
jobHandle
- handle for the jobLensException
- the lens exceptionboolean updateJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, XJob newJobDefinition) throws LensException
Updates will be applied only for newer instances. Running instances will be running with old definition
sessionHandle
- jobHandle
- handle for the job which you want to update.newJobDefinition
- LensException
- the lens exceptionboolean expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
sessionHandle
- handle for the current session.jobHandle
- handle for the jobLensException
- the lens exceptionboolean suspendJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
If the job is not in scheduled state, it will return true. Once a job is suspended, no further instances of that job will run. Any running instances of that job will continue normally.
sessionHandle
- handle for the current session.jobHandle
- handle for the jobLensException
- the lens exceptionboolean resumeJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
sessionHandle
- handle for the session.jobHandle
- handle for the jobLensException
- the lens exceptionboolean deleteJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
sessionHandle
- handle for the session.jobHandle
- handle for the jobLensException
- the lens exceptionCollection<SchedulerJobStats> getAllJobStats(String state, String user, String jobName, long startTime, long endTime) throws LensException
state
- filter for status, if specified only jobs in that state will be returned,
if null no entries will be removed from resultuser
- filter for user who submitted the job, if specified only jobs submitted by the given user
will be returned, if not specified no entries will be removed from result on basis of userNamejobName
- filter for jobName, if specified only the jobs with name same as given name will be considered
, else no jobs will be filtered out on the basis of name.startTime
- if specified only instances with scheduleTime after this time will be considered.endTime
- if specified only instances with scheduleTime before this time will be considered.LensException
SchedulerJobStats getJobStats(SchedulerJobHandle handle, String state, long startTime, long endTime) throws LensException
handle
- handle for the jobstate
- filter for status, if specified only jobs in that state will be returned,
if null no entries will be removed from resultstartTime
- if specified only instances with scheduleTime after this time will be considered.endTime
- if specified only instances with scheduleTime before this time will be considered.LensException
- the lens exceptionList<SchedulerJobInstanceInfo> getJobInstances(SchedulerJobHandle jobHandle, Long numResults) throws LensException
numResults
instances for the job.jobHandle
- handle for the jobnumResults
- - number of results to be returned, default 100.LensException
- the lens exceptionboolean killInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException
If the job instance is already completed or not in running state, this will be a no-op and will return false.
sessionHandle
- handle for the session.instanceHandle
- handle for the instanceLensException
- the lens exceptionboolean rerunInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException
If the instance is not in a terminal state, then this operation will be a no-op and will return false.
sessionHandle
- handle for the session.instanceHandle
- handle for the instanceLensException
- the lens exceptionSchedulerJobInstanceInfo getInstanceDetails(SchedulerJobInstanceHandle instanceHandle) throws LensException
instanceHandle
- handle for the instance.LensException
- the lens exceptionLensSessionHandle openSessionAsUser(String user) throws LensException
user
- LensException
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.