C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::IOperation Struct Referenceabstract

Interface representing an operation. More...

#include <operation.h>

Inheritance diagram for NYT::IOperation:

Public Member Functions

virtual const TOperationId & GetId () const =0
 Get operation id.
virtual TString GetWebInterfaceUrl () const =0
 Get URL of the operation in YT Web UI.
virtual TString GetStatus () const =0
 Get last error for not started operations. Get state on YT cluster for started operations.
virtual ::NThreading::TFuture< void > GetPreparedFuture ()=0
 Get preparation future.
virtual void Start ()=0
 Start operation synchronously.
virtual bool IsStarted () const =0
 Is the operation started.
virtual ::NThreading::TFuture< void > GetStartedFuture ()=0
 Get start future.
virtual ::NThreading::TFuture< void > Watch ()=0
 Start watching operation.
virtual TVector< TFailedJobInfo > GetFailedJobInfo (const TGetFailedJobInfoOptions &options=TGetFailedJobInfoOptions())=0
 Get information about failed jobs.
virtual EOperationBriefState GetBriefState ()=0
 Get operation brief state.
virtual TMaybe< TYtError > GetError ()=0
 Get error (if operation has failed).
virtual TJobStatistics GetJobStatistics ()=0
 Get job statistics.
virtual TMaybe< TOperationBriefProgress > GetBriefProgress ()=0
virtual TMaybe< THashMap< TString, TYtError > > GetAlerts ()=0
 Get operation alerts.
virtual void AbortOperation ()=0
 Abort operation.
virtual void CompleteOperation ()=0
 Complete operation.
virtual void SuspendOperation (const TSuspendOperationOptions &options=TSuspendOperationOptions())=0
 Suspend operation.
virtual void ResumeOperation (const TResumeOperationOptions &options=TResumeOperationOptions())=0
 Resume previously suspended operation.
virtual TOperationAttributes GetAttributes (const TGetOperationOptions &options=TGetOperationOptions())=0
 Get operation attributes.
virtual void UpdateParameters (const TUpdateOperationParametersOptions &options=TUpdateOperationParametersOptions())=0
 Update operation runtime parameters.
virtual TJobAttributes GetJob (const TJobId &jobId, const TGetJobOptions &options=TGetJobOptions())=0
 Get job attributes.
virtual TListJobsResult ListJobs (const TListJobsOptions &options=TListJobsOptions())=0

Detailed Description

Interface representing an operation.

Member Function Documentation

◆ AbortOperation()

virtual void NYT::IOperation::AbortOperation ( )
pure virtual

Abort operation.

Operation will be finished immediately. All results of completed/running jobs will be lost.

See also
https://ytsaurus.tech/docs/en/api/commands#abort_op

◆ CompleteOperation()

virtual void NYT::IOperation::CompleteOperation ( )
pure virtual

Complete operation.

Operation will be finished immediately. All results of completed jobs will appear in output tables. All results of running (not completed) jobs will be lost.

See also
https://ytsaurus.tech/docs/en/api/commands#complete_op

◆ GetAttributes()

virtual TOperationAttributes NYT::IOperation::GetAttributes ( const TGetOperationOptions & options = TGetOperationOptions())
pure virtual

◆ GetBriefProgress()

virtual TMaybe< TOperationBriefProgress > NYT::IOperation::GetBriefProgress ( )
pure virtual

Get operation progress.

Returns
Nothing() if operation has no running jobs yet, e.g. when it is in "materializing" or "pending" state.

◆ GetError()

virtual TMaybe< TYtError > NYT::IOperation::GetError ( )
pure virtual

Get error (if operation has failed).

Returns
Nothing() if operation is in 'Completed' or 'InProgress' state (or reason for failed / aborted operation).

◆ GetFailedJobInfo()

virtual TVector< TFailedJobInfo > NYT::IOperation::GetFailedJobInfo ( const TGetFailedJobInfoOptions & options = TGetFailedJobInfoOptions())
pure virtual

Get information about failed jobs.

Can be called for operation in any stage. Though user should keep in mind that this method always fetches info from cypress and doesn't work when operation is archived. Successfully completed operations can be archived quite quickly (in about ~30 seconds).

◆ GetJob()

virtual TJobAttributes NYT::IOperation::GetJob ( const TJobId & jobId,
const TGetJobOptions & options = TGetJobOptions() )
pure virtual

◆ GetPreparedFuture()

virtual ::NThreading::TFuture< void > NYT::IOperation::GetPreparedFuture ( )
pure virtual

Get preparation future.

Returns
future that is set when operation is prepared.

◆ GetStartedFuture()

virtual ::NThreading::TFuture< void > NYT::IOperation::GetStartedFuture ( )
pure virtual

Get start future.

Returns
future that is set when operation is started.

◆ GetStatus()

virtual TString NYT::IOperation::GetStatus ( ) const
pure virtual

Get last error for not started operations. Get state on YT cluster for started operations.

For not started operations last error is an error that's being retried during operation preparation/start (e.g. lock files, start operation request).

◆ IsStarted()

virtual bool NYT::IOperation::IsStarted ( ) const
pure virtual

Is the operation started.

Returns true if the operation is started on the cluster

◆ ListJobs()

virtual TListJobsResult NYT::IOperation::ListJobs ( const TListJobsOptions & options = TListJobsOptions())
pure virtual

List jobs satisfying given filters (see NYT::TListJobsOptions).

See also
https://ytsaurus.tech/docs/en/api/commands#list_jobs

◆ ResumeOperation()

virtual void NYT::IOperation::ResumeOperation ( const TResumeOperationOptions & options = TResumeOperationOptions())
pure virtual

Resume previously suspended operation.

See also
https://ytsaurus.tech/docs/en/api/commands#resume_op

◆ Start()

virtual void NYT::IOperation::Start ( )
pure virtual

Start operation synchronously.

Note
: Do NOT call this method twice.

If operation is not prepared yet, Start() will block waiting for preparation finish. Be ready to catch exception if operation preparation or start failed.

◆ SuspendOperation()

virtual void NYT::IOperation::SuspendOperation ( const TSuspendOperationOptions & options = TSuspendOperationOptions())
pure virtual

Suspend operation.

Jobs will not be aborted by default, c.f. NYT::TSuspendOperationOptions.

See also
https://ytsaurus.tech/docs/en/api/commands#suspend_op

◆ UpdateParameters()

virtual void NYT::IOperation::UpdateParameters ( const TUpdateOperationParametersOptions & options = TUpdateOperationParametersOptions())
pure virtual

Update operation runtime parameters.

See also
https://ytsaurus.tech/docs/en/api/commands#update_op_parameters

◆ Watch()

virtual ::NThreading::TFuture< void > NYT::IOperation::Watch ( )
pure virtual

Start watching operation.

Returns
future that is set when operation is complete.
Note
: the user should check value of returned future to ensure that operation completed successfully e.g.
auto operationComplete = operation->Watch();
operationComplete.Wait();
operationComplete.GetValue();

If operation is completed successfully the returned future contains void value. If operation is completed with error future contains NYT::TOperationFailedError. In rare cases when error occurred while waiting (e.g. YT become unavailable) future might contain other exception.


The documentation for this struct was generated from the following file: