Skip to content

Commit ca007c0

Browse files
dcherednikGazizonoki
authored andcommitted
Moved commit "Implementation of api which can return key_range -> nodeId mapping" from ydb repo
1 parent c8ec3dc commit ca007c0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

include/ydb-cpp-sdk/client/table/table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ bool operator!=(const TChangefeedDescription& lhs, const TChangefeedDescription&
424424
struct TPartitionStats {
425425
uint64_t Rows = 0;
426426
uint64_t Size = 0;
427+
uint32_t LeaderNodeId = 0;
427428
};
428429

429430
class TDateTypeColumnModeSettings {
@@ -1643,6 +1644,7 @@ struct TDescribeTableSettings : public TOperationRequestSettings<TDescribeTableS
16431644
FLUENT_SETTING_DEFAULT(bool, WithTableStatistics, false);
16441645
FLUENT_SETTING_DEFAULT(bool, WithPartitionStatistics, false);
16451646
FLUENT_SETTING_DEFAULT(bool, WithSetVal, false);
1647+
FLUENT_SETTING_DEFAULT(bool, WithShardNodesInfo, false);
16461648
};
16471649

16481650
struct TExplainDataQuerySettings : public TOperationRequestSettings<TExplainDataQuerySettings> {

src/client/table/impl/table_client.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ TAsyncDescribeTableResult TTableClient::TImpl::DescribeTable(const std::string&
529529
request.set_include_set_val(true);
530530
}
531531

532+
if (settings.WithShardNodesInfo_) {
533+
request.set_include_shard_nodes_info(true);
534+
}
535+
532536
auto promise = NewPromise<TDescribeTableResult>();
533537

534538
auto extractor = [promise, settings]

src/client/table/table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class TTableDescription::TImpl {
422422

423423
for (const auto& shardStats : Proto_.table_stats().partition_stats()) {
424424
PartitionStats_.emplace_back(
425-
TPartitionStats{shardStats.rows_estimate(), shardStats.store_size()}
425+
TPartitionStats{shardStats.rows_estimate(), shardStats.store_size(), shardStats.leader_node_id()}
426426
);
427427
}
428428

0 commit comments

Comments
 (0)