diff options
| author | ermolovd <[email protected]> | 2024-11-23 10:59:09 +0300 |
|---|---|---|
| committer | ermolovd <[email protected]> | 2024-11-23 11:10:09 +0300 |
| commit | 8e841b73f8df78e6844dfe9350d0f0a6c98c30cb (patch) | |
| tree | 1c85d665bb9b428d3c5136307bd64dd9187bd66d /yt/cpp/mapreduce/interface/config.cpp | |
| parent | e8c90ae8a977270555b84d2e098839ea75168ce9 (diff) | |
YT-23422: do not write command line into attributes of operations
* Changelog entry
Type: feature
Component: cpp-sdk
C++ SDK doesn't write launching process command line to operation attributes.
commit_hash:c50cbc2a31f5a3b733833767fe94019a0d7615d3
Diffstat (limited to 'yt/cpp/mapreduce/interface/config.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/interface/config.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/yt/cpp/mapreduce/interface/config.cpp b/yt/cpp/mapreduce/interface/config.cpp index 418868a7eba..b1f546f7a4e 100644 --- a/yt/cpp/mapreduce/interface/config.cpp +++ b/yt/cpp/mapreduce/interface/config.cpp @@ -1,6 +1,5 @@ #include "config.h" - -#include "operation.h" +#include "serialize.h" #include <yt/cpp/mapreduce/interface/logging/yt_log.h> @@ -12,17 +11,18 @@ #include <library/cpp/yson/json/yson2json_adapter.h> -#include <util/string/strip.h> #include <util/folder/dirut.h> #include <util/folder/path.h> -#include <util/stream/file.h> #include <util/generic/singleton.h> +#include <util/stream/file.h> #include <util/string/builder.h> #include <util/string/cast.h> +#include <util/string/strip.h> #include <util/string/type.h> +#include <util/system/env.h> +#include <util/system/execpath.h> #include <util/system/hostname.h> #include <util/system/user.h> -#include <util/system/env.h> namespace NYT { @@ -294,27 +294,9 @@ TProcessState::TProcessState() Pid = static_cast<int>(getpid()); - if (!ClientVersion) { - ClientVersion = ::TStringBuilder() << "YT C++ native " << GetProgramCommitId(); - } -} - -static TString CensorString(TString input) -{ - static const TString prefix = "AQAD-"; - if (input.find(prefix) == TString::npos) { - return input; - } else { - return TString(input.size(), '*'); - } -} - -void TProcessState::SetCommandLine(int argc, const char* argv[]) -{ - for (int i = 0; i < argc; ++i) { - CommandLine.push_back(argv[i]); - CensoredCommandLine.push_back(CensorString(CommandLine.back())); - } + ClientVersion = ::TStringBuilder() << "YT C++ native " << GetProgramCommitId(); + BinaryPath = GetExecPath(); + BinaryName = GetBaseName(BinaryPath); } TProcessState* TProcessState::Get() |
