diff options
| author | imunkin <[email protected]> | 2025-11-01 17:03:42 +0300 |
|---|---|---|
| committer | imunkin <[email protected]> | 2025-11-01 17:35:36 +0300 |
| commit | 88d9d6cb14b1eae293c39eaac1aa039664533d31 (patch) | |
| tree | 1f7b0fa4d31801dedd6386568b966e4f225f1698 /yql/essentials/minikql/computation/mkql_computation_node_impl.cpp | |
| parent | b79fcb9b987466de687d3b9e7aff4bf8dd925faf (diff) | |
YQL-19526: Rename AddDependence method
commit_hash:49ed25bc5a1b69220ddb2b7d7f77fed76db606c9
Diffstat (limited to 'yql/essentials/minikql/computation/mkql_computation_node_impl.cpp')
| -rw-r--r-- | yql/essentials/minikql/computation/mkql_computation_node_impl.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp b/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp index 7ce89c1a688..2d601ad7acb 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp +++ b/yql/essentials/minikql/computation/mkql_computation_node_impl.cpp @@ -63,7 +63,7 @@ const IComputationNode* TUnboxedImmutableComputationNode::GetSource() const { return nullptr; } -IComputationNode* TUnboxedImmutableComputationNode::AddDependence(const IComputationNode*) { +IComputationNode* TUnboxedImmutableComputationNode::AddDependent(const IComputationNode*) { return nullptr; } @@ -78,12 +78,12 @@ void TUnboxedImmutableComputationNode::CollectDependentIndexes(const IComputatio THROW yexception() << "Failed to collect dependent indexes."; } -ui32 TUnboxedImmutableComputationNode::GetDependencyWeight() const { - THROW yexception() << "Can't get dependency weight from const node."; +ui32 TUnboxedImmutableComputationNode::GetDependentWeight() const { + THROW yexception() << "Can't get dependent weight from const node."; } -ui32 TUnboxedImmutableComputationNode::GetDependencesCount() const { - THROW yexception() << "Can't get dependences count from const node."; +ui32 TUnboxedImmutableComputationNode::GetDependentsCount() const { + THROW yexception() << "Can't get dependents count from const node."; } bool TUnboxedImmutableComputationNode::IsTemporaryValue() const { @@ -113,23 +113,23 @@ Y_NO_INLINE TStatefulComputationNodeBase::~TStatefulComputationNodeBase() { } -Y_NO_INLINE void TStatefulComputationNodeBase::AddDependenceImpl(const IComputationNode* node) { - Dependencies_.emplace_back(node); +Y_NO_INLINE void TStatefulComputationNodeBase::AddDependentImpl(const IComputationNode* node) { + Dependents_.emplace_back(node); } Y_NO_INLINE void TStatefulComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, bool stateless) const { + IComputationNode::TIndexesMap& dependents, bool stateless) const { if (self == owner) { return; } - if (const auto ins = dependencies.emplace(ValueIndex_, RepresentationKind_); ins.second) { - std::for_each(Dependencies_.cbegin(), Dependencies_.cend(), - std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, owner, std::ref(dependencies))); + if (const auto ins = dependents.emplace(ValueIndex_, RepresentationKind_); ins.second) { + std::for_each(Dependents_.cbegin(), Dependents_.cend(), + std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, owner, std::ref(dependents))); if (stateless) { - dependencies.erase(ins.first); + dependents.erase(ins.first); } } } @@ -142,12 +142,12 @@ Y_NO_INLINE TStatefulSourceComputationNodeBase::~TStatefulSourceComputationNodeB { } -Y_NO_INLINE void TStatefulSourceComputationNodeBase::PrepareStageOneImpl(const TConstComputationNodePtrVector& dependencies) { +Y_NO_INLINE void TStatefulSourceComputationNodeBase::PrepareStageOneImpl(const TConstComputationNodePtrVector& dependents) { if (!Stateless_) { Stateless_ = std::accumulate( - dependencies.cbegin(), dependencies.cend(), 0, + dependents.cbegin(), dependents.cend(), 0, std::bind(std::plus<i32>(), std::placeholders::_1, - std::bind(&IComputationNode::GetDependencyWeight, std::placeholders::_2))) <= 1; + std::bind(&IComputationNode::GetDependentWeight, std::placeholders::_2))) <= 1; } } @@ -166,9 +166,9 @@ TStatefulComputationNode<IComputationNodeInterface, SerializableState>::TStatefu } template <class IComputationNodeInterface, bool SerializableState> -IComputationNode* TStatefulComputationNode<IComputationNodeInterface, SerializableState>::AddDependence( +IComputationNode* TStatefulComputationNode<IComputationNodeInterface, SerializableState>::AddDependent( const IComputationNode* node) { - AddDependenceImpl(node); + AddDependentImpl(node); return this; } @@ -187,8 +187,8 @@ ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::Get } template <class IComputationNodeInterface, bool SerializableState> -ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetDependencesCount() const { - return Dependencies_.size(); +ui32 TStatefulComputationNode<IComputationNodeInterface, SerializableState>::GetDependentsCount() const { + return Dependents_.size(); } template class TStatefulComputationNode<IComputationNode, false>; @@ -205,14 +205,14 @@ Y_NO_INLINE ui32 TStatelessFlowComputationNodeBase::GetIndexImpl() const { Y_NO_INLINE void TStatelessFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } @@ -225,16 +225,16 @@ Y_NO_INLINE TStatefulFlowComputationNodeBase::TStatefulFlowComputationNodeBase(u Y_NO_INLINE void TStatefulFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } - const auto ins = dependencies.emplace(StateIndex_, StateKind_); + const auto ins = dependents.emplace(StateIndex_, StateKind_); if (ins.second) { for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } } @@ -250,17 +250,17 @@ Y_NO_INLINE TPairStateFlowComputationNodeBase::TPairStateFlowComputationNodeBase Y_NO_INLINE void TPairStateFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } - const auto ins1 = dependencies.emplace(StateIndex_, FirstKind_); - const auto ins2 = dependencies.emplace(StateIndex_ + 1U, SecondKind_); + const auto ins1 = dependents.emplace(StateIndex_, FirstKind_); + const auto ins2 = dependents.emplace(StateIndex_ + 1U, SecondKind_); if (ins1.second && ins2.second) { for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } } @@ -272,14 +272,14 @@ Y_NO_INLINE ui32 TStatelessWideFlowComputationNodeBase::GetIndexImpl() const { Y_NO_INLINE void TStatelessWideFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } @@ -301,16 +301,16 @@ Y_NO_INLINE TStatefulWideFlowComputationNodeBase::TStatefulWideFlowComputationNo Y_NO_INLINE void TStatefulWideFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } - const auto ins = dependencies.emplace(StateIndex_, StateKind_); + const auto ins = dependents.emplace(StateIndex_, StateKind_); if (ins.second) { for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } } @@ -325,16 +325,16 @@ Y_NO_INLINE TPairStateWideFlowComputationNodeBase::TPairStateWideFlowComputation Y_NO_INLINE void TPairStateWideFlowComputationNodeBase::CollectDependentIndexesImpl( const IComputationNode* self, const IComputationNode* owner, - IComputationNode::TIndexesMap& dependencies, const TConstComputationNodePtrVector& dependences) const { + IComputationNode::TIndexesMap& dependents, const TConstComputationNodePtrVector& dependences) const { if (self == owner) { return; } - const auto ins1 = dependencies.emplace(StateIndex_, FirstKind_); - const auto ins2 = dependencies.emplace(StateIndex_ + 1U, SecondKind_); + const auto ins1 = dependents.emplace(StateIndex_, FirstKind_); + const auto ins2 = dependents.emplace(StateIndex_ + 1U, SecondKind_); if (ins1.second && ins2.second) { for (auto& dependence : dependences) { - dependence->CollectDependentIndexes(owner, dependencies); + dependence->CollectDependentIndexes(owner, dependents); } } } @@ -406,25 +406,25 @@ void TExternalComputationNode::SetOwner(const IComputationNode* owner) { } void TExternalComputationNode::PrepareStageOne() { - std::sort(Dependencies_.begin(), Dependencies_.end()); - Dependencies_.erase(std::unique(Dependencies_.begin(), Dependencies_.end()), Dependencies_.cend()); - if (const auto it = std::find(Dependencies_.cbegin(), Dependencies_.cend(), Owner_); Dependencies_.cend() != it) { - Dependencies_.erase(it); + std::sort(Dependents_.begin(), Dependents_.end()); + Dependents_.erase(std::unique(Dependents_.begin(), Dependents_.end()), Dependents_.cend()); + if (const auto it = std::find(Dependents_.cbegin(), Dependents_.cend(), Owner_); Dependents_.cend() != it) { + Dependents_.erase(it); } } void TExternalComputationNode::PrepareStageTwo() { - TIndexesMap dependencies; - std::for_each(Dependencies_.cbegin(), Dependencies_.cend(), - std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner_, std::ref(dependencies))); - InvalidationSet_.assign(dependencies.cbegin(), dependencies.cend()); + TIndexesMap dependents; + std::for_each(Dependents_.cbegin(), Dependents_.cend(), + std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner_, std::ref(dependents))); + InvalidationSet_.assign(dependents.cbegin(), dependents.cend()); } const IComputationNode* TExternalComputationNode::GetSource() const { return nullptr; } -ui32 TExternalComputationNode::GetDependencyWeight() const { +ui32 TExternalComputationNode::GetDependentWeight() const { return 0U; } @@ -678,16 +678,16 @@ ui32 TWideFlowProxyComputationNode::GetIndex() const { THROW yexception() << "Failed to get proxy node index."; } -ui32 TWideFlowProxyComputationNode::GetDependencyWeight() const { - THROW yexception() << "Failed to get dependency weight."; +ui32 TWideFlowProxyComputationNode::GetDependentWeight() const { + THROW yexception() << "Failed to get dependent weight."; } -ui32 TWideFlowProxyComputationNode::GetDependencesCount() const { - return Dependences_.size(); +ui32 TWideFlowProxyComputationNode::GetDependentsCount() const { + return Dependents_.size(); } -IComputationNode* TWideFlowProxyComputationNode::AddDependence(const IComputationNode* node) { - Dependences_.push_back(node); +IComputationNode* TWideFlowProxyComputationNode::AddDependent(const IComputationNode* node) { + Dependents_.push_back(node); return this; } @@ -703,18 +703,18 @@ void TWideFlowProxyComputationNode::RegisterDependencies() const { } void TWideFlowProxyComputationNode::PrepareStageOne() { - std::sort(Dependences_.begin(), Dependences_.end()); - Dependences_.erase(std::unique(Dependences_.begin(), Dependences_.end()), Dependences_.cend()); - if (const auto it = std::find(Dependences_.cbegin(), Dependences_.cend(), Owner_); Dependences_.cend() != it) { - Dependences_.erase(it); + std::sort(Dependents_.begin(), Dependents_.end()); + Dependents_.erase(std::unique(Dependents_.begin(), Dependents_.end()), Dependents_.cend()); + if (const auto it = std::find(Dependents_.cbegin(), Dependents_.cend(), Owner_); Dependents_.cend() != it) { + Dependents_.erase(it); } } void TWideFlowProxyComputationNode::PrepareStageTwo() { - TIndexesMap dependencies; - std::for_each(Dependences_.cbegin(), Dependences_.cend(), - std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner_, std::ref(dependencies))); - InvalidationSet_.assign(dependencies.cbegin(), dependencies.cend()); + TIndexesMap dependents; + std::for_each(Dependents_.cbegin(), Dependents_.cend(), + std::bind(&IComputationNode::CollectDependentIndexes, std::placeholders::_1, Owner_, std::ref(dependents))); + InvalidationSet_.assign(dependents.cbegin(), dependents.cend()); } void TWideFlowProxyComputationNode::SetOwner(const IComputationNode* owner) { |
