diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-18 12:57:52 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-21 09:18:49 +0200 |
commit | da1c86b80f230c3a2023f97c0048020a12e38de4 (patch) | |
tree | 922fd3ae8ae4feb0977f8e636f01f96073fb4de3 /common/datastorequery.cpp | |
parent | 71a0167e0216f84588b492c84e92667847fbe5a5 (diff) | |
download | sink-da1c86b80f230c3a2023f97c0048020a12e38de4.tar.gz sink-da1c86b80f230c3a2023f97c0048020a12e38de4.zip |
Removed EntityReader
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r-- | common/datastorequery.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index f56ac91..9f20ba9 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp | |||
@@ -298,7 +298,7 @@ public: | |||
298 | } | 298 | } |
299 | }; | 299 | }; |
300 | 300 | ||
301 | DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, EntityStore::Ptr store) | 301 | DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, EntityStore &store) |
302 | : mQuery(query), mType(type), mStore(store) | 302 | : mQuery(query), mType(type), mStore(store) |
303 | { | 303 | { |
304 | setupQuery(); | 304 | setupQuery(); |
@@ -306,12 +306,12 @@ DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, | |||
306 | 306 | ||
307 | void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback) | 307 | void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback) |
308 | { | 308 | { |
309 | mStore->readLatest(mType, key, resultCallback); | 309 | mStore.readLatest(mType, key, resultCallback); |
310 | } | 310 | } |
311 | 311 | ||
312 | QVector<QByteArray> DataStoreQuery::indexLookup(const QByteArray &property, const QVariant &value) | 312 | QVector<QByteArray> DataStoreQuery::indexLookup(const QByteArray &property, const QVariant &value) |
313 | { | 313 | { |
314 | return mStore->indexLookup(mType, property, value); | 314 | return mStore.indexLookup(mType, property, value); |
315 | } | 315 | } |
316 | 316 | ||
317 | /* ResultSet DataStoreQuery::filterAndSortSet(ResultSet &resultSet, const FilterFunction &filter, const QByteArray &sortProperty) */ | 317 | /* ResultSet DataStoreQuery::filterAndSortSet(ResultSet &resultSet, const FilterFunction &filter, const QByteArray &sortProperty) */ |
@@ -443,13 +443,13 @@ void DataStoreQuery::setupQuery() | |||
443 | } else { | 443 | } else { |
444 | QSet<QByteArray> appliedFilters; | 444 | QSet<QByteArray> appliedFilters; |
445 | 445 | ||
446 | auto resultSet = mStore->indexLookup(mType, mQuery, appliedFilters, appliedSorting); | 446 | auto resultSet = mStore.indexLookup(mType, mQuery, appliedFilters, appliedSorting); |
447 | remainingFilters = remainingFilters - appliedFilters; | 447 | remainingFilters = remainingFilters - appliedFilters; |
448 | 448 | ||
449 | // We do a full scan if there were no indexes available to create the initial set. | 449 | // We do a full scan if there were no indexes available to create the initial set. |
450 | if (appliedFilters.isEmpty()) { | 450 | if (appliedFilters.isEmpty()) { |
451 | // TODO this should be replaced by an index lookup on the uid index | 451 | // TODO this should be replaced by an index lookup on the uid index |
452 | mSource = Source::Ptr::create(mStore->fullScan(mType), this); | 452 | mSource = Source::Ptr::create(mStore.fullScan(mType), this); |
453 | } else { | 453 | } else { |
454 | mSource = Source::Ptr::create(resultSet, this); | 454 | mSource = Source::Ptr::create(resultSet, this); |
455 | } | 455 | } |
@@ -492,7 +492,7 @@ QVector<QByteArray> DataStoreQuery::loadIncrementalResultSet(qint64 baseRevision | |||
492 | { | 492 | { |
493 | auto revisionCounter = QSharedPointer<qint64>::create(baseRevision); | 493 | auto revisionCounter = QSharedPointer<qint64>::create(baseRevision); |
494 | QVector<QByteArray> changedKeys; | 494 | QVector<QByteArray> changedKeys; |
495 | mStore->readRevisions(baseRevision, mType, [&](const QByteArray &key) { | 495 | mStore.readRevisions(baseRevision, mType, [&](const QByteArray &key) { |
496 | changedKeys << key; | 496 | changedKeys << key; |
497 | }); | 497 | }); |
498 | SinkTrace() << "Finished reading incremental result set:" << *revisionCounter; | 498 | SinkTrace() << "Finished reading incremental result set:" << *revisionCounter; |