From 94e5014293f31b2722bcc47a1bb58f1c470da4e5 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 8 Mar 2016 21:36:13 +0100 Subject: [PATCH] Remove update polic from document-collection. --- arangod/VocBase/document-collection.cpp | 38 +------------------------ arangod/VocBase/document-collection.h | 2 -- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/arangod/VocBase/document-collection.cpp b/arangod/VocBase/document-collection.cpp index dca45779f9..09c34f8d0a 100644 --- a/arangod/VocBase/document-collection.cpp +++ b/arangod/VocBase/document-collection.cpp @@ -52,7 +52,6 @@ #include "VocBase/KeyGenerator.h" #include "VocBase/MasterPointers.h" #include "VocBase/server.h" -#include "VocBase/update-policy.h" #include "VocBase/VocShaper.h" #include "Wal/DocumentOperation.h" #include "Wal/LogfileManager.h" @@ -3260,7 +3259,7 @@ int TRI_document_collection_t::read(Transaction* trx, std::string const& key, CollectionReadLocker collectionLocker(this, lock); TRI_doc_mptr_t* header; - int res = lookupDocument(trx, &slice, nullptr, header); + int res = lookupDocument(trx, slice, header); if (res != TRI_ERROR_NO_ERROR) { return res; @@ -3767,41 +3766,6 @@ arangodb::wal::Marker* TRI_document_collection_t::createVPackRemoveMarker( return new arangodb::wal::CrudMarker(TRI_DF_MARKER_VPACK_REMOVE, trx->getInternals()->_id, slice); } -//////////////////////////////////////////////////////////////////////////////// -/// @brief looks up a document by key, low level worker -/// the caller must make sure the read lock on the collection is held -/// the slice contains _key and possibly _rev -//////////////////////////////////////////////////////////////////////////////// - -int TRI_document_collection_t::lookupDocument( - arangodb::Transaction* trx, VPackSlice const* slice, - TRI_doc_update_policy_t const* policy, TRI_doc_mptr_t*& header) { - - VPackSlice key = slice->get(TRI_VOC_ATTRIBUTE_KEY); - - if (!key.isString()) { - return TRI_ERROR_INTERNAL; - } - VPackBuilder searchValue; - searchValue.openArray(); - searchValue.openObject(); - searchValue.add(TRI_SLICE_KEY_EQUAL, key); - searchValue.close(); - searchValue.close(); - - header = primaryIndex()->lookup(trx, searchValue.slice()); - - if (header == nullptr) { - return TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND; - } - - if (policy != nullptr) { - return policy->check(header->revisionId()); - } - - return TRI_ERROR_NO_ERROR; -} - //////////////////////////////////////////////////////////////////////////////// /// @brief looks up a document by key, low level worker /// the caller must make sure the read lock on the collection is held diff --git a/arangod/VocBase/document-collection.h b/arangod/VocBase/document-collection.h index e76316a798..422da73336 100644 --- a/arangod/VocBase/document-collection.h +++ b/arangod/VocBase/document-collection.h @@ -235,8 +235,6 @@ struct TRI_document_collection_t : public TRI_collection_t { arangodb::Transaction*, arangodb::velocypack::Slice const); arangodb::wal::Marker* createVPackRemoveMarker( arangodb::Transaction*, arangodb::velocypack::Slice const); - int lookupDocument(arangodb::Transaction*, arangodb::velocypack::Slice const*, - TRI_doc_update_policy_t const*, TRI_doc_mptr_t*&); int lookupDocument(arangodb::Transaction*, arangodb::velocypack::Slice const, TRI_doc_mptr_t*&); int checkRevision(arangodb::Transaction*, arangodb::velocypack::Slice const,