diff options
author | hiddenpath <[email protected]> | 2025-04-18 06:14:31 +0300 |
---|---|---|
committer | hiddenpath <[email protected]> | 2025-04-18 06:26:19 +0300 |
commit | 794bfc553e78c09c6b275acbf5a71c62c722df1a (patch) | |
tree | 56fcdfce774fcba27c5f747ee8fbeff3966ee26b /yt/cpp/mapreduce/http_client/raw_client.cpp | |
parent | 7439a2bee2845a5b8a3b38c42b9cdd03ce6c9b2f (diff) |
YT-23616: Dispatch on some dyntable methods
commit_hash:c279c66b6d18c54f7f1794d2a0ba851119dd59c8
Diffstat (limited to 'yt/cpp/mapreduce/http_client/raw_client.cpp')
-rw-r--r-- | yt/cpp/mapreduce/http_client/raw_client.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/yt/cpp/mapreduce/http_client/raw_client.cpp b/yt/cpp/mapreduce/http_client/raw_client.cpp index ab8fbf5821c..cb5a852b176 100644 --- a/yt/cpp/mapreduce/http_client/raw_client.cpp +++ b/yt/cpp/mapreduce/http_client/raw_client.cpp @@ -677,7 +677,14 @@ void THttpRawClient::InsertRows( const TNode::TListType& rows, const TInsertRowsOptions& options) { - NRawClient::InsertRows(Context_, path, rows, options); + TMutationId mutationId; + THttpHeader header("PUT", "insert_rows"); + header.SetInputFormat(TFormat::YsonBinary()); + header.MergeParameters(NRawClient::SerializeParametersForInsertRows(Context_.Config->Prefix, path, options)); + auto body = NodeListToYsonString(rows); + TRequestConfig config; + config.IsHeavy = true; + RequestWithoutRetry(Context_, mutationId, header, body, config)->GetResponse(); } void THttpRawClient::TrimRows( @@ -701,7 +708,28 @@ TNode::TListType THttpRawClient::LookupRows( const TNode::TListType& keys, const TLookupRowsOptions& options) { - return NRawClient::LookupRows(Context_, path, keys, options); + TMutationId mutationId; + THttpHeader header("PUT", "lookup_rows"); + header.AddPath(AddPathPrefix(path, Context_.Config->ApiVersion)); + header.SetInputFormat(TFormat::YsonBinary()); + header.SetOutputFormat(TFormat::YsonBinary()); + + header.MergeParameters(BuildYsonNodeFluently().BeginMap() + .DoIf(options.Timeout_.Defined(), [&] (TFluentMap fluent) { + fluent.Item("timeout").Value(static_cast<i64>(options.Timeout_->MilliSeconds())); + }) + .Item("keep_missing_rows").Value(options.KeepMissingRows_) + .Item("versioned").Value(options.Versioned_) + .DoIf(options.Columns_.Defined(), [&] (TFluentMap fluent) { + fluent.Item("column_names").Value(*options.Columns_); + }) + .EndMap()); + + auto body = NodeListToYsonString(keys); + TRequestConfig config; + config.IsHeavy = true; + auto responseInfo = RequestWithoutRetry(Context_, mutationId, header, body, config); + return NodeFromYsonString(responseInfo->GetResponse(), ::NYson::EYsonType::ListFragment).AsList(); } TNode::TListType THttpRawClient::SelectRows( @@ -819,7 +847,15 @@ void THttpRawClient::DeleteRows( const TNode::TListType& keys, const TDeleteRowsOptions& options) { - NRawClient::DeleteRows(Context_, path, keys, options); + TMutationId mutationId; + THttpHeader header("PUT", "delete_rows"); + header.SetInputFormat(TFormat::YsonBinary()); + header.MergeParameters(NRawClient::SerializeParametersForDeleteRows(Context_.Config->Prefix, path, options)); + + auto body = NodeListToYsonString(keys); + TRequestConfig config; + config.IsHeavy = true; + RequestWithoutRetry(Context_, mutationId, header, body, config)->GetResponse(); } void THttpRawClient::FreezeTable( |