diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-10-16 12:11:24 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-10-16 12:11:24 +0000 |
commit | 40811e93f3fdf9342a9295369994012420fac548 (patch) | |
tree | a8d85e094a9c21e10aa250f537c101fc2016a049 /yt/cpp/mapreduce/interface | |
parent | 30ebe5357bb143648c6be4d151ecd4944af81ada (diff) | |
parent | 28a0c4a9f297064538a018c512cd9bbd00a1a35d (diff) | |
download | ydb-40811e93f3fdf9342a9295369994012420fac548.tar.gz |
Merge branch 'rightlib' into mergelibs-241016-1210
Diffstat (limited to 'yt/cpp/mapreduce/interface')
-rw-r--r-- | yt/cpp/mapreduce/interface/client.h | 12 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/fwd.h | 3 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/operation.h | 64 |
3 files changed, 79 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/client.h b/yt/cpp/mapreduce/interface/client.h index 56efa3c23c..3032025140 100644 --- a/yt/cpp/mapreduce/interface/client.h +++ b/yt/cpp/mapreduce/interface/client.h @@ -493,6 +493,18 @@ public: const TGetJobStderrOptions& options = TGetJobStderrOptions()) = 0; /// + /// @brief Get trace of a job. + /// + /// @ref NYT::TErrorResponse exception is thrown if it is missing. + /// + /// @note YT doesn't store all job traces. + /// + /// @see [YT doc](https://ytsaurus.tech/docs/en/api/commands.html#get_job_trace) + virtual std::vector<TJobTraceEvent> GetJobTrace( + const TOperationId& operationId, + const TGetJobTraceOptions& options = TGetJobTraceOptions()) = 0; + + /// /// @brief Create one or several rbtorrents for files in a blob table. /// /// If specified, one torrent is created for each value of `KeyColumns` option. diff --git a/yt/cpp/mapreduce/interface/fwd.h b/yt/cpp/mapreduce/interface/fwd.h index 0434c03d8b..485b45129a 100644 --- a/yt/cpp/mapreduce/interface/fwd.h +++ b/yt/cpp/mapreduce/interface/fwd.h @@ -157,6 +157,7 @@ namespace NYT { using TTabletCellId = TGUID; using TReplicaId = TGUID; using TJobId = TGUID; + using TJobTraceId = TGUID; using TYPath = TString; using TLocalFilePath = TString; @@ -370,6 +371,8 @@ namespace NYT { struct TListJobsOptions; + struct TGetJobTraceOptions; + struct IOperationClient; enum class EFinishedJobState : int; diff --git a/yt/cpp/mapreduce/interface/operation.h b/yt/cpp/mapreduce/interface/operation.h index 9a85049886..f2de3ea3bd 100644 --- a/yt/cpp/mapreduce/interface/operation.h +++ b/yt/cpp/mapreduce/interface/operation.h @@ -3048,6 +3048,70 @@ struct TGetFailedJobInfoOptions //////////////////////////////////////////////////////////////////////////////// /// +/// @brief Options for @ref NYT::IClient::GetJobTrace. +struct TGetJobTraceOptions +{ + /// @cond Doxygen_Suppress + using TSelf = TGetJobTraceOptions; + /// @endcond + + /// + /// @brief Id of the job. + FLUENT_FIELD_OPTION(TJobId, JobId); + + /// + /// @brief Id of the trace. + FLUENT_FIELD_OPTION(TJobTraceId, TraceId); + + /// + /// @brief Search for traces with time >= `FromTime`. + FLUENT_FIELD_OPTION(i64, FromTime); + + /// + /// @brief Search for traces with time <= `ToTime`. + FLUENT_FIELD_OPTION(i64, ToTime); + + /// + /// @brief Search for traces with event index >= `FromEventIndex`. + FLUENT_FIELD_OPTION(i64, FromEventIndex); + + /// + /// @brief Search for traces with event index >= `ToEventIndex`. + FLUENT_FIELD_OPTION(i64, ToEventIndex); +}; + +/// +/// @brief Response for @ref NYT::IOperation::GetJobTrace. +struct TJobTraceEvent +{ + /// + /// @brief Id of the operation. + TOperationId OperationId; + + /// + /// @brief Id of the job. + TJobId JobId; + + /// + /// @brief Id of the trace. + TJobTraceId TraceId; + + /// + /// @brief Index of the trace event. + i64 EventIndex; + + /// + /// @brief Raw evenr in json format. + TString Event; + + /// + /// @brief Time of the event. + TInstant EventTime; +}; + +//////////////////////////////////////////////////////////////////////////////// + +/// /// @brief Interface representing an operation. struct IOperation : public TThrRefBase |