diff options
author | haposik <haposik@yandex-team.ru> | 2022-02-10 16:50:37 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:37 +0300 |
commit | f28ae3e2752def3bd0a14422be2a0b22ab434b9c (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | 8ae61e4a3dbd76284bc0d997975a50d6df18d448 (diff) | |
download | ydb-f28ae3e2752def3bd0a14422be2a0b22ab434b9c.tar.gz |
Restoring authorship annotation for <haposik@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | library/cpp/actors/core/mailbox.h | 2 | ||||
-rw-r--r-- | library/cpp/containers/stack_vector/stack_vec.h | 46 | ||||
-rw-r--r-- | library/cpp/containers/stack_vector/stack_vec_ut.cpp | 62 | ||||
-rw-r--r-- | ydb/core/driver_lib/run/kikimr_services_initializers.cpp | 2 | ||||
-rw-r--r-- | ydb/core/mon_alloc/monitor.cpp | 80 | ||||
-rw-r--r-- | ydb/core/protos/services.proto | 2 | ||||
-rw-r--r-- | ydb/core/testlib/basics/helpers.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp | 14 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard_info_types.h | 10 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/ut_filestore_reboots.cpp | 2 |
10 files changed, 111 insertions, 111 deletions
diff --git a/library/cpp/actors/core/mailbox.h b/library/cpp/actors/core/mailbox.h index b4fe57a6c3..0bd9c4d314 100644 --- a/library/cpp/actors/core/mailbox.h +++ b/library/cpp/actors/core/mailbox.h @@ -178,7 +178,7 @@ namespace NActors { mp->emplace(ActorsInfo.Array.ActorsArray->Actors[i].ActorId, ActorsInfo.Array.ActorsArray->Actors[i].Actor); } mp->emplace(localActorId, actor); - ActorPack = TMailboxActorPack::Map; + ActorPack = TMailboxActorPack::Map; ActorsInfo.Array.ActorsCount = 0; delete ActorsInfo.Array.ActorsArray; ActorsInfo.Map.ActorsMap = mp; diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h index 48032584e4..fcc5d9a2a5 100644 --- a/library/cpp/containers/stack_vector/stack_vec.h +++ b/library/cpp/containers/stack_vector/stack_vec.h @@ -45,18 +45,18 @@ namespace NPrivate { }; public: - TStackBasedAllocator() = default; - - template < - typename... TArgs, - typename = std::enable_if_t< - std::is_constructible_v<Alloc, TArgs...> - > - > - TStackBasedAllocator(TArgs&&... args) - : Alloc(std::forward<TArgs>(args)...) - {} - + TStackBasedAllocator() = default; + + template < + typename... TArgs, + typename = std::enable_if_t< + std::is_constructible_v<Alloc, TArgs...> + > + > + TStackBasedAllocator(TArgs&&... args) + : Alloc(std::forward<TArgs>(args)...) + {} + T* allocate(size_type n) { if (!IsStorageUsed && CountOnStack >= n) { IsStorageUsed = true; @@ -95,7 +95,7 @@ template <typename T, size_t CountOnStack, bool UseFallbackAlloc, class Alloc> class TStackVec: public TVector<T, ::NPrivate::TStackBasedAllocator<T, CountOnStack, UseFallbackAlloc, TReboundAllocator<Alloc, T>>> { private: using TBase = TVector<T, ::NPrivate::TStackBasedAllocator<T, CountOnStack, UseFallbackAlloc, TReboundAllocator<Alloc, T>>>; - using TAllocator = typename TBase::allocator_type; + using TAllocator = typename TBase::allocator_type; public: using typename TBase::const_iterator; @@ -106,14 +106,14 @@ public: using typename TBase::value_type; public: - TStackVec(const TAllocator& alloc = TAllocator()) - : TBase(alloc) + TStackVec(const TAllocator& alloc = TAllocator()) + : TBase(alloc) { TBase::reserve(CountOnStack); } - explicit TStackVec(size_type count, const TAllocator& alloc = TAllocator()) - : TBase(alloc) + explicit TStackVec(size_type count, const TAllocator& alloc = TAllocator()) + : TBase(alloc) { if (count <= CountOnStack) { TBase::reserve(CountOnStack); @@ -121,8 +121,8 @@ public: TBase::resize(count); } - TStackVec(size_type count, const T& val, const TAllocator& alloc = TAllocator()) - : TBase(alloc) + TStackVec(size_type count, const T& val, const TAllocator& alloc = TAllocator()) + : TBase(alloc) { if (count <= CountOnStack) { TBase::reserve(CountOnStack); @@ -141,14 +141,14 @@ public: { } - TStackVec(std::initializer_list<T> il, const TAllocator& alloc = TAllocator()) - : TStackVec(il.begin(), il.end(), alloc) + TStackVec(std::initializer_list<T> il, const TAllocator& alloc = TAllocator()) + : TStackVec(il.begin(), il.end(), alloc) { } template <class TIter> - TStackVec(TIter first, TIter last, const TAllocator& alloc = TAllocator()) - : TBase(alloc) + TStackVec(TIter first, TIter last, const TAllocator& alloc = TAllocator()) + : TBase(alloc) { // NB(eeight) Since we want to call 'reserve' here, we cannot just delegate to TVector ctor. // The best way to insert values afterwards is to call TVector::insert. However there is a caveat. diff --git a/library/cpp/containers/stack_vector/stack_vec_ut.cpp b/library/cpp/containers/stack_vector/stack_vec_ut.cpp index 85c25f21c0..19f9677781 100644 --- a/library/cpp/containers/stack_vector/stack_vec_ut.cpp +++ b/library/cpp/containers/stack_vector/stack_vec_ut.cpp @@ -19,28 +19,28 @@ namespace { char Junk[JunkPayloadSize]{sizeof(T)}; }; - - template <class T> - struct TStatefulAlloc: public std::allocator<T> { - using TBase = std::allocator<T>; - - template <class U> - struct rebind { - using other = TStatefulAlloc<U>; - }; - - TStatefulAlloc(size_t* allocCount) - : AllocCount(allocCount) - {} - - size_t* AllocCount; - - T* allocate(size_t n) - { - *AllocCount += 1; - return TBase::allocate(n); - } - }; + + template <class T> + struct TStatefulAlloc: public std::allocator<T> { + using TBase = std::allocator<T>; + + template <class U> + struct rebind { + using other = TStatefulAlloc<U>; + }; + + TStatefulAlloc(size_t* allocCount) + : AllocCount(allocCount) + {} + + size_t* AllocCount; + + T* allocate(size_t n) + { + *AllocCount += 1; + return TBase::allocate(n); + } + }; } Y_UNIT_TEST_SUITE(TStackBasedVectorTest) { @@ -132,13 +132,13 @@ Y_UNIT_TEST_SUITE(TStackBasedVectorTest) { using TVec = TStackVec<size_t, 1, true, TThickAlloc<size_t, n>>; UNIT_ASSERT_LT(sizeof(TVec), 1.5 * n); } - - Y_UNIT_TEST(TestStatefulAlloc) { - size_t count = 0; - TStackVec<size_t, 1, true, TStatefulAlloc<size_t>> vec{{ &count }}; - for (size_t i = 0; i < 5; ++i) { - vec.push_back(1); - } - UNIT_ASSERT_VALUES_EQUAL(count, 3); - } + + Y_UNIT_TEST(TestStatefulAlloc) { + size_t count = 0; + TStackVec<size_t, 1, true, TStatefulAlloc<size_t>> vec{{ &count }}; + for (size_t i = 0; i < 5; ++i) { + vec.push_back(1); + } + UNIT_ASSERT_VALUES_EQUAL(count, 3); + } } diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index 8a3008b315..819c1478d1 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -1138,7 +1138,7 @@ void TRestartsCountPublisher::InitializeServices( if (Config.HasRestartsCountConfig()) { const auto& restartsCountConfig = Config.GetRestartsCountConfig(); if (restartsCountConfig.HasRestartsCountFile()) { - PublishRestartsCount(utilsCounters->GetCounter("RestartsCount", false), restartsCountConfig.GetRestartsCountFile()); + PublishRestartsCount(utilsCounters->GetCounter("RestartsCount", false), restartsCountConfig.GetRestartsCountFile()); } } } diff --git a/ydb/core/mon_alloc/monitor.cpp b/ydb/core/mon_alloc/monitor.cpp index 7d2ef0c28d..8afc7852c9 100644 --- a/ydb/core/mon_alloc/monitor.cpp +++ b/ydb/core/mon_alloc/monitor.cpp @@ -45,21 +45,21 @@ namespace NKikimr { TMemCounters Total; }; - struct TTagStats { - struct TBucket { - ui64 Count = 0; - ui64 Size = 0; - - void Update(ui64 count, ui64 size) { - Count += count; - Size += size; - } - }; - - TVector<TBucket> Buckets; - TBucket Total; - }; - + struct TTagStats { + struct TBucket { + ui64 Count = 0; + ui64 Size = 0; + + void Update(ui64 count, ui64 size) { + Count += count; + Size += size; + } + }; + + TVector<TBucket> Buckets; + TBucket Total; + }; + private: TDynamicCountersPtr CounterGroup; @@ -77,11 +77,11 @@ namespace NKikimr { int numSizes = 0; auto info = NAllocDbg::GetPerTagAllocInfo(true, maxTag, numSizes); - THashMap<TString, TTagStats> stats; + THashMap<TString, TTagStats> stats; + + auto& totalStats = stats["total"]; + totalStats.Buckets.resize(numSizes); - auto& totalStats = stats["total"]; - totalStats.Buckets.resize(numSizes); - // enumerate through all memory tags for (int tag = 0; tag < maxTag; ++tag) { auto tagName = NProfiling::GetTag(tag); @@ -89,8 +89,8 @@ namespace NKikimr { tagName = "__DEFAULT__"; } - auto& tagStats = stats[tagName]; - tagStats.Buckets.resize(numSizes); + auto& tagStats = stats[tagName]; + tagStats.Buckets.resize(numSizes); // enumerate through all sizes of objects for (int sizeIdx = 0; sizeIdx < numSizes; ++sizeIdx) { @@ -99,16 +99,16 @@ namespace NKikimr { continue; } - tagStats.Buckets[sizeIdx].Update(entry.Count, entry.Size); - tagStats.Total.Update(entry.Count, entry.Size); + tagStats.Buckets[sizeIdx].Update(entry.Count, entry.Size); + tagStats.Total.Update(entry.Count, entry.Size); - totalStats.Buckets[sizeIdx].Update(entry.Count, entry.Size); - totalStats.Total.Update(entry.Count, entry.Size); + totalStats.Buckets[sizeIdx].Update(entry.Count, entry.Size); + totalStats.Total.Update(entry.Count, entry.Size); } - } + } - // update counters - for (const auto& [tagName, tagStats] : stats) { + // update counters + for (const auto& [tagName, tagStats] : stats) { const auto& total = tagStats.Total; TPerTagCounters& perTag = PerTag[tagName]; @@ -117,30 +117,30 @@ namespace NKikimr { continue; } - auto tagCounters = CounterGroup->GetSubgroup("tag", tagName); + auto tagCounters = CounterGroup->GetSubgroup("tag", tagName); if (!perTag.Total.Count) { perTag.Total.Init(tagCounters->GetSubgroup("bucket", "total")); } - perTag.Total.Set(total.Count, total.Size); + perTag.Total.Set(total.Count, total.Size); + + for (int sizeIdx = 0; sizeIdx < numSizes; ++sizeIdx) { + const auto sizeName = ToString(sizeIdx); - for (int sizeIdx = 0; sizeIdx < numSizes; ++sizeIdx) { - const auto sizeName = ToString(sizeIdx); - const auto& bucket = tagStats.Buckets[sizeIdx]; - TMemCounters& bySize = perTag.BySize[sizeName]; + TMemCounters& bySize = perTag.BySize[sizeName]; if (bucket.Count == 0 && bucket.Size == 0 && !bySize.Count) { // Skip the bucket that didn't have any allocations so far continue; } - if (!bySize.Count) { - bySize.Init(tagCounters->GetSubgroup("bucket", sizeName)); - } - - bySize.Set(bucket.Count, bucket.Size); - } + if (!bySize.Count) { + bySize.Init(tagCounters->GetSubgroup("bucket", sizeName)); + } + + bySize.Set(bucket.Count, bucket.Size); + } } #endif } diff --git a/ydb/core/protos/services.proto b/ydb/core/protos/services.proto index 92890f0aa2..c17c8a7dc3 100644 --- a/ydb/core/protos/services.proto +++ b/ydb/core/protos/services.proto @@ -848,7 +848,7 @@ message TActivity { YQL_PRIVATE_WRITE_TASK_ACTOR = 542; YQL_NODES_MANAGER_ACTOR = 543; KESUS_ACCOUNTING_ACTOR = 544; - BLOCKSTORE_PARTITION_COMMON = 545; + BLOCKSTORE_PARTITION_COMMON = 545; INTERCONNECT_PROXY_WRAPPER = 546; CLOUD_STORAGE_HIVE_PROXY = 547; YQL_PRIVATE_NODES_HEALTH_CHECK_ACTOR = 548; diff --git a/ydb/core/testlib/basics/helpers.cpp b/ydb/core/testlib/basics/helpers.cpp index 7035ff54e2..259e4f9da9 100644 --- a/ydb/core/testlib/basics/helpers.cpp +++ b/ydb/core/testlib/basics/helpers.cpp @@ -11,7 +11,7 @@ namespace NKikimr { x->TabletID = tabletId; x->TabletType = tabletType; - x->Channels.resize(5); + x->Channels.resize(5); for (ui64 channel = 0; channel < x->Channels.size(); ++channel) { x->Channels[channel].Channel = channel; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp index 443c242803..ee2a3fb3e5 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_fs.cpp @@ -245,14 +245,14 @@ public: private: TTxState::ETxState NextState() { - return TTxState::CreateParts; + return TTxState::CreateParts; } TTxState::ETxState NextState(TTxState::ETxState state) { switch(state) { case TTxState::Waiting: - case TTxState::CreateParts: - return TTxState::ConfigureParts; + case TTxState::CreateParts: + return TTxState::ConfigureParts; case TTxState::ConfigureParts: return TTxState::Propose; default: @@ -264,8 +264,8 @@ private: TSubOperationState::TPtr SelectStateFunc(TTxState::ETxState state) { switch(state) { case TTxState::Waiting: - case TTxState::CreateParts: - return MakeHolder<TCreateParts>(OperationId); + case TTxState::CreateParts: + return MakeHolder<TCreateParts>(OperationId); case TTxState::ConfigureParts: return MakeHolder<TConfigureParts>(OperationId); case TTxState::Propose: @@ -454,7 +454,7 @@ TTxState& TAlterFileStore::PrepareChanges( item->PathState = TPathElement::EPathState::EPathStateAlter; TTxState& txState = context.SS->CreateTx(OperationId, TTxState::TxAlterFileStore, item->PathId); - txState.State = TTxState::CreateParts; + txState.State = TTxState::CreateParts; ApplyChannelBindings( fs, @@ -469,7 +469,7 @@ TTxState& TAlterFileStore::PrepareChanges( Y_VERIFY(context.SS->ShardInfos.contains(shardIdx)); auto& shardInfo = context.SS->ShardInfos[shardIdx]; Y_VERIFY(shardInfo.TabletID == tabletId); - txState.Shards.emplace_back(shardIdx, ETabletType::FileStore, TTxState::CreateParts); + txState.Shards.emplace_back(shardIdx, ETabletType::FileStore, TTxState::CreateParts); shardInfo.CurrentTxId = operationId.GetTxId(); context.SS->PersistShardTx(db, shardIdx, operationId.GetTxId()); } diff --git a/ydb/core/tx/schemeshard/schemeshard_info_types.h b/ydb/core/tx/schemeshard/schemeshard_info_types.h index dea9a7a292..2e5710c3d3 100644 --- a/ydb/core/tx/schemeshard/schemeshard_info_types.h +++ b/ydb/core/tx/schemeshard/schemeshard_info_types.h @@ -1842,7 +1842,7 @@ struct TBlockStoreVolumeInfo : public TSimpleRefCount<TBlockStoreVolumeInfo> { TVector<TTabletId> Tablets; }; - static constexpr size_t NumVolumeTabletChannels = 3; + static constexpr size_t NumVolumeTabletChannels = 3; ui32 DefaultPartitionCount = 0; NKikimrBlockStore::TVolumeConfig VolumeConfig; @@ -2001,11 +2001,11 @@ struct TFileStoreInfo : public TSimpleRefCount<TFileStoreInfo> { Y_VERIFY(!AlterVersion); AlterConfig = MakeHolder<NKikimrFileStore::TConfig>(); - AlterConfig->CopyFrom(alterConfig); + AlterConfig->CopyFrom(alterConfig); + + Y_VERIFY(!AlterConfig->GetBlockSize()); + AlterConfig->SetBlockSize(Config.GetBlockSize()); - Y_VERIFY(!AlterConfig->GetBlockSize()); - AlterConfig->SetBlockSize(Config.GetBlockSize()); - AlterVersion = Version + 1; } diff --git a/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp b/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp index 49a6fe430f..0fdfd871de 100644 --- a/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_filestore_reboots.cpp @@ -190,7 +190,7 @@ Y_UNIT_TEST_SUITE(TFileStoreWithReboots) { {NLs::PathNotExist}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(7), + {NLs::PathVersionEqual(7), NLs::PathsInsideDomain(1), NLs::ShardsInsideDomain(0)}); } |