1
0
Fork 0

Remove update polic from document-collection.

This commit is contained in:
Max Neunhoeffer 2016-03-08 21:36:13 +01:00
parent f8703211c3
commit 94e5014293
2 changed files with 1 additions and 39 deletions

View File

@ -52,7 +52,6 @@
#include "VocBase/KeyGenerator.h" #include "VocBase/KeyGenerator.h"
#include "VocBase/MasterPointers.h" #include "VocBase/MasterPointers.h"
#include "VocBase/server.h" #include "VocBase/server.h"
#include "VocBase/update-policy.h"
#include "VocBase/VocShaper.h" #include "VocBase/VocShaper.h"
#include "Wal/DocumentOperation.h" #include "Wal/DocumentOperation.h"
#include "Wal/LogfileManager.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); CollectionReadLocker collectionLocker(this, lock);
TRI_doc_mptr_t* header; TRI_doc_mptr_t* header;
int res = lookupDocument(trx, &slice, nullptr, header); int res = lookupDocument(trx, slice, header);
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {
return res; 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); 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 /// @brief looks up a document by key, low level worker
/// the caller must make sure the read lock on the collection is held /// the caller must make sure the read lock on the collection is held

View File

@ -235,8 +235,6 @@ struct TRI_document_collection_t : public TRI_collection_t {
arangodb::Transaction*, arangodb::velocypack::Slice const); arangodb::Transaction*, arangodb::velocypack::Slice const);
arangodb::wal::Marker* createVPackRemoveMarker( arangodb::wal::Marker* createVPackRemoveMarker(
arangodb::Transaction*, arangodb::velocypack::Slice const); 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, int lookupDocument(arangodb::Transaction*, arangodb::velocypack::Slice const,
TRI_doc_mptr_t*&); TRI_doc_mptr_t*&);
int checkRevision(arangodb::Transaction*, arangodb::velocypack::Slice const, int checkRevision(arangodb::Transaction*, arangodb::velocypack::Slice const,