Skip to content

Commit 7b27fb1

Browse files
bystrovsergmaVovk
authored andcommitted
YT-26221: Parse control events and save trace info in operations archive
commit_hash:af1a447629e24e0b2fa1e075a45fdc5b5cb16bf4
1 parent e36fb50 commit 7b27fb1

File tree

6 files changed

+26
-12
lines changed

6 files changed

+26
-12
lines changed

yt/cpp/mapreduce/interface/operation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,8 +3221,8 @@ struct TJobTraceEvent
32213221
i64 EventIndex = 0;
32223222

32233223
///
3224-
/// @brief Raw evenr in json format.
3225-
TString Event;
3224+
/// @brief Raw event in json format.
3225+
std::string Event;
32263226

32273227
///
32283228
/// @brief Time of the event.

yt/cpp/mapreduce/rpc_client/rpc_parameters_serialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ NApi::TGetJobTraceOptions SerializeOptionsForGetJobTrace(const TGetJobTraceOptio
786786
result.JobId = NJobTrackerClient::TJobId(YtGuidFromUtilGuid(*options.JobId_));
787787
}
788788
if (options.TraceId_) {
789-
result.TraceId = NScheduler::TJobTraceId(YtGuidFromUtilGuid(*options.TraceId_));
789+
result.TraceId = NJobTrackerClient::TJobTraceId(YtGuidFromUtilGuid(*options.TraceId_));
790790
}
791791
if (options.FromTime_) {
792792
result.FromTime = *options.FromTime_;

yt/yt/client/api/operation_client.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct TGetJobTraceOptions
108108
, public TMasterReadOptions
109109
{
110110
std::optional<NJobTrackerClient::TJobId> JobId;
111-
std::optional<NScheduler::TJobTraceId> TraceId;
111+
std::optional<NJobTrackerClient::TJobTraceId> TraceId;
112112
std::optional<i64> FromTime;
113113
std::optional<i64> ToTime;
114114
std::optional<i64> FromEventIndex;
@@ -444,9 +444,9 @@ struct TJobTraceEvent
444444
{
445445
NJobTrackerClient::TOperationId OperationId;
446446
NJobTrackerClient::TJobId JobId;
447-
NScheduler::TJobTraceId TraceId;
447+
NJobTrackerClient::TJobTraceId TraceId;
448448
i64 EventIndex;
449-
TString Event;
449+
std::string Event;
450450
TInstant EventTime;
451451
};
452452

yt/yt/client/job_tracker_client/public.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace NYT::NJobTrackerClient {
66

77
const TJobId NullJobId;
88
const TOperationId NullOperationId;
9+
const TJobTraceId NullJobTraceId;
910

1011
////////////////////////////////////////////////////////////////////////////////
1112

yt/yt/client/job_tracker_client/public.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ YT_DEFINE_STRONG_TYPEDEF(TOperationId, TGuid);
1616

1717
extern const TOperationId NullOperationId;
1818

19+
YT_DEFINE_STRONG_TYPEDEF(TJobTraceId, TGuid);
20+
21+
extern const TJobTraceId NullJobTraceId;
22+
1923
////////////////////////////////////////////////////////////////////////////////
2024

2125
// NB: Please keep the range of values small as this type
@@ -76,4 +80,19 @@ DEFINE_ENUM(EJobState,
7680

7781
////////////////////////////////////////////////////////////////////////////////
7882

83+
DEFINE_ENUM(EJobTraceEventType,
84+
(TraceStarted)
85+
(TraceFinished)
86+
(TraceDropped)
87+
);
88+
89+
DEFINE_ENUM(EJobTraceState,
90+
(Started)
91+
(Finished)
92+
(Dropped)
93+
(Orphaned)
94+
);
95+
96+
////////////////////////////////////////////////////////////////////////////////
97+
7998
} // namespace NYT::NJobTrackerClient

yt/yt/client/scheduler/public.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ class TSpecPatch;
1616

1717
////////////////////////////////////////////////////////////////////////////////
1818

19-
YT_DEFINE_STRONG_TYPEDEF(TJobTraceId, TGuid);
20-
21-
extern const TJobTraceId NullJobTraceId;
22-
23-
////////////////////////////////////////////////////////////////////////////////
24-
2519
YT_DEFINE_STRONG_TYPEDEF(TAllocationId, TGuid);
2620

2721
extern const TAllocationId NullAllocationId;

0 commit comments

Comments
 (0)