@Path(value="scheduler")
@Produces(value={"application/json","application/xml"})
public class ScheduleResource
extends Object
| Constructor and Description |
|---|
ScheduleResource() |
| Modifier and Type | Method and Description |
|---|---|
LensAPIResult |
deleteJob(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle)
Marks the job for deletion.
|
List<SchedulerJobHandle> |
getAllJobs(LensSessionHandle sessionHandle,
String user,
SchedulerJobState state,
Long start,
Long end)
Get all job handles matching user, state and end_time >job_submission_time >=start time.
|
Collection<SchedulerJobStats> |
getAllJobStats(LensSessionHandle sessionId,
String status,
String jobName,
String user,
long start,
long end)
Get all job stats
|
LensAPIResult<SchedulerJobInstanceInfo> |
getInstanceDetails(LensSessionHandle sessionId,
SchedulerJobInstanceHandle instanceHandle)
Returns a SchedulerInstanceInfo for a given instance handle.
|
LensAPIResult<XJob> |
getJobDefinition(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle)
Get XJob definition for a given job handle.
|
LensAPIResult<SchedulerJobInfo> |
getJobDetails(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle)
Returns the SchedulerJobInfo of a given job handle.
|
List<SchedulerJobInstanceInfo> |
getJobInstances(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle,
Long numResults)
Returns all the instances of a job.
|
String |
getMessage() |
LensAPIResult<SchedulerJobHandle> |
submitJob(LensSessionHandle sessionId,
String action,
XJob job)
Submits a job to be scheduled at later point of time or submit and schedule simultaneously.
|
LensAPIResult |
updateInstance(LensSessionHandle sessionId,
SchedulerJobInstanceHandle instanceHandle,
String action)
Updates an instance
|
LensAPIResult |
updateJob(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle,
String action)
Changes the job state
|
LensAPIResult |
updateJob(LensSessionHandle sessionId,
SchedulerJobHandle jobHandle,
XJob job)
Updates job definition of an existing job.
|
@GET @Produces(value="text/plain") public String getMessage()
@POST
@Consumes(value={"application/xml","application/json"})
@Path(value="jobs")
public LensAPIResult<SchedulerJobHandle> submitJob(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@QueryParam(value="action")
String action,
XJob job)
throws LensException
sessionId - Session ID, the logged-in user will be set as the owner of this jobaction - Action could be submit for storing the job or it could be "submit-and-schedule" to schedule it
just after submitting the job.job - XJob definition of the job to be submittedLensException@GET @Path(value="jobs") public List<SchedulerJobHandle> getAllJobs(@QueryParam(value="sessionid") LensSessionHandle sessionHandle, @QueryParam(value="user") String user, @QueryParam(value="state") SchedulerJobState state, @QueryParam(value="start") Long start, @QueryParam(value="end") Long end) throws LensException
sessionHandle - Session IDuser - User of the jobstate - State of job: for example: SUCCEED or EXPIREDstart - Submission time should be grater than or equal to start timeend - Submission time should be strictly less than the end time.LensException@GET @Path(value="jobs/stats") public Collection<SchedulerJobStats> getAllJobStats(@QueryParam(value="sessionid") LensSessionHandle sessionId, @DefaultValue(value="running") @QueryParam(value="status") String status, @QueryParam(value="name") String jobName, @DefaultValue(value="user") @QueryParam(value="user") String user, @DefaultValue(value="-1") @QueryParam(value="start") long start, @DefaultValue(value="-1") @QueryParam(value="end") long end) throws LensException
sessionId - Session IDstatus - Job statusjobName - Name of the jobuser - User of the jobstart - start timeend - end timeLensException@GET
@Path(value="jobs/{jobHandle}")
public LensAPIResult<XJob> getJobDefinition(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle)
throws LensException
sessionId - SessionIDjobHandle - Job handleLensException@DELETE
@Path(value="jobs/{jobHandle}")
public LensAPIResult deleteJob(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle)
throws LensException
sessionId - Session idjobHandle - Job handleLensException@PUT
@Path(value="jobs/{jobHandle}/")
@Consumes(value={"application/xml","application/json"})
public LensAPIResult updateJob(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle,
XJob job)
throws LensException
sessionId - Session IdjobHandle - Job handlejob - New job definition.LensException@POST
@Path(value="jobs/{jobHandle}")
public LensAPIResult updateJob(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle,
@DefaultValue(value="schedule") @QueryParam(value="action")
String action)
throws LensException
sessionId - Session IdjobHandle - Job handleaction - An action can be SCHEDULE, EXPIRE, SUSPEND or RESUMELensException@GET
@Path(value="jobs/{jobHandle}/info")
public LensAPIResult<SchedulerJobInfo> getJobDetails(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle)
throws LensException
sessionId - Session IDjobHandle - Job handleLensException@GET
@Path(value="jobs/{jobHandle}/instances/")
public List<SchedulerJobInstanceInfo> getJobInstances(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="jobHandle")
SchedulerJobHandle jobHandle,
@QueryParam(value="numResults")
Long numResults)
throws LensException
sessionId - Session idjobHandle - Job handlenumResults - Number of results to be returnedLensException@GET
@Path(value="instances/{instanceHandle}")
public LensAPIResult<SchedulerJobInstanceInfo> getInstanceDetails(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="instanceHandle")
SchedulerJobInstanceHandle instanceHandle)
throws LensException
sessionId - Session IDinstanceHandle - instance handleLensException@POST
@Path(value="instances/{instanceHandle}")
public LensAPIResult updateInstance(@QueryParam(value="sessionid")
LensSessionHandle sessionId,
@PathParam(value="instanceHandle")
SchedulerJobInstanceHandle instanceHandle,
@QueryParam(value="action")
String action)
throws LensException
sessionId - Session IDinstanceHandle - Instance handleaction - the value of action could be KILL or RERUN.LensExceptionCopyright © 2014–2018 Apache Software Foundation. All rights reserved.