aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@prnwatch.com>2022-02-21 17:31:04 +0300
committerAlexey Efimov <xeno@prnwatch.com>2022-02-21 17:31:04 +0300
commitff50dac3b040da3446c0b3a77818e7379fdb6d43 (patch)
tree437f5686ec019254d3bae654b5da371d1d25723b
parent7b18d121542023f9a06c68d4265932d0d97b7586 (diff)
downloadydb-ff50dac3b040da3446c0b3a77818e7379fdb6d43.tar.gz
return domain / subdomain tablets by path on tabletinfo handler KIKIMR-14408
ref:ef53c78334dd0460d3e9e835e0d1f1dbd4d0a93a
-rw-r--r--ydb/core/viewer/json_tabletinfo.h46
1 files changed, 40 insertions, 6 deletions
diff --git a/ydb/core/viewer/json_tabletinfo.h b/ydb/core/viewer/json_tabletinfo.h
index 32546865a15..3f273e8e95b 100644
--- a/ydb/core/viewer/json_tabletinfo.h
+++ b/ydb/core/viewer/json_tabletinfo.h
@@ -94,13 +94,47 @@ public:
void Handle(NSchemeShard::TEvSchemeShard::TEvDescribeSchemeResult::TPtr &ev) {
THolder<NSchemeShard::TEvSchemeShard::TEvDescribeSchemeResult> describeResult = ev->Release();
if (describeResult->GetRecord().GetStatus() == NKikimrScheme::EStatus::StatusSuccess) {
- Tablets.reserve(describeResult->GetRecord().GetPathDescription().TablePartitionsSize());
- for (const auto& partition : describeResult->GetRecord().GetPathDescription().GetTablePartitions()) {
- Tablets.emplace_back(partition.GetDatashardId());
+ const auto& pathDescription = describeResult->GetRecord().GetPathDescription();
+ if (pathDescription.GetSelf().GetPathType() == NKikimrSchemeOp::EPathType::EPathTypeTable) {
+ Tablets.reserve(describeResult->GetRecord().GetPathDescription().TablePartitionsSize());
+ for (const auto& partition : describeResult->GetRecord().GetPathDescription().GetTablePartitions()) {
+ Tablets.emplace_back(partition.GetDatashardId());
+ }
+ }
+ if (pathDescription.GetSelf().GetPathType() == NKikimrSchemeOp::EPathType::EPathTypePersQueueGroup) {
+ Tablets.reserve(describeResult->GetRecord().GetPathDescription().GetPersQueueGroup().PartitionsSize());
+ for (const auto& partition : describeResult->GetRecord().GetPathDescription().GetPersQueueGroup().GetPartitions()) {
+ Tablets.emplace_back(partition.GetTabletId());
+ }
}
- Tablets.reserve(describeResult->GetRecord().GetPathDescription().GetPersQueueGroup().PartitionsSize());
- for (const auto& partition : describeResult->GetRecord().GetPathDescription().GetPersQueueGroup().GetPartitions()) {
- Tablets.emplace_back(partition.GetTabletId());
+ if (pathDescription.GetSelf().GetPathType() == NKikimrSchemeOp::EPathType::EPathTypeDir
+ || pathDescription.GetSelf().GetPathType() == NKikimrSchemeOp::EPathType::EPathTypeSubDomain
+ || pathDescription.GetSelf().GetPathType() == NKikimrSchemeOp::EPathType::EPathTypeExtSubDomain) {
+ if (pathDescription.HasDomainDescription()) {
+ for (TTabletId tabletId : pathDescription.GetDomainDescription().GetProcessingParams().GetCoordinators()) {
+ Tablets.emplace_back(tabletId);
+ }
+ for (TTabletId tabletId : pathDescription.GetDomainDescription().GetProcessingParams().GetMediators()) {
+ Tablets.emplace_back(tabletId);
+ }
+ if (pathDescription.GetDomainDescription().GetProcessingParams().HasSchemeShard()) {
+ Tablets.emplace_back(pathDescription.GetDomainDescription().GetProcessingParams().GetSchemeShard());
+ } else {
+ TIntrusivePtr<TDomainsInfo> domains = AppData()->DomainsInfo;
+ TIntrusivePtr<TDomainsInfo::TDomain> domain = domains->Domains.begin()->second;
+
+ Tablets.emplace_back(domain->SchemeRoot);
+
+ ui32 hiveDomain = domains->GetHiveDomainUid(domain->DefaultHiveUid);
+ ui64 defaultStateStorageGroup = domains->GetDefaultStateStorageGroup(hiveDomain);
+ Tablets.emplace_back(MakeBSControllerID(defaultStateStorageGroup));
+ Tablets.emplace_back(MakeConsoleID(defaultStateStorageGroup));
+ Tablets.emplace_back(MakeNodeBrokerID(defaultStateStorageGroup));
+ }
+ if (pathDescription.GetDomainDescription().GetProcessingParams().HasHive()) {
+ Tablets.emplace_back(pathDescription.GetDomainDescription().GetProcessingParams().GetHive());
+ }
+ }
}
Sort(Tablets);
Tablets.erase(std::unique(Tablets.begin(), Tablets.end()), Tablets.end());