Apache Ignite C++ Client
Loading...
Searching...
No Matches
ignite::job_execution Class Reference

#include <job_execution.h>

Public Types

enum class  operation_result { SUCCESS , INVALID_STATE , NOT_FOUND }

Public Member Functions

 job_execution (std::shared_ptr< detail::job_execution_impl > impl)
IGNITE_API uuid get_id () const
IGNITE_API const cluster_nodeget_node () const
IGNITE_API void get_state_async (ignite_callback< std::optional< job_state > > callback)
IGNITE_API std::optional< job_stateget_state ()
IGNITE_API void get_result_async (ignite_callback< std::optional< binary_object > > callback)
IGNITE_API std::optional< binary_objectget_result ()
IGNITE_API void cancel_async (ignite_callback< operation_result > callback)
IGNITE_API operation_result cancel ()
IGNITE_API void change_priority_async (std::int32_t priority, ignite_callback< operation_result > callback)
IGNITE_API operation_result change_priority (std::int32_t priority)

Detailed Description

Job control object, provides information about the job execution process and result, allows cancelling the job.

Member Enumeration Documentation

◆ operation_result

Job operation result.

Enumerator
SUCCESS 

The job operation was successfully complete.

INVALID_STATE 

The job has already finished.

NOT_FOUND 

The job was not found (no longer exists due to exceeding the retention time limit).

Constructor & Destructor Documentation

◆ job_execution()

ignite::job_execution::job_execution ( std::shared_ptr< detail::job_execution_impl > impl)
inlineexplicit

Constructor.

Parameters
implImplementation.

Member Function Documentation

◆ cancel()

IGNITE_API operation_result ignite::job_execution::cancel ( )
inline

Cancels the job execution.

Returns
Result of the cancel operation.

◆ cancel_async()

void ignite::job_execution::cancel_async ( ignite_callback< operation_result > callback)

Cancels the job execution asynchronously.

Parameters
callbackCallback to be called when the operation is complete. Called with the cancel result.

◆ change_priority()

IGNITE_API operation_result ignite::job_execution::change_priority ( std::int32_t priority)
inline

Changes the job priority. After priority change, the job will be the last in the queue of jobs with the same priority.

Parameters
priorityNew priority.
Returns
Result of the operation.

◆ change_priority_async()

void ignite::job_execution::change_priority_async ( std::int32_t priority,
ignite_callback< operation_result > callback )

Changes the job priority asynchronously. After priority change, the job will be the last in the queue of jobs with the same priority.

Parameters
priorityNew priority.
callbackCallback to be called when the operation is complete. Called with the operation result.

◆ get_id()

uuid ignite::job_execution::get_id ( ) const
nodiscard

Gets the job ID.

Returns
Job ID.

◆ get_node()

const cluster_node & ignite::job_execution::get_node ( ) const
nodiscard

Gets the cluster node.

Returns
Cluster node.

◆ get_result()

IGNITE_API std::optional< binary_object > ignite::job_execution::get_result ( )
inline

Gets the job execution result.

Only one thread can wait for a result at a time, which means you cannot call this method in parallel from multiple threads.

Returns
The job execution result.

◆ get_result_async()

void ignite::job_execution::get_result_async ( ignite_callback< std::optional< binary_object > > callback)

Gets the job execution result asynchronously.

Only one callback can be submitted for this operation at a time, which means you cannot call this method in parallel.

Parameters
callbackCallback to be called when the operation is complete. Called with the job execution result.

◆ get_state()

IGNITE_API std::optional< job_state > ignite::job_execution::get_state ( )
inline

Gets the job execution state. Can be nullopt if the job state no longer exists due to exceeding the retention time limit.

Returns
The job state. Can be nullopt if the job state no longer exists due to exceeding the retention time limit.

◆ get_state_async()

void ignite::job_execution::get_state_async ( ignite_callback< std::optional< job_state > > callback)

Gets the job execution state asynchronously. Can be nullopt if the job state no longer exists due to exceeding the retention time limit.

Parameters
callbackCallback to be called when the operation is complete. Called with the job state. It Can be nullopt if the job state no longer exists due to exceeding the retention time limit.

The documentation for this class was generated from the following files: