From 1ff4456e5dc2b9a9dfa80047f9e5a4a9e1395cdf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 18 Jun 2018 14:18:00 +0200 Subject: Debug output --- common/datastorequery.cpp | 5 +++++ common/typeindex.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index f1b0ed2..12c0ae1 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp @@ -232,6 +232,7 @@ public: void updateComplete() Q_DECL_OVERRIDE { + SinkTraceCtx(mDatastore->mLogCtx) << "Reduction update is complete."; mIncrementallyReducedValues.clear(); } @@ -317,6 +318,7 @@ public: } }(); if (reductionValue.isNull()) { + SinkTraceCtx(mDatastore->mLogCtx) << "No reduction value: " << result.entity.identifier(); //We failed to find a value to reduce on, so ignore this entity. //Can happen if the entity was already removed and we have no previous revision. return; @@ -325,6 +327,7 @@ public: if (!mReducedValues.contains(reductionValueBa)) { //Only reduce every value once. mReducedValues.insert(reductionValueBa); + SinkTraceCtx(mDatastore->mLogCtx) << "Reducing new value: " << result.entity.identifier() << reductionValueBa; auto reductionResult = reduceOnValue(reductionValue); //This can happen if we get a removal message from a filtered entity and all entites of the reduction are filtered. @@ -341,11 +344,13 @@ public: //During updates adjust the reduction according to the modification/addition or removal //We have to redo the reduction for every element, because of the aggregation values. if (mIncremental && !mIncrementallyReducedValues.contains(reductionValueBa)) { + SinkTraceCtx(mDatastore->mLogCtx) << "Incremental reduction update: " << result.entity.identifier() << reductionValueBa; mIncrementallyReducedValues.insert(reductionValueBa); //Redo the reduction to find new aggregated values auto selectionResult = reduceOnValue(reductionValue); auto oldSelectionResult = mSelectedValues.take(reductionValueBa); + SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection; //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered) if (oldSelectionResult.isEmpty()) { return; diff --git a/common/typeindex.cpp b/common/typeindex.cpp index a111134..41821cb 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp @@ -380,7 +380,7 @@ QVector TypeIndex::lookup(const QByteArray &property, const QVariant const auto lookupKey = getByteArray(value); index.lookup( lookupKey, [&](const QByteArray &value) { secondaryKeys << value; }, [property](const Index::Error &error) { SinkWarning() << "Error in index: " << error.message << property; }); - SinkTraceCtx(mLogCtx) << "Looked up secondary keys: " << secondaryKeys; + SinkTraceCtx(mLogCtx) << "Looked up secondary keys for the following lookup key: " << lookupKey << " => " << secondaryKeys; for (const auto &secondary : secondaryKeys) { keys += lookup(resultProperty, secondary, transaction); } -- cgit v1.2.3