public interface SchedulerServiceController
| Modifier and Type | Method and Description |
|---|---|
Collection<RunningJob> |
getLocallyRunningJobs()
Returns the list of jobs that are currently executing on this node.
|
LifecycleAwareSchedulerService.State |
getState()
Returns the scheduler service's running state.
|
void |
shutdown()
Permanent shutdown of the scheduler.
|
void |
standby()
Places the scheduler into standby mode.
|
void |
start()
Starts the scheduler if it had never been started or had been placed in
standby() mode. |
boolean |
waitUntilIdle(long timeout,
TimeUnit units)
Waits for up to
timeout units for any currently executing jobs to complete. |
void start()
throws SchedulerServiceException
standby() mode.
If the scheduler was already active, then the request has no effect.SchedulerServiceException - if the scheduler cannot be startedvoid standby()
throws SchedulerServiceException
started
again. If the scheduler was already in standby, then the request has no effect. The standby mode only
affects the local node's ability to schedule jobs. For any
RunMode.RUN_ONCE_PER_CLUSTER jobs the jobs may still run on other
nodes if they exist and have started. If a job should have run while the scheduler was in standby mode, the
implementation may trigger those jobs when restarted, but this is not guaranteed.SchedulerServiceException - if the scheduler cannot be be placed in standby modevoid shutdown()
@Nonnull Collection<RunningJob> getLocallyRunningJobs()
shutdown().boolean waitUntilIdle(long timeout,
TimeUnit units)
throws InterruptedException
timeout units for any currently executing jobs to complete.
Note that if the scheduler has not been shutdown() or placed in standby()
mode, then jobs could start after this returns true. As with getLocallyRunningJobs(),
this is only aware of jobs running on this node of the cluster, and it is guaranteed to be safe to
call even after a shutdown().timeout - the timeout period, in the specified units; non-positive values request an immediate
poll — that is, it is equivalent to getLocallyRunningJobs().isEmpty()true if the scheduler is now idle; false if jobs are still executing.InterruptedException - if the current thread is interrupted while waiting for the
scheduler to become idle.IllegalArgumentException - if timeout is negative@Nonnull LifecycleAwareSchedulerService.State getState()
LifecycleAwareSchedulerService.State.STANDBY
and can be moved between this state and LifecycleAwareSchedulerService.State.STANDBY freely. LifecycleAwareSchedulerService.State.SHUTDOWN is
terminal — that is, once shut down, the scheduler's state can no longer be changed.Copyright © 2017 Atlassian. All rights reserved.