Generic interface for communicating with a Job Source. Implementation is plugin specific.
More...
#include <IJobSource.hpp>
|
virtual | ~IJobSource ()=default |
| Virtual Destructor.
|
|
virtual Error | initialize ()=0 |
| Initializes the Job Source. More...
|
|
virtual bool | cancelJob (JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0 |
| Cancels a pending job. More...
|
|
virtual Error | getConfiguration (const system::User &in_user, JobSourceConfiguration &out_configuration) const =0 |
| Gets the configuration and capabilities of this Job Source for the specified user. More...
|
|
virtual Error | getNetworkInfo (JobPtr in_job, NetworkInfo &out_networkInfo) const =0 |
| Gets the network information for the specified job. More...
|
|
virtual bool | killJob (JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0 |
| Forcibly kills a running job. More...
|
|
virtual bool | resumeJob (JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0 |
| Resumes a suspended job. More...
|
|
virtual bool | stopJob (JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0 |
| Stops a running job. More...
|
|
virtual bool | suspendJob (JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0 |
| Suspends a running job. More...
|
|
virtual Error | submitJob (JobPtr io_job, bool &out_wasInvalidRequest) const =0 |
| Submits a job to the Job Scheduling System. More...
|
|
virtual Error | createOutputStream (OutputType in_outputType, JobPtr in_job, AbstractOutputStream::OnOutput in_onOutput, AbstractOutputStream::OnComplete in_onComplete, AbstractOutputStream::OnError in_onError, OutputStreamPtr &out_outputStream)=0 |
| Creates an output stream for the specified job. More...
|
|
virtual Error | createResourceStream (ConstJobPtr in_job, comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator, AbstractResourceStreamPtr &out_resourceStream)=0 |
| Creates a resource utilization metric stream for the specified job. More...
|
|
|
| IJobSource (jobs::JobRepositoryPtr in_jobRepository, jobs::JobStatusNotifierPtr in_jobStatusNotifier) |
| Constructor. More...
|
|
Generic interface for communicating with a Job Source. Implementation is plugin specific.
◆ IJobSource()
rstudio::launcher_plugins::api::IJobSource::IJobSource |
( |
jobs::JobRepositoryPtr |
in_jobRepository, |
|
|
jobs::JobStatusNotifierPtr |
in_jobStatusNotifier |
|
) |
| |
|
inlineprotected |
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()
virtual bool rstudio::launcher_plugins::api::IJobSource::cancelJob |
( |
JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
pure virtual |
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.
Implemented in rstudio::launcher_plugins::local::LocalJobSource, and rstudio::launcher_plugins::quickstart::QuickStartJobSource.
◆ createOutputStream()
virtual Error rstudio::launcher_plugins::api::IJobSource::createOutputStream |
( |
OutputType |
in_outputType, |
|
|
JobPtr |
in_job, |
|
|
AbstractOutputStream::OnOutput |
in_onOutput, |
|
|
AbstractOutputStream::OnComplete |
in_onComplete, |
|
|
AbstractOutputStream::OnError |
in_onError, |
|
|
OutputStreamPtr & |
out_outputStream |
|
) |
| |
|
pure virtual |
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.
Implemented in rstudio::launcher_plugins::quickstart::QuickStartJobSource, and rstudio::launcher_plugins::local::LocalJobSource.
◆ createResourceStream()
virtual Error rstudio::launcher_plugins::api::IJobSource::createResourceStream |
( |
ConstJobPtr |
in_job, |
|
|
comms::AbstractLauncherCommunicatorPtr |
in_launcherCommunicator, |
|
|
AbstractResourceStreamPtr & |
out_resourceStream |
|
) |
| |
|
pure virtual |
◆ 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.
Implemented in rstudio::launcher_plugins::quickstart::QuickStartJobSource, and rstudio::launcher_plugins::local::LocalJobSource.
◆ getNetworkInfo()
virtual Error rstudio::launcher_plugins::api::IJobSource::getNetworkInfo |
( |
JobPtr |
in_job, |
|
|
NetworkInfo & |
out_networkInfo |
|
) |
| const |
|
pure virtual |
◆ initialize()
virtual Error rstudio::launcher_plugins::api::IJobSource::initialize |
( |
| ) |
|
|
pure virtual |
◆ killJob()
virtual bool rstudio::launcher_plugins::api::IJobSource::killJob |
( |
JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
pure virtual |
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.
Implemented in rstudio::launcher_plugins::quickstart::QuickStartJobSource, and rstudio::launcher_plugins::local::LocalJobSource.
◆ resumeJob()
virtual bool rstudio::launcher_plugins::api::IJobSource::resumeJob |
( |
JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
pure virtual |
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 resume operation completed successfully (true) or not (false). |
out_statusMessage | The status message of the resume operation, if any. |
- Returns
- False if the resume operation is not supported; true otherwise.
Implemented in rstudio::launcher_plugins::quickstart::QuickStartJobSource, and rstudio::launcher_plugins::local::LocalJobSource.
◆ stopJob()
virtual bool rstudio::launcher_plugins::api::IJobSource::stopJob |
( |
JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
pure virtual |
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 stopped. |
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.
Implemented in rstudio::launcher_plugins::local::LocalJobSource, and rstudio::launcher_plugins::quickstart::QuickStartJobSource.
◆ submitJob()
virtual Error rstudio::launcher_plugins::api::IJobSource::submitJob |
( |
JobPtr |
io_job, |
|
|
bool & |
out_wasInvalidRequest |
|
) |
| const |
|
pure virtual |
◆ suspendJob()
virtual bool rstudio::launcher_plugins::api::IJobSource::suspendJob |
( |
JobPtr |
in_job, |
|
|
bool & |
out_isComplete, |
|
|
std::string & |
out_statusMessage |
|
) |
| |
|
pure virtual |
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.
Implemented in rstudio::launcher_plugins::local::LocalJobSource, and rstudio::launcher_plugins::quickstart::QuickStartJobSource.
◆ m_jobRepository
jobs::JobRepositoryPtr rstudio::launcher_plugins::api::IJobSource::m_jobRepository |
|
protected |
The job repository, from which to look up jobs.
◆ m_jobStatusNotifier
jobs::JobStatusNotifierPtr rstudio::launcher_plugins::api::IJobSource::m_jobStatusNotifier |
|
protected |
The job status notifier to which to post or from which to receive job status updates.
The documentation for this class was generated from the following file:
- /var/lib/jenkins/workspace/IDE/launcher-plugin-sdk/master/sdk/include/api/IJobSource.hpp