public class SchedulerServiceImpl extends BaseLensService implements SchedulerService
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The constant name for scheduler service.
|
| Constructor and Description |
|---|
SchedulerServiceImpl(org.apache.hive.service.cli.CLIService cliService)
Instantiates a new scheduler service.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Delete a job.
|
void |
expireJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle,
Date expiryTime)
End a job by specifying an expiry time.
|
Collection<SchedulerJobStats> |
getAllJobStats(LensSessionHandle sessionHandle,
String state,
String user,
String jobName,
long startTime,
long endTime) |
HealthStatus |
getHealthStatus()
Returns the health status of the service.
|
SchedulerJobInstanceInfo |
getInstanceDetails(LensSessionHandle sessionHandle,
SchedulerJobInstanceHandle instanceHandle)
Instance details for an instance.
|
XJob |
getJobDefinition(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Returns the definition of a job.
|
SchedulerJobInfo |
getJobDetails(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle)
Returns the details of a job.
|
List<String> |
getJobInstances(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle,
Long numResults)
Returns handles for last
numResults instances for the job. |
SchedulerJobStats |
getJobStats(LensSessionHandle sessionHandle,
SchedulerJobHandle handle,
String state,
long startTime,
long endTime)
Returns stats for a job.
|
boolean |
killInstance(LensSessionHandle sessionHandle,
SchedulerJobInstanceHandle instanceHandle)
Kills a running job instance.
|
boolean |
rerunInstance(LensSessionHandle sessionHandle,
SchedulerJobInstanceHandle instanceHandle)
Reruns a failed/killed/completed job instance.
|
boolean |
resumeJob(LensSessionHandle sessionHandle,
SchedulerJobHandle jobHandle,
Date effectiveTime)
Resume a job from a given time.
|
void |
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.
|
acquire, acquire, addResource, closeSession, deleteResource, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getNumberOfSessions, getServerDomain, getSession, getSessionManager, getValidPath, openSession, prepareStopping, readExternal, release, release, removePrefixBeforeURI, restoreSession, writeExternalgetServices, init, start, stoppublic static final String NAME
public SchedulerServiceImpl(org.apache.hive.service.cli.CLIService cliService)
cliService - the cli servicepublic HealthStatus getHealthStatus()
getHealthStatus in interface HealthCheckablegetHealthStatus in class BaseLensServicepublic SchedulerJobHandle submitJob(LensSessionHandle sessionHandle, XJob job) throws LensException
submitJob in interface SchedulerServicesessionHandle - handle for this session.job - job to be submitted.LensException - the lens exceptionpublic void scheduleJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
scheduleJob in interface SchedulerServicesessionHandle - handle for the current session.jobHandle - handle for the job to be scheduled.LensException - the lens exceptionpublic SchedulerJobHandle submitAndScheduleJob(LensSessionHandle sessionHandle, XJob job) throws LensException
SchedulerServicesubmitAndScheduleJob in interface SchedulerServicesessionHandle - handle for the session.job - job definition.LensException - the lens exceptionpublic XJob getJobDefinition(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
getJobDefinition in interface SchedulerServicesessionHandle - handle for the session.jobHandle - handle for the jobLensException - the lens exceptionpublic SchedulerJobInfo getJobDetails(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
getJobDetails in interface SchedulerServicesessionHandle - handle for the session.jobHandle - handle for the jobLensException - the lens exceptionpublic boolean updateJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, XJob newJobDefinition) throws LensException
updateJob in interface SchedulerServicejobHandle - handle for the job which you want to update.LensException - the lens exceptionpublic void expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, Date expiryTime) throws LensException
expireJob in interface SchedulerServicesessionHandle - handle for the current session.jobHandle - handle for the jobexpiryTime - time after which the job shouldn't execute.LensException - the lens exceptionpublic boolean suspendJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
suspendJob in interface SchedulerServicesessionHandle - handle for the current session.jobHandle - handle for the jobLensException - the lens exceptionpublic boolean resumeJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, Date effectiveTime) throws LensException
resumeJob in interface SchedulerServicesessionHandle - handle for the session.jobHandle - handle for the jobeffectiveTime - time from which to resume the instances.LensException - the lens exceptionpublic boolean deleteJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException
deleteJob in interface SchedulerServicesessionHandle - handle for the session.jobHandle - handle for the jobLensException - the lens exceptionpublic Collection<SchedulerJobStats> getAllJobStats(LensSessionHandle sessionHandle, String state, String user, String jobName, long startTime, long endTime) throws LensException
getAllJobStats in interface SchedulerServicesessionHandle - handle for the current session.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.LensExceptionpublic SchedulerJobStats getJobStats(LensSessionHandle sessionHandle, SchedulerJobHandle handle, String state, long startTime, long endTime) throws LensException
getJobStats in interface SchedulerServicesessionHandle - handle for session.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 exceptionpublic boolean rerunInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException
rerunInstance in interface SchedulerServicesessionHandle - handle for the session.instanceHandle - handle for the instanceLensException - the lens exceptionpublic List<String> getJobInstances(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, Long numResults) throws LensException
numResults instances for the job.getJobInstances in interface SchedulerServicesessionHandle - handle for the session.jobHandle - handle for the jobnumResults - - number of results to be returned, default 100.LensException - the lens exceptionpublic boolean killInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException
SchedulerServicekillInstance in interface SchedulerServicesessionHandle - handle for the session.instanceHandle - handle for the instanceLensException - the lens exceptionpublic SchedulerJobInstanceInfo getInstanceDetails(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException
getInstanceDetails in interface SchedulerServicesessionHandle - handle for the session.instanceHandle - handle for the instance.LensException - the lens exceptionCopyright © 2014–2016 Apache Software Foundation. All rights reserved.