Class which is responsible for running and retrieving information about jobs in the job scheduling system.
More...
#include <QuickStartJobSource.hpp>
|
| QuickStartJobSource (const jobs::JobRepositoryPtr &in_jobRepository, const jobs::JobStatusNotifierPtr &in_jobStatusNotifier) |
| Constructor. More...
|
|
Error | initialize () override |
| Initializes the Job Source. More...
|
|
bool | cancelJob (api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override |
| Cancels a pending job. More...
|
|
Error | getConfiguration (const system::User &in_user, api::JobSourceConfiguration &out_configuration) const override |
| Gets the configuration and capabilities of this Job Source for the specified user. More...
|
|
Error | getNetworkInfo (api::JobPtr in_job, api::NetworkInfo &out_networkInfo) const override |
| Gets the network information for the specified job. More...
|
|
bool | killJob (api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override |
| Forcibly kills a running job. More...
|
|
bool | resumeJob (api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override |
| Resumes a suspended job. More...
|
|
bool | stopJob (api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override |
| Stops a running job. More...
|
|
bool | suspendJob (api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override |
| Suspends a running job. More...
|
|
Error | submitJob (api::JobPtr io_job, bool &out_wasInvalidRequest) const override |
| Submits a job to the Job Scheduling System. More...
|
|
Error | createOutputStream (api::OutputType in_outputType, api::JobPtr in_job, api::AbstractOutputStream::OnOutput in_onOutput, api::AbstractOutputStream::OnComplete in_onComplete, api::AbstractOutputStream::OnError in_onError, api::OutputStreamPtr &out_outputStream) override |
| Creates an output stream for the specified job. More...
|
|
Error | createResourceStream (api::ConstJobPtr in_job, comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator, api::AbstractResourceStreamPtr &out_resourceStream) override |
| Creates a resource utilization metric stream for the specified job. More...
|
|
virtual | ~IJobSource ()=default |
| Virtual Destructor.
|
|
Class which is responsible for running and retrieving information about jobs in the job scheduling system.
◆ QuickStartJobSource()
rstudio::launcher_plugins::quickstart::QuickStartJobSource::QuickStartJobSource |
( |
const jobs::JobRepositoryPtr & |
in_jobRepository, |
|
|
const jobs::JobStatusNotifierPtr & |
in_jobStatusNotifier |
|
) |
| |
Constructor.
- Parameters
-
in_jobRepository | The job repository, from which to look up jobs. |
in_jobStatusNotifier | The job status notifier to which to post or from which to receive job status updates. |
◆ cancelJob()
bool rstudio::launcher_plugins::quickstart::QuickStartJobSource::cancelJob |
( |
api::JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
overridevirtual |
Cancels a pending job.
This method will not be invoked unless the job is currently pending. The Job lock will be held when this method is invoked.
- Parameters
-
in_job | The job to be canceled. |
out_isComplete | Whether the cancel operation completed successfully (true) or not (false). |
out_statusMessage | The status message of the cancel operation, if any. |
- Returns
- False if the cancel operation is not supported; true otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ createOutputStream()
Error rstudio::launcher_plugins::quickstart::QuickStartJobSource::createOutputStream |
( |
api::OutputType |
in_outputType, |
|
|
api::JobPtr |
in_job, |
|
|
api::AbstractOutputStream::OnOutput |
in_onOutput, |
|
|
api::AbstractOutputStream::OnComplete |
in_onComplete, |
|
|
api::AbstractOutputStream::OnError |
in_onError, |
|
|
api::OutputStreamPtr & |
out_outputStream |
|
) |
| |
|
overridevirtual |
Creates an output stream for the specified job.
- Parameters
-
in_outputType | The type of job output to stream. |
in_job | The job for which output should be streamed. |
in_onOutput | Callback function which will be invoked when data is reported. |
in_onComplete | Callback function which will be invoked when the stream is complete. |
in_onError | Callback function which will be invoked if an error occurs. |
out_outputStream | The newly created output stream, on Success. |
- Returns
- Success if the output stream could be created; Error otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ createResourceStream()
Error rstudio::launcher_plugins::quickstart::QuickStartJobSource::createResourceStream |
( |
api::ConstJobPtr |
in_job, |
|
|
comms::AbstractLauncherCommunicatorPtr |
in_launcherCommunicator, |
|
|
api::AbstractResourceStreamPtr & |
out_resourceStream |
|
) |
| |
|
overridevirtual |
Creates a resource utilization metric stream for the specified job.
- Parameters
-
in_job | The job for which resource utilization metrics should be streamed. |
in_launcherCommunicator | The communicator with which to send responses to the Launcher. |
out_resourceStream | The newly created resource utilization metric stream, on Success. |
- Returns
- Sucess if the stream could be created; the Error that occurred otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ getConfiguration()
Gets the configuration and capabilities of this Job Source for the specified user.
This function controls the options that will be available to users when launching jobs.
NOTE: Many of the values here should most likely be controllable by Launcher administrators when they configure the Launcher. For more details, see the RStudio Launcher Plugin SDK QuickStart Guide TODO #7.
- Parameters
-
in_user | The user who made the request to see the configuration and capabilities of the Cluster. This may be used to return a different configuration based on any configured user profiles. For more information about user profiles, see the 'User Profiles' subsection of the 'Advanced Features' section of the RStudio Launcher Plugin SDK Developer's Guide. |
out_configuration | The configuration and capabilities of this Job Source, for the specified user. |
- Returns
- Success if the configuration and capabilities for this Job Source could be populated; Error otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ getNetworkInfo()
Error rstudio::launcher_plugins::quickstart::QuickStartJobSource::getNetworkInfo |
( |
api::JobPtr |
in_job, |
|
|
api::NetworkInfo & |
out_networkInfo |
|
) |
| const |
|
overridevirtual |
Gets the network information for the specified job.
- Parameters
-
in_job | The job for which to retrieve network information. |
out_networkInfo | The network information of the specified job, if no error occurred. |
- Returns
- Success if the network information could be retrieved; Error otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ initialize()
Error rstudio::launcher_plugins::quickstart::QuickStartJobSource::initialize |
( |
| ) |
|
|
overridevirtual |
◆ killJob()
bool rstudio::launcher_plugins::quickstart::QuickStartJobSource::killJob |
( |
api::JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
overridevirtual |
Forcibly kills a running job.
This method should perform the equivalent of sending a SIGKILL to a process. This method will not be invoked unless the job is currently running. The Job lock will be held when this method is invoked.
- Parameters
-
in_job | The job to be killed. |
out_isComplete | Whether the kill operation completed successfully (true) or not (false). |
out_statusMessage | The status message of the kill operation, if any. |
- Returns
- False if the kill operation is not supported; true otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ resumeJob()
bool rstudio::launcher_plugins::quickstart::QuickStartJobSource::resumeJob |
( |
api::JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
overridevirtual |
Resumes a suspended job.
This method should perform the equivalent of sending a SIGCONT to a process. This method will not be invoked unless the job is currently suspended. The Job lock will be held when this method is invoked.
- Parameters
-
in_job | The job to be resumed. |
out_isComplete | Whether the stop operation completed successfully (true) or not (false). |
out_statusMessage | The status message of the stop operation, if any. |
- Returns
- False if the stop operation is not supported; true otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ stopJob()
bool rstudio::launcher_plugins::quickstart::QuickStartJobSource::stopJob |
( |
api::JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
overridevirtual |
Stops a running job.
This method should perform the equivalent of sending a SIGTERM to a process. This method will not be invoked unless the job is currently running. The Job lock will be held when this method is invoked.
- Parameters
-
in_job | The job to be canceled. |
out_statusMessage | The status message of the cancel operation, if any. |
- Returns
- True if the job was stopped; false otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ submitJob()
Error rstudio::launcher_plugins::quickstart::QuickStartJobSource::submitJob |
( |
api::JobPtr |
io_job, |
|
|
bool & |
out_wasInvalidRequest |
|
) |
| const |
|
overridevirtual |
Submits a job to the Job Scheduling System.
- Parameters
-
io_job | The Job to be submitted. On successful submission, the Job should be updated with relevant details, such as the ID of the job, the Submission time, the actual Job Queue (if applicable), and the current status. |
out_wasInvalidRequest | Whether the requested Job was invalid, based on the features supported by the Job Scheduling System. |
- Returns
- Success if the job could be submitted to the Job Scheduling System; Error otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
◆ suspendJob()
bool rstudio::launcher_plugins::quickstart::QuickStartJobSource::suspendJob |
( |
api::JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
overridevirtual |
Suspends a running job.
This method should perform the equivalent of sending a SIGSTOP to a process. A suspended job should be able to be resumed at a later time. This method will not be invoked unless the job is currently running. The Job lock will be held when this method is invoked.
- Parameters
-
in_job | The job to be suspended. |
out_isComplete | Whether the suspend operation completed successfully (true) or not (false). |
out_statusMessage | The status message of the suspend operation, if any. |
- Returns
- False if the suspend operation is not supported; true otherwise.
Implements rstudio::launcher_plugins::api::IJobSource.
The documentation for this class was generated from the following file: