diff --git a/arangod/RocksDBEngine/RocksDBCollection.cpp b/arangod/RocksDBEngine/RocksDBCollection.cpp index 6d359316ef..e7fa8191d3 100644 --- a/arangod/RocksDBEngine/RocksDBCollection.cpp +++ b/arangod/RocksDBEngine/RocksDBCollection.cpp @@ -1176,7 +1176,7 @@ RocksDBOperationResult RocksDBCollection::removeDocument( /// @brief looks up a document by key, low level worker /// the key must be a string slice, no revision check is performed RocksDBOperationResult RocksDBCollection::lookupDocument( - transaction::Methods* trx, VPackSlice key, ManagedDocumentResult& mdr) { + transaction::Methods* trx, VPackSlice key, ManagedDocumentResult& mdr) const { RocksDBOperationResult res; if (!key.isString()) { res.reset(TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD); @@ -1228,7 +1228,7 @@ Result RocksDBCollection::lookupDocumentToken(transaction::Methods* trx, arangodb::Result RocksDBCollection::lookupRevisionVPack( TRI_voc_rid_t revisionId, transaction::Methods* trx, - arangodb::ManagedDocumentResult& mdr) { + arangodb::ManagedDocumentResult& mdr) const { TRI_ASSERT(trx->state()->isRunning()); TRI_ASSERT(_objectId != 0); diff --git a/arangod/RocksDBEngine/RocksDBCollection.h b/arangod/RocksDBEngine/RocksDBCollection.h index dfc759cdf3..7d98bfb479 100644 --- a/arangod/RocksDBEngine/RocksDBCollection.h +++ b/arangod/RocksDBEngine/RocksDBCollection.h @@ -212,7 +212,7 @@ class RocksDBCollection final : public PhysicalCollection { arangodb::RocksDBOperationResult lookupDocument( transaction::Methods* trx, arangodb::velocypack::Slice key, - ManagedDocumentResult& result); + ManagedDocumentResult& result) const; arangodb::RocksDBOperationResult updateDocument( transaction::Methods* trx, TRI_voc_rid_t oldRevisionId, @@ -220,7 +220,7 @@ class RocksDBCollection final : public PhysicalCollection { arangodb::velocypack::Slice const& newDoc, bool& waitForSync); arangodb::Result lookupRevisionVPack(TRI_voc_rid_t, transaction::Methods*, - arangodb::ManagedDocumentResult&); + arangodb::ManagedDocumentResult&) const; private: uint64_t const _objectId; // rocksdb-specific object id for collection diff --git a/arangod/RocksDBEngine/RocksDBIndex.h b/arangod/RocksDBEngine/RocksDBIndex.h index 965a1e44f7..f740413a2b 100644 --- a/arangod/RocksDBEngine/RocksDBIndex.h +++ b/arangod/RocksDBEngine/RocksDBIndex.h @@ -81,7 +81,7 @@ class RocksDBIndex : public Index { RocksDBComparator* _cmp; cache::Manager* _cacheManager; - std::shared_ptr _cache; + mutable std::shared_ptr _cache; bool _useCache; }; } diff --git a/arangod/RocksDBEngine/RocksDBPrimaryIndex.cpp b/arangod/RocksDBEngine/RocksDBPrimaryIndex.cpp index 8a15ac2b64..b21508d527 100644 --- a/arangod/RocksDBEngine/RocksDBPrimaryIndex.cpp +++ b/arangod/RocksDBEngine/RocksDBPrimaryIndex.cpp @@ -306,7 +306,7 @@ void RocksDBPrimaryIndex::toVelocyPackFigures(VPackBuilder& builder) const { } RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx, - arangodb::StringRef keyRef) { + arangodb::StringRef keyRef) const { auto key = RocksDBKey::PrimaryIndexValue(_objectId, keyRef); auto value = RocksDBValue::Empty(RocksDBEntryType::PrimaryIndexValue); @@ -358,7 +358,7 @@ RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx, // TODO: remove this method? RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx, VPackSlice slice, - ManagedDocumentResult& result) { + ManagedDocumentResult& result) const { return lookupKey(trx, StringRef(slice)); } @@ -544,9 +544,9 @@ IndexIterator* RocksDBPrimaryIndex::anyIterator( return new RocksDBAnyIndexIterator(_collection, trx, mmdr, this); } -void RocksDBPrimaryIndex::invokeOnAllElements( +void RocksDBPrimaryIndex::invokeOnAllElements ( transaction::Methods* trx, - std::function callback) { + std::function callback) const { ManagedDocumentResult mmdr; std::unique_ptr cursor(allIterator(trx, &mmdr, false)); bool cnt = true; diff --git a/arangod/RocksDBEngine/RocksDBPrimaryIndex.h b/arangod/RocksDBEngine/RocksDBPrimaryIndex.h index cd33342e55..0e08b76e9c 100644 --- a/arangod/RocksDBEngine/RocksDBPrimaryIndex.h +++ b/arangod/RocksDBEngine/RocksDBPrimaryIndex.h @@ -160,10 +160,11 @@ class RocksDBPrimaryIndex final : public RocksDBIndex { void toVelocyPack(VPackBuilder&, bool, bool) const override; void toVelocyPackFigures(VPackBuilder&) const override; - RocksDBToken lookupKey(transaction::Methods* trx, arangodb::StringRef key); + RocksDBToken lookupKey(transaction::Methods* trx, + arangodb::StringRef key) const; RocksDBToken lookupKey(transaction::Methods* trx, arangodb::velocypack::Slice key, - ManagedDocumentResult& result); + ManagedDocumentResult& result) const; int insert(transaction::Methods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override; @@ -196,7 +197,7 @@ class RocksDBPrimaryIndex final : public RocksDBIndex { void invokeOnAllElements( transaction::Methods* trx, - std::function callback); + std::function callback) const; private: /// @brief create the iterator, for a single attribute, IN operator