From 4f446ddc9c6c5cd539e0bc22a75a580e845f7fe6 Mon Sep 17 00:00:00 2001 From: madschemas <155993105+MadSchemas@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:09:00 +0300 Subject: [PATCH] even less logs... --- cpp_src/cluster/clusterizator.cc | 8 ++-- cpp_src/core/namespace/namespace.h | 42 ++++++++++---------- cpp_src/core/namespace/namespaceimpl.cc | 24 +++++------ cpp_src/core/reindexer_impl/reindexerimpl.cc | 8 ++-- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cpp_src/cluster/clusterizator.cc b/cpp_src/cluster/clusterizator.cc index f6faa0da6..44d928da0 100644 --- a/cpp_src/cluster/clusterizator.cc +++ b/cpp_src/cluster/clusterizator.cc @@ -124,11 +124,11 @@ Error Clusterizator::Replicate(UpdatesContainer&& recs, std::function be std::pair res; if (ctx.GetOriginLSN().isEmpty()) { - auto recsCnt = recs.size(); - std::cout << fmt::sprintf("Clusterizator::'%s' pushing %d records into queue\n", recs[0].GetNsName(), recsCnt); + //auto recsCnt = recs.size(); + //std::cout << fmt::sprintf("Clusterizator::'%s' pushing %d records into queue\n", recs[0].GetNsName(), recsCnt); res = updatesQueue_.Push(std::move(recs), std::move(beforeWaitF), ctx); - std::cout << fmt::sprintf("Clusterizator::'%s' replicated %d records. Result: %s\n", recs[0].GetNsName(), recsCnt, - res.first.ok() ? "OK" : res.first.what()); + //std::cout << fmt::sprintf("Clusterizator::'%s' replicated %d records. Result: %s\n", recs[0].GetNsName(), recsCnt, + // res.first.ok() ? "OK" : res.first.what()); } else { // Update can't be replicated to cluster from another node, so may only be replicated to async replicas res = updatesQueue_.PushAsync(std::move(recs)); diff --git a/cpp_src/core/namespace/namespace.h b/cpp_src/core/namespace/namespace.h index 70a551d0d..5afa8fe85 100644 --- a/cpp_src/core/namespace/namespace.h +++ b/cpp_src/core/namespace/namespace.h @@ -54,10 +54,10 @@ class Namespace { CounterGuardAIR32 cg(ns->cancelCommitCnt_); if constexpr (std::is_same_v) { - auto name = GetName(ctx); - if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' begin\n", name); - } + // auto name = GetName(ctx); + // if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' begin\n", name); + // } auto wlck = ns->dataWLock(nsCtx.rdxContext); cg.Reset(); qr.AddNamespace(ns, true); @@ -65,9 +65,9 @@ class Namespace { (*ns.*fn)(v, enumVal, pendedRepl, nsCtx); qr.AddItem(v, true, false); ns->replicate(std::move(pendedRepl), std::move(wlck), true, nullptr, nsCtx); - if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' done\n", name); - } + // if (enumVal == ModeUpsert && !isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(qr) into '%s' done\n", name); + // } } else { auto params = longUpdDelLoggingParams_.load(std::memory_order_relaxed); const bool isEnabled = params.thresholdUs >= 0 && !isSystemNamespaceNameFast(v.NsName()); @@ -135,24 +135,24 @@ class Namespace { nsFuncWrapper<&NamespaceImpl::doUpdate, QueryType::QueryUpdate>(query, result, ctx); } void Upsert(Item &item, const RdxContext &ctx) { - auto name = GetName(ctx); - if (!isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' begin\n", name); - } + //auto name = GetName(ctx); + //if (!isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' begin\n", name); + //} nsFuncWrapper<&NamespaceImpl::Upsert>(item, ctx); - if (!isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' done\n", name); - } + // if (!isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("Namespace::Upsert(...) into '%s' done\n", name); + // } } void Upsert(Item &item, LocalQueryResults &qr, const RdxContext &ctx) { - auto name = GetName(ctx); - if (!isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' begin\n", name); - } + // auto name = GetName(ctx); + // if (!isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' begin\n", name); + // } nsFuncWrapper<&NamespaceImpl::modifyItem, ItemModifyMode::ModeUpsert>(item, qr, ctx); - if (!isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' done\n", name); - } + // if (!isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("Namespace::Upsert(qr) into '%s' done\n", name); + // } } void Delete(Item &item, const RdxContext &ctx) { nsFuncWrapper<&NamespaceImpl::Delete>(item, ctx); } void Delete(Item &item, LocalQueryResults &qr, const RdxContext &ctx) { diff --git a/cpp_src/core/namespace/namespaceimpl.cc b/cpp_src/core/namespace/namespaceimpl.cc index f5acacd6d..4bb1f3378 100644 --- a/cpp_src/core/namespace/namespaceimpl.cc +++ b/cpp_src/core/namespace/namespaceimpl.cc @@ -1478,18 +1478,18 @@ void NamespaceImpl::doTruncate(UpdatesContainer& pendedRepl, const NsContext& ct } void NamespaceImpl::ModifyItem(Item& item, ItemModifyMode mode, const RdxContext& ctx) { - auto name = GetName(ctx); - if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' begin\n", wal_.GetServer(), name); - } + //sauto name = GetName(ctx); + //if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' begin\n", wal_.GetServer(), name); + //} PerfStatCalculatorMT calc(updatePerfCounter_, enablePerfCounters_); UpdatesContainer pendedRepl; CounterGuardAIR32 cg(cancelCommitCnt_); auto wlck = dataWLock(ctx); - if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' locked\n", wal_.GetServer(), name); + if (mode == ModeUpsert && !isSystemNamespaceNameFast(name_)) { + std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' locked\n", wal_.GetServer(), name_); } cg.Reset(); calc.LockHit(); @@ -1498,14 +1498,14 @@ void NamespaceImpl::ModifyItem(Item& item, ItemModifyMode mode, const RdxContext } modifyItem(item, mode, pendedRepl, NsContext(ctx)); - if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' replicate call with %d recs\n", wal_.GetServer(), name, - pendedRepl.size()); - } + //if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { + // std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' replicate call with %d recs\n", wal_.GetServer(), name, + // pendedRepl.size()); + //} replicate(std::move(pendedRepl), std::move(wlck), true, nullptr, ctx); - if (mode == ModeUpsert && !isSystemNamespaceNameFast(name)) { - std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' end\n", wal_.GetServer(), name); + if (mode == ModeUpsert && !isSystemNamespaceNameFast(name_)) { + std::cout << fmt::sprintf("NamespaceImpl::ModifyItem(...) into %d:'%s' end\n", wal_.GetServer(), name_); } } diff --git a/cpp_src/core/reindexer_impl/reindexerimpl.cc b/cpp_src/core/reindexer_impl/reindexerimpl.cc index b018eab0d..387e99976 100644 --- a/cpp_src/core/reindexer_impl/reindexerimpl.cc +++ b/cpp_src/core/reindexer_impl/reindexerimpl.cc @@ -973,16 +973,16 @@ Error ReindexerImpl::Update(const Query& q, LocalQueryResults& result, const Rdx } Error ReindexerImpl::Upsert(std::string_view nsName, Item& item, const RdxContext& ctx) { - std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' begin\n", nsName); + //std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' begin\n", nsName); auto res = APPLY_NS_FUNCTION11(true, Upsert, item); - std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' done\n", nsName); + //std::cout << fmt::sprintf("ReindexerImpl::Upsert(...) into '%s' done\n", nsName); return res; } Error ReindexerImpl::Upsert(std::string_view nsName, Item& item, LocalQueryResults& qr, const RdxContext& ctx) { - std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' begin\n", nsName); + //std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' begin\n", nsName); auto res = APPLY_NS_FUNCTION22(true, Upsert, item, qr); - std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' done\n", nsName); + //std::cout << fmt::sprintf("ReindexerImpl::Upsert(qr) into '%s' done\n", nsName); return res; }