diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 22:06:12 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-22 11:32:53 +0100 |
commit | 86045e308c10c60cd7c4339d305cee1acb084760 (patch) | |
tree | b8fd3e91ffbdeb8ad2e78a61fe1d3426eb5874be /common/queryrunner.h | |
parent | daf96f7efec0538e161eab8e906a291015842e1e (diff) | |
download | sink-86045e308c10c60cd7c4339d305cee1acb084760.tar.gz sink-86045e308c10c60cd7c4339d305cee1acb084760.zip |
Maintain the query state instead of using the offset.
Instead of using the offset to skip over old results requires
recalculating them, and resulted in some cases in results being added
multiple times to the model.
By just maintaining the state we can apply the offset directly to the
base-set, and maintain the state in reduction etc. which is necessary to
continue streaming results while making sure we don't report anything
twice.
Diffstat (limited to 'common/queryrunner.h')
-rw-r--r-- | common/queryrunner.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/queryrunner.h b/common/queryrunner.h index f5c7ead..5308eac 100644 --- a/common/queryrunner.h +++ b/common/queryrunner.h | |||
@@ -98,11 +98,10 @@ private: | |||
98 | QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess; | 98 | QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess; |
99 | QSharedPointer<Sink::ResultProvider<typename DomainType::Ptr>> mResultProvider; | 99 | QSharedPointer<Sink::ResultProvider<typename DomainType::Ptr>> mResultProvider; |
100 | ResultTransformation mResultTransformation; | 100 | ResultTransformation mResultTransformation; |
101 | QHash<QByteArray, qint64> mOffset; | 101 | QHash<QByteArray, DataStoreQuery::State::Ptr> mQueryState; |
102 | int mBatchSize; | 102 | int mBatchSize; |
103 | QObject guard; | 103 | QObject guard; |
104 | Sink::Log::Context mLogCtx; | 104 | Sink::Log::Context mLogCtx; |
105 | DataStoreQuery::State::Ptr mQueryState; | ||
106 | bool mInitialQueryComplete = false; | 105 | bool mInitialQueryComplete = false; |
107 | bool mQueryInProgress = false; | 106 | bool mQueryInProgress = false; |
108 | }; | 107 | }; |