summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface
diff options
context:
space:
mode:
authoromgronny <[email protected]>2024-10-11 21:16:54 +0300
committeromgronny <[email protected]>2024-10-11 21:28:33 +0300
commitc7307fc40d61e2a996fd7c22ee9ef52663897b3b (patch)
treecf38637a1ef654e984c4847260253dd8195bff66 /yt/cpp/mapreduce/interface
parent1df197e6035ea9826bfedee7d48812e318ba9c7a (diff)
YT-21938: Introduce get_job_trace
* Changelog entry\ Type: feature\ Component: proxy Add the handler that gets the job’s trace events. commit_hash:c9d1a6d57e886a266967d57065bd3948882808c7
Diffstat (limited to 'yt/cpp/mapreduce/interface')
-rw-r--r--yt/cpp/mapreduce/interface/client.h12
-rw-r--r--yt/cpp/mapreduce/interface/fwd.h3
-rw-r--r--yt/cpp/mapreduce/interface/operation.h64
3 files changed, 79 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/client.h b/yt/cpp/mapreduce/interface/client.h
index 56efa3c23cd..30320251402 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 0434c03d8b9..485b45129af 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 9a850498868..f2de3ea3bdd 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