diff options
author | snaury <snaury@ydb.tech> | 2023-03-30 20:36:06 +0300 |
---|---|---|
committer | snaury <snaury@ydb.tech> | 2023-03-30 20:36:06 +0300 |
commit | 3f2cb85d2a2714d0168f3d775d99e28c07c84f9c (patch) | |
tree | 78364d61790128f0de2d7647ba7e1b86f717b340 | |
parent | 4b95ebf9e7342323165e201e14195f583d4f61b3 (diff) | |
download | ydb-3f2cb85d2a2714d0168f3d775d99e28c07c84f9c.tar.gz |
Cache NBS and NFS path descriptions in scheme cache
-rw-r--r-- | ydb/core/tx/scheme_board/cache.cpp | 30 | ||||
-rw-r--r-- | ydb/core/tx/scheme_cache/scheme_cache.h | 14 |
2 files changed, 40 insertions, 4 deletions
diff --git a/ydb/core/tx/scheme_board/cache.cpp b/ydb/core/tx/scheme_board/cache.cpp index e07bf27e49..3080f5058a 100644 --- a/ydb/core/tx/scheme_board/cache.cpp +++ b/ydb/core/tx/scheme_board/cache.cpp @@ -226,6 +226,8 @@ namespace { entry.SequenceInfo.Drop(); entry.ReplicationInfo.Drop(); entry.BlobDepotInfo.Drop(); + entry.BlockStoreVolumeInfo.Drop(); + entry.FileStoreInfo.Drop(); } static void SetErrorAndClear(TResolveContext* context, TResolve::TEntry& entry) { @@ -738,6 +740,8 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { BlobDepotInfo.Drop(); ExternalTableInfo.Drop(); ExternalDataSourceInfo.Drop(); + BlockStoreVolumeInfo.Drop(); + FileStoreInfo.Drop(); } void FillTableInfo(const NKikimrSchemeOp::TPathDescription& pathDesc) { @@ -1168,6 +1172,8 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { DESCRIPTION_PART(BlobDepotInfo); DESCRIPTION_PART(ExternalTableInfo); DESCRIPTION_PART(ExternalDataSourceInfo); + DESCRIPTION_PART(BlockStoreVolumeInfo); + DESCRIPTION_PART(FileStoreInfo); #undef DESCRIPTION_PART @@ -1393,8 +1399,6 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { FillInfo(Kind, DomainDescription, std::move(*pathDesc.MutableDomainDescription())); break; case NKikimrSchemeOp::EPathTypeDir: - case NKikimrSchemeOp::EPathTypeBlockStoreVolume: - case NKikimrSchemeOp::EPathTypeFileStore: Kind = TNavigate::KindPath; if (entryDesc.GetPathId() == entryDesc.GetParentPathId()) { FillInfo(Kind, DomainDescription, std::move(*pathDesc.MutableDomainDescription())); @@ -1482,6 +1486,14 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { Kind = TNavigate::KindExternalDataSource; FillInfo(Kind, ExternalDataSourceInfo, std::move(*pathDesc.MutableExternalDataSourceDescription())); break; + case NKikimrSchemeOp::EPathTypeBlockStoreVolume: + Kind = TNavigate::KindBlockStoreVolume; + FillInfo(Kind, BlockStoreVolumeInfo, std::move(*pathDesc.MutableBlockStoreVolumeDescription())); + break; + case NKikimrSchemeOp::EPathTypeFileStore: + Kind = TNavigate::KindFileStore; + FillInfo(Kind, FileStoreInfo, std::move(*pathDesc.MutableFileStoreDescription())); + break; case NKikimrSchemeOp::EPathTypeInvalid: Y_VERIFY_DEBUG(false, "Invalid path type"); break; @@ -1499,8 +1511,6 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { switch (child.GetPathType()) { case NKikimrSchemeOp::EPathTypeSubDomain: case NKikimrSchemeOp::EPathTypeDir: - case NKikimrSchemeOp::EPathTypeBlockStoreVolume: - case NKikimrSchemeOp::EPathTypeFileStore: ListNodeEntry->Children.emplace_back(name, pathId, TNavigate::KindPath); break; case NKikimrSchemeOp::EPathTypeExtSubDomain: @@ -1545,6 +1555,12 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { case NKikimrSchemeOp::EPathTypeExternalDataSource: ListNodeEntry->Children.emplace_back(name, pathId, TNavigate::KindExternalDataSource); break; + case NKikimrSchemeOp::EPathTypeBlockStoreVolume: + ListNodeEntry->Children.emplace_back(name, pathId, TNavigate::KindBlockStoreVolume); + break; + case NKikimrSchemeOp::EPathTypeFileStore: + ListNodeEntry->Children.emplace_back(name, pathId, TNavigate::KindFileStore); + break; case NKikimrSchemeOp::EPathTypeTableIndex: case NKikimrSchemeOp::EPathTypeInvalid: Y_VERIFY_DEBUG(false, "Invalid path type"); @@ -1757,6 +1773,8 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { entry.BlobDepotInfo = BlobDepotInfo; entry.ExternalTableInfo = ExternalTableInfo; entry.ExternalDataSourceInfo = ExternalDataSourceInfo; + entry.BlockStoreVolumeInfo = BlockStoreVolumeInfo; + entry.FileStoreInfo = FileStoreInfo; } bool CheckColumns(TResolveContext* context, TResolve::TEntry& entry, @@ -2037,6 +2055,10 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { // ExternalDataSource specific TIntrusivePtr<TNavigate::TExternalDataSourceInfo> ExternalDataSourceInfo; + // NBS specific + TIntrusivePtr<TNavigate::TBlockStoreVolumeInfo> BlockStoreVolumeInfo; + TIntrusivePtr<TNavigate::TFileStoreInfo> FileStoreInfo; + }; // TCacheItem struct TMerger { diff --git a/ydb/core/tx/scheme_cache/scheme_cache.h b/ydb/core/tx/scheme_cache/scheme_cache.h index 8ac8e41c2f..094a8d1c01 100644 --- a/ydb/core/tx/scheme_cache/scheme_cache.h +++ b/ydb/core/tx/scheme_cache/scheme_cache.h @@ -131,6 +131,8 @@ struct TSchemeCacheNavigate { KindBlobDepot = 16, KindExternalTable = 17, KindExternalDataSource = 18, + KindBlockStoreVolume = 19, + KindFileStore = 20, }; struct TListNodeEntry : public TAtomicRefCount<TListNodeEntry> { @@ -223,6 +225,16 @@ struct TSchemeCacheNavigate { NKikimrSchemeOp::TExternalDataSourceDescription Description; }; + struct TBlockStoreVolumeInfo : public TAtomicRefCount<TBlockStoreVolumeInfo> { + EKind Kind = KindUnknown; + NKikimrSchemeOp::TBlockStoreVolumeDescription Description; + }; + + struct TFileStoreInfo : public TAtomicRefCount<TFileStoreInfo> { + EKind Kind = KindUnknown; + NKikimrSchemeOp::TFileStoreDescription Description; + }; + struct TEntry { enum class ERequestType : ui8 { ByPath, @@ -270,6 +282,8 @@ struct TSchemeCacheNavigate { TIntrusiveConstPtr<TBlobDepotInfo> BlobDepotInfo; TIntrusiveConstPtr<TExternalTableInfo> ExternalTableInfo; TIntrusiveConstPtr<TExternalDataSourceInfo> ExternalDataSourceInfo; + TIntrusiveConstPtr<TBlockStoreVolumeInfo> BlockStoreVolumeInfo; + TIntrusiveConstPtr<TFileStoreInfo> FileStoreInfo; TString ToString() const; TString ToString(const NScheme::TTypeRegistry& typeRegistry) const; |