summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp
diff options
context:
space:
mode:
authorhiddenpath <[email protected]>2025-05-30 14:23:32 +0300
committerhiddenpath <[email protected]>2025-05-30 14:52:12 +0300
commit4850e38fc581e776c4b74166b24cc67a65726ae1 (patch)
treeb8b7bf6cb36e2d29b2283cdd3fe438cfbe96a79b /yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp
parentaa5b65fb974e9de8da3dfd1716808817e83c9e6b (diff)
Introduce suppress access tracking options
commit_hash:1b44475c0447374091b3f13cd7e2126757874ebb
Diffstat (limited to 'yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp')
-rw-r--r--yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp56
1 files changed, 54 insertions, 2 deletions
diff --git a/yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp b/yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp
index 14ab0e1db85..7a8ce040ac0 100644
--- a/yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp
+++ b/yt/cpp/mapreduce/http_client/rpc_parameters_serialization.cpp
@@ -71,13 +71,24 @@ static void SetFirstLastTabletIndex(TNode* node, const TOptions& options)
}
template <typename T>
-void SerializeMasterReadOptions(TNode* node, const TMasterReadOptions<T>& options)
+static void SerializeMasterReadOptions(TNode* node, const TMasterReadOptions<T>& options)
{
if (options.ReadFrom_) {
(*node)["read_from"] = ToString(*options.ReadFrom_);
}
}
+template <typename T>
+static void SerializeSuppressableAccessTrackingOptions(TNode* node, const TSuppressableAccessTrackingOptions<T>& options)
+{
+ if (options.SuppressAccessTracking_) {
+ (*node)["suppress_access_tracking"] = options.SuppressAccessTracking_;
+ }
+ if (options.SuppressModificationTracking_) {
+ (*node)["suppress_modification_tracking"] = options.SuppressAccessTracking_;
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
TNode SerializeParamsForCreate(
@@ -124,6 +135,7 @@ TNode SerializeParamsForExists(
SetTransactionIdParam(&result, transactionId);
SetPathParam(&result, pathPrefix, path);
SerializeMasterReadOptions(&result, options);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
return result;
}
@@ -137,6 +149,7 @@ TNode SerializeParamsForGet(
SetTransactionIdParam(&result, transactionId);
SetPathParam(&result, pathPrefix, path);
SerializeMasterReadOptions(&result, options);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
if (options.AttributeFilter_) {
result["attributes"] = SerializeAttributeFilter(*options.AttributeFilter_);
}
@@ -155,6 +168,7 @@ TNode SerializeParamsForSet(
TNode result;
SetTransactionIdParam(&result, transactionId);
SetPathParam(&result, pathPrefix, path);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
result["recursive"] = options.Recursive_;
if (options.Force_) {
result["force"] = *options.Force_;
@@ -171,6 +185,7 @@ TNode SerializeParamsForMultisetAttributes(
TNode result;
SetTransactionIdParam(&result, transactionId);
SetPathParam(&result, pathPrefix, path);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
if (options.Force_) {
result["force"] = *options.Force_;
}
@@ -187,6 +202,7 @@ TNode SerializeParamsForList(
SetTransactionIdParam(&result, transactionId);
SetPathParam(&result, pathPrefix, path);
SerializeMasterReadOptions(&result, options);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
if (options.MaxSize_) {
result["max_size"] = *options.MaxSize_;
}
@@ -598,6 +614,29 @@ TNode SerializeParamsForListJobs(
return result;
}
+TNode SerializeParamsForSelectRows(
+ const TString& query,
+ const TSelectRowsOptions& options)
+{
+ TNode result;
+ result["query"] = query;
+ SerializeSuppressableAccessTrackingOptions(&result, options);
+ if (options.Timeout_) {
+ result["timeout"] = static_cast<i64>(options.Timeout_->MilliSeconds());
+ }
+ if (options.InputRowLimit_) {
+ result["input_row_limit"] = *options.InputRowLimit_;
+ }
+ if (options.OutputRowLimit_) {
+ result["output_row_limit"] = *options.OutputRowLimit_;
+ }
+ result["range_expansion_limit"] = options.RangeExpansionLimit_;
+ result["fail_on_incomplete_result"] = options.FailOnIncompleteResult_;
+ result["verbose_logging"] = options.VerboseLogging_;
+ result["enable_code_cache"] = options.EnableCodeCache_;
+ return result;
+}
+
TNode SerializeParametersForInsertRows(
const TString& pathPrefix,
const TYPath& path,
@@ -658,6 +697,7 @@ TNode SerializeParamsForReadTable(
{
TNode result;
SetTransactionIdParam(&result, transactionId);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
result["control_attributes"] = BuildYsonNodeFluently()
.BeginMap()
.Item("enable_row_index").Value(options.ControlAttributes_.EnableRowIndex_)
@@ -666,10 +706,11 @@ TNode SerializeParamsForReadTable(
return result;
}
-TNode SerializeParamsForReadTablePartition(const TString& cookie, const TTablePartitionReaderOptions& /*options*/)
+TNode SerializeParamsForReadTablePartition(const TString& cookie, const TTablePartitionReaderOptions& options)
{
TNode node;
node["cookie"] = cookie;
+ SerializeSuppressableAccessTrackingOptions(&node, options);
return node;
}
@@ -691,6 +732,7 @@ TNode SerializeParamsForReadBlobTable(
.UpperLimit(TReadLimit().Key(upperLimitKey))));
SetTransactionIdParam(&result, transactionId);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
result["start_part_index"] = options.StartPartIndex_;
result["offset"] = options.Offset_;
@@ -824,6 +866,16 @@ TNode SerializeParamsForGetTablePartitions(
return result;
}
+TNode SerializeParamsForReadFile(
+ const TTransactionId& transactionId,
+ const TFileReaderOptions& options)
+{
+ TNode result;
+ SetTransactionIdParam(&result, transactionId);
+ SerializeSuppressableAccessTrackingOptions(&result, options);
+ return result;
+}
+
TNode SerializeParamsForGetFileFromCache(
const TTransactionId& transactionId,
const TString& md5Signature,