diff options
| author | hiddenpath <[email protected]> | 2025-03-26 15:23:45 +0300 |
|---|---|---|
| committer | hiddenpath <[email protected]> | 2025-03-26 15:40:00 +0300 |
| commit | c4ad497a0ca5ae5edd292211fa95002f51380553 (patch) | |
| tree | b14a8a468e760791d6207f7643d3c69dec4f9cc3 /yt/cpp/mapreduce/client/operation.cpp | |
| parent | 9d65201e9a1d3c2ca77ec9bd59fdfe46c682ef72 (diff) | |
YT-24586: Start requesting the progress attribute in GetOperation only when calling GetJobStatistics
commit_hash:a7418a2d5800afabf79f01be0d2ddfff0855b85a
Diffstat (limited to 'yt/cpp/mapreduce/client/operation.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/client/operation.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/yt/cpp/mapreduce/client/operation.cpp b/yt/cpp/mapreduce/client/operation.cpp index 4eac765500c..9a1511025af 100644 --- a/yt/cpp/mapreduce/client/operation.cpp +++ b/yt/cpp/mapreduce/client/operation.cpp @@ -2675,16 +2675,22 @@ void TOperation::TOperationImpl::UpdateAttributesAndCall( } } + auto filter = TOperationAttributeFilter() + .Add(EOperationAttribute::Result) + .Add(EOperationAttribute::State) + .Add(EOperationAttribute::BriefProgress); + // To avoid overloading Cypress, we only request the progress attribute as needed, + // typically when the user asks for job statistics. + if (needJobStatistics) { + filter.Add(EOperationAttribute::Progress); + } + auto attributes = RequestWithRetry<TOperationAttributes>( ClientRetryPolicy_->CreatePolicyForGenericRequest(), - [this] (TMutationId /*mutationId*/) { + [this, &filter] (TMutationId /*mutationId*/) { return RawClient_->GetOperation( *Id_, - TGetOperationOptions().AttributeFilter(TOperationAttributeFilter() - .Add(EOperationAttribute::Result) - .Add(EOperationAttribute::Progress) - .Add(EOperationAttribute::State) - .Add(EOperationAttribute::BriefProgress))); + TGetOperationOptions().AttributeFilter(filter)); }); func(attributes); |
