1
0
Fork 0
This commit is contained in:
jsteemann 2017-02-13 13:30:57 +01:00
parent f09ec85127
commit eb73dbf960
110 changed files with 992 additions and 992 deletions

View File

@ -32,7 +32,7 @@
using namespace arangodb::basics;
using namespace arangodb::aql;
Aggregator* Aggregator::fromTypeString(Transaction* trx,
Aggregator* Aggregator::fromTypeString(TransactionMethods* trx,
std::string const& type) {
if (type == "LENGTH" || type == "COUNT") {
return new AggregatorLength(trx);
@ -67,7 +67,7 @@ Aggregator* Aggregator::fromTypeString(Transaction* trx,
return nullptr;
}
Aggregator* Aggregator::fromVPack(Transaction* trx,
Aggregator* Aggregator::fromVPack(TransactionMethods* trx,
arangodb::velocypack::Slice const& slice,
char const* variableName) {
VPackSlice variable = slice.get(variableName);

View File

@ -30,7 +30,7 @@
#include <velocypack/Builder.h>
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
@ -39,30 +39,30 @@ struct Aggregator {
Aggregator(Aggregator const&) = delete;
Aggregator& operator=(Aggregator const&) = delete;
explicit Aggregator(Transaction* trx) : trx(trx) {}
explicit Aggregator(TransactionMethods* trx) : trx(trx) {}
virtual ~Aggregator() = default;
virtual char const* name() const = 0;
virtual void reset() = 0;
virtual void reduce(AqlValue const&) = 0;
virtual AqlValue stealValue() = 0;
static Aggregator* fromTypeString(Transaction*,
static Aggregator* fromTypeString(TransactionMethods*,
std::string const&);
static Aggregator* fromVPack(Transaction*,
static Aggregator* fromVPack(TransactionMethods*,
arangodb::velocypack::Slice const&, char const*);
static bool isSupported(std::string const&);
static bool requiresInput(std::string const&);
Transaction* trx;
TransactionMethods* trx;
arangodb::velocypack::Builder builder;
};
struct AggregatorLength final : public Aggregator {
explicit AggregatorLength(Transaction* trx)
explicit AggregatorLength(TransactionMethods* trx)
: Aggregator(trx), count(0) {}
AggregatorLength(Transaction* trx, uint64_t initialCount)
AggregatorLength(TransactionMethods* trx, uint64_t initialCount)
: Aggregator(trx), count(initialCount) {}
char const* name() const override final { return "LENGTH"; }
@ -75,7 +75,7 @@ struct AggregatorLength final : public Aggregator {
};
struct AggregatorMin final : public Aggregator {
explicit AggregatorMin(Transaction* trx)
explicit AggregatorMin(TransactionMethods* trx)
: Aggregator(trx), value() {}
~AggregatorMin();
@ -90,7 +90,7 @@ struct AggregatorMin final : public Aggregator {
};
struct AggregatorMax final : public Aggregator {
explicit AggregatorMax(Transaction* trx)
explicit AggregatorMax(TransactionMethods* trx)
: Aggregator(trx), value() {}
~AggregatorMax();
@ -105,7 +105,7 @@ struct AggregatorMax final : public Aggregator {
};
struct AggregatorSum final : public Aggregator {
explicit AggregatorSum(Transaction* trx)
explicit AggregatorSum(TransactionMethods* trx)
: Aggregator(trx), sum(0.0), invalid(false) {}
char const* name() const override final { return "SUM"; }
@ -119,7 +119,7 @@ struct AggregatorSum final : public Aggregator {
};
struct AggregatorAverage final : public Aggregator {
explicit AggregatorAverage(Transaction* trx)
explicit AggregatorAverage(TransactionMethods* trx)
: Aggregator(trx), count(0), sum(0.0), invalid(false) {}
char const* name() const override final { return "AVERAGE"; }
@ -134,7 +134,7 @@ struct AggregatorAverage final : public Aggregator {
};
struct AggregatorVarianceBase : public Aggregator {
AggregatorVarianceBase(Transaction* trx, bool population)
AggregatorVarianceBase(TransactionMethods* trx, bool population)
: Aggregator(trx),
population(population),
count(0),
@ -153,7 +153,7 @@ struct AggregatorVarianceBase : public Aggregator {
};
struct AggregatorVariance final : public AggregatorVarianceBase {
AggregatorVariance(Transaction* trx, bool population)
AggregatorVariance(TransactionMethods* trx, bool population)
: AggregatorVarianceBase(trx, population) {}
char const* name() const override final {
@ -167,7 +167,7 @@ struct AggregatorVariance final : public AggregatorVarianceBase {
};
struct AggregatorStddev final : public AggregatorVarianceBase {
AggregatorStddev(Transaction* trx, bool population)
AggregatorStddev(TransactionMethods* trx, bool population)
: AggregatorVarianceBase(trx, population) {}
char const* name() const override final {

View File

@ -568,7 +568,7 @@ AqlItemBlock* AqlItemBlock::concatenate(ResourceMonitor* resourceMonitor,
/// corresponding position
/// "raw": List of actual values, positions 0 and 1 are always null
/// such that actual indices start at 2
void AqlItemBlock::toVelocyPack(Transaction* trx,
void AqlItemBlock::toVelocyPack(TransactionMethods* trx,
VPackBuilder& result) const {
VPackOptions options(VPackOptions::Defaults);
options.buildUnindexedArrays = true;

View File

@ -276,7 +276,7 @@ class AqlItemBlock {
/// @brief toJson, transfer a whole AqlItemBlock to Json, the result can
/// be used to recreate the AqlItemBlock via the Json constructor
void toVelocyPack(Transaction* trx,
void toVelocyPack(TransactionMethods* trx,
arangodb::velocypack::Builder&) const;
private:

View File

@ -40,7 +40,7 @@ using namespace arangodb;
using namespace arangodb::aql;
/// @brief hashes the value
uint64_t AqlValue::hash(Transaction* trx, uint64_t seed) const {
uint64_t AqlValue::hash(TransactionMethods* trx, uint64_t seed) const {
switch (type()) {
case VPACK_SLICE_POINTER:
case VPACK_INLINE:
@ -206,7 +206,7 @@ size_t AqlValue::length() const {
}
/// @brief get the (array) element at position
AqlValue AqlValue::at(Transaction* trx,
AqlValue AqlValue::at(TransactionMethods* trx,
int64_t position, bool& mustDestroy,
bool doCopy) const {
mustDestroy = false;
@ -283,7 +283,7 @@ AqlValue AqlValue::at(Transaction* trx,
}
/// @brief get the _key attribute from an object/document
AqlValue AqlValue::getKeyAttribute(Transaction* trx,
AqlValue AqlValue::getKeyAttribute(TransactionMethods* trx,
bool& mustDestroy, bool doCopy) const {
mustDestroy = false;
switch (type()) {
@ -295,7 +295,7 @@ AqlValue AqlValue::getKeyAttribute(Transaction* trx,
case VPACK_MANAGED: {
VPackSlice s(slice());
if (s.isObject()) {
VPackSlice found = Transaction::extractKeyFromDocument(s);
VPackSlice found = TransactionMethods::extractKeyFromDocument(s);
if (!found.isNone()) {
if (doCopy) {
mustDestroy = true;
@ -320,7 +320,7 @@ AqlValue AqlValue::getKeyAttribute(Transaction* trx,
}
/// @brief get the _id attribute from an object/document
AqlValue AqlValue::getIdAttribute(Transaction* trx,
AqlValue AqlValue::getIdAttribute(TransactionMethods* trx,
bool& mustDestroy, bool doCopy) const {
mustDestroy = false;
switch (type()) {
@ -332,7 +332,7 @@ AqlValue AqlValue::getIdAttribute(Transaction* trx,
case VPACK_MANAGED: {
VPackSlice s(slice());
if (s.isObject()) {
VPackSlice found = Transaction::extractIdFromDocument(s);
VPackSlice found = TransactionMethods::extractIdFromDocument(s);
if (found.isCustom()) {
// _id as a custom type needs special treatment
mustDestroy = true;
@ -362,7 +362,7 @@ AqlValue AqlValue::getIdAttribute(Transaction* trx,
}
/// @brief get the _from attribute from an object/document
AqlValue AqlValue::getFromAttribute(Transaction* trx,
AqlValue AqlValue::getFromAttribute(TransactionMethods* trx,
bool& mustDestroy, bool doCopy) const {
mustDestroy = false;
switch (type()) {
@ -374,7 +374,7 @@ AqlValue AqlValue::getFromAttribute(Transaction* trx,
case VPACK_MANAGED: {
VPackSlice s(slice());
if (s.isObject()) {
VPackSlice found = Transaction::extractFromFromDocument(s);
VPackSlice found = TransactionMethods::extractFromFromDocument(s);
if (!found.isNone()) {
if (doCopy) {
mustDestroy = true;
@ -399,7 +399,7 @@ AqlValue AqlValue::getFromAttribute(Transaction* trx,
}
/// @brief get the _to attribute from an object/document
AqlValue AqlValue::getToAttribute(Transaction* trx,
AqlValue AqlValue::getToAttribute(TransactionMethods* trx,
bool& mustDestroy, bool doCopy) const {
mustDestroy = false;
switch (type()) {
@ -411,7 +411,7 @@ AqlValue AqlValue::getToAttribute(Transaction* trx,
case VPACK_MANAGED: {
VPackSlice s(slice());
if (s.isObject()) {
VPackSlice found = Transaction::extractToFromDocument(s);
VPackSlice found = TransactionMethods::extractToFromDocument(s);
if (!found.isNone()) {
if (doCopy) {
mustDestroy = true;
@ -436,7 +436,7 @@ AqlValue AqlValue::getToAttribute(Transaction* trx,
}
/// @brief get the (object) element by name
AqlValue AqlValue::get(Transaction* trx,
AqlValue AqlValue::get(TransactionMethods* trx,
std::string const& name, bool& mustDestroy,
bool doCopy) const {
mustDestroy = false;
@ -479,7 +479,7 @@ AqlValue AqlValue::get(Transaction* trx,
}
/// @brief get the (object) element(s) by name
AqlValue AqlValue::get(Transaction* trx,
AqlValue AqlValue::get(TransactionMethods* trx,
std::vector<std::string> const& names,
bool& mustDestroy, bool doCopy) const {
mustDestroy = false;
@ -550,7 +550,7 @@ AqlValue AqlValue::get(Transaction* trx,
}
/// @brief check whether an object has a specific key
bool AqlValue::hasKey(Transaction* trx,
bool AqlValue::hasKey(TransactionMethods* trx,
std::string const& name) const {
switch (type()) {
case VPACK_SLICE_POINTER:
@ -570,12 +570,12 @@ bool AqlValue::hasKey(Transaction* trx,
}
/// @brief get the numeric value of an AqlValue
double AqlValue::toDouble(Transaction* trx) const {
double AqlValue::toDouble(TransactionMethods* trx) const {
bool failed; // will be ignored
return toDouble(trx, failed);
}
double AqlValue::toDouble(Transaction* trx, bool& failed) const {
double AqlValue::toDouble(TransactionMethods* trx, bool& failed) const {
failed = false;
switch (type()) {
case VPACK_SLICE_POINTER:
@ -642,7 +642,7 @@ double AqlValue::toDouble(Transaction* trx, bool& failed) const {
}
/// @brief get the numeric value of an AqlValue
int64_t AqlValue::toInt64(Transaction* trx) const {
int64_t AqlValue::toInt64(TransactionMethods* trx) const {
switch (type()) {
case VPACK_SLICE_POINTER:
case VPACK_INLINE:
@ -736,7 +736,7 @@ size_t AqlValue::docvecSize() const {
/// @brief construct a V8 value as input for the expression execution in V8
/// only construct those attributes that are needed in the expression
v8::Handle<v8::Value> AqlValue::toV8Partial(
v8::Isolate* isolate, Transaction* trx,
v8::Isolate* isolate, TransactionMethods* trx,
std::unordered_set<std::string> const& attributes) const {
AqlValueType t = type();
@ -786,7 +786,7 @@ v8::Handle<v8::Value> AqlValue::toV8Partial(
/// @brief construct a V8 value as input for the expression execution in V8
v8::Handle<v8::Value> AqlValue::toV8(
v8::Isolate* isolate, Transaction* trx) const {
v8::Isolate* isolate, TransactionMethods* trx) const {
switch (type()) {
case VPACK_SLICE_POINTER:
@ -840,7 +840,7 @@ v8::Handle<v8::Value> AqlValue::toV8(
}
/// @brief materializes a value into the builder
void AqlValue::toVelocyPack(Transaction* trx,
void AqlValue::toVelocyPack(TransactionMethods* trx,
arangodb::velocypack::Builder& builder,
bool resolveExternals) const {
switch (type()) {
@ -883,7 +883,7 @@ void AqlValue::toVelocyPack(Transaction* trx,
}
/// @brief materializes a value into the builder
AqlValue AqlValue::materialize(Transaction* trx, bool& hasCopied,
AqlValue AqlValue::materialize(TransactionMethods* trx, bool& hasCopied,
bool resolveExternals) const {
switch (type()) {
case VPACK_SLICE_POINTER:
@ -1016,7 +1016,7 @@ VPackSlice AqlValue::slice() const {
/// @brief create an AqlValue from a vector of AqlItemBlock*s
AqlValue AqlValue::CreateFromBlocks(
Transaction* trx, std::vector<AqlItemBlock*> const& src,
TransactionMethods* trx, std::vector<AqlItemBlock*> const& src,
std::vector<std::string> const& variableNames) {
bool shouldDelete = true;
ConditionalDeleter<VPackBuffer<uint8_t>> deleter(shouldDelete);
@ -1055,7 +1055,7 @@ AqlValue AqlValue::CreateFromBlocks(
/// @brief create an AqlValue from a vector of AqlItemBlock*s
AqlValue AqlValue::CreateFromBlocks(
Transaction* trx, std::vector<AqlItemBlock*> const& src,
TransactionMethods* trx, std::vector<AqlItemBlock*> const& src,
arangodb::aql::RegisterId expressionRegister) {
bool shouldDelete = true;
ConditionalDeleter<VPackBuffer<uint8_t>> deleter(shouldDelete);
@ -1077,7 +1077,7 @@ AqlValue AqlValue::CreateFromBlocks(
}
/// @brief 3-way comparison for AqlValue objects
int AqlValue::Compare(Transaction* trx, AqlValue const& left,
int AqlValue::Compare(TransactionMethods* trx, AqlValue const& left,
AqlValue const& right, bool compareUtf8) {
VPackOptions* options = trx->transactionContextPtr()->getVPackOptions();

View File

@ -71,7 +71,7 @@ namespace {
}
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
class AqlItemBlock;
@ -366,7 +366,7 @@ struct AqlValue final {
}
/// @brief hashes the value
uint64_t hash(Transaction*, uint64_t seed = 0xdeadbeef) const;
uint64_t hash(TransactionMethods*, uint64_t seed = 0xdeadbeef) const;
/// @brief whether or not the value contains a none value
bool isNone() const noexcept;
@ -398,33 +398,33 @@ struct AqlValue final {
size_t length() const;
/// @brief get the (array) element at position
AqlValue at(Transaction* trx, int64_t position, bool& mustDestroy, bool copy) const;
AqlValue at(TransactionMethods* trx, int64_t position, bool& mustDestroy, bool copy) const;
/// @brief get the _key attribute from an object/document
AqlValue getKeyAttribute(Transaction* trx,
AqlValue getKeyAttribute(TransactionMethods* trx,
bool& mustDestroy, bool copy) const;
/// @brief get the _id attribute from an object/document
AqlValue getIdAttribute(Transaction* trx,
AqlValue getIdAttribute(TransactionMethods* trx,
bool& mustDestroy, bool copy) const;
/// @brief get the _from attribute from an object/document
AqlValue getFromAttribute(Transaction* trx,
AqlValue getFromAttribute(TransactionMethods* trx,
bool& mustDestroy, bool copy) const;
/// @brief get the _to attribute from an object/document
AqlValue getToAttribute(Transaction* trx,
AqlValue getToAttribute(TransactionMethods* trx,
bool& mustDestroy, bool copy) const;
/// @brief get the (object) element by name(s)
AqlValue get(Transaction* trx,
AqlValue get(TransactionMethods* trx,
std::string const& name, bool& mustDestroy, bool copy) const;
AqlValue get(Transaction* trx,
AqlValue get(TransactionMethods* trx,
std::vector<std::string> const& names, bool& mustDestroy,
bool copy) const;
bool hasKey(Transaction* trx, std::string const& name) const;
bool hasKey(TransactionMethods* trx, std::string const& name) const;
/// @brief get the numeric value of an AqlValue
double toDouble(Transaction* trx) const;
double toDouble(Transaction* trx, bool& failed) const;
int64_t toInt64(Transaction* trx) const;
double toDouble(TransactionMethods* trx) const;
double toDouble(TransactionMethods* trx, bool& failed) const;
int64_t toInt64(TransactionMethods* trx) const;
/// @brief whether or not an AqlValue evaluates to true/false
bool toBoolean() const;
@ -447,20 +447,20 @@ struct AqlValue final {
/// @brief construct a V8 value as input for the expression execution in V8
/// only construct those attributes that are needed in the expression
v8::Handle<v8::Value> toV8Partial(v8::Isolate* isolate,
Transaction*,
TransactionMethods*,
std::unordered_set<std::string> const&) const;
/// @brief construct a V8 value as input for the expression execution in V8
v8::Handle<v8::Value> toV8(v8::Isolate* isolate, Transaction*) const;
v8::Handle<v8::Value> toV8(v8::Isolate* isolate, TransactionMethods*) const;
/// @brief materializes a value into the builder
void toVelocyPack(Transaction*,
void toVelocyPack(TransactionMethods*,
arangodb::velocypack::Builder& builder,
bool resolveExternals) const;
/// @brief materialize a value into a new one. this expands docvecs and
/// ranges
AqlValue materialize(Transaction*, bool& hasCopied,
AqlValue materialize(TransactionMethods*, bool& hasCopied,
bool resolveExternals) const;
/// @brief return the slice for the value
@ -501,17 +501,17 @@ struct AqlValue final {
}
/// @brief create an AqlValue from a vector of AqlItemBlock*s
static AqlValue CreateFromBlocks(Transaction*,
static AqlValue CreateFromBlocks(TransactionMethods*,
std::vector<AqlItemBlock*> const&,
std::vector<std::string> const&);
/// @brief create an AqlValue from a vector of AqlItemBlock*s
static AqlValue CreateFromBlocks(Transaction*,
static AqlValue CreateFromBlocks(TransactionMethods*,
std::vector<AqlItemBlock*> const&,
arangodb::aql::RegisterId);
/// @brief compare function for two values
static int Compare(Transaction*,
static int Compare(TransactionMethods*,
AqlValue const& left, AqlValue const& right, bool useUtf8);
private:
@ -576,7 +576,7 @@ class AqlValueGuard {
};
struct AqlValueMaterializer {
explicit AqlValueMaterializer(Transaction* trx)
explicit AqlValueMaterializer(TransactionMethods* trx)
: trx(trx), materialized(), hasCopied(false) {}
AqlValueMaterializer(AqlValueMaterializer const& other)
@ -637,7 +637,7 @@ struct AqlValueMaterializer {
return materialized.slice();
}
Transaction* trx;
TransactionMethods* trx;
AqlValue materialized;
bool hasCopied;
};

View File

@ -40,7 +40,7 @@ namespace velocypack {
class Slice;
}
class Transaction;
class TransactionMethods;
namespace aql {

View File

@ -68,7 +68,7 @@ void AttributeAccessor::replaceVariable(std::unordered_map<VariableId, Variable
}
/// @brief execute the accessor
AqlValue AttributeAccessor::getSystem(Transaction* trx,
AqlValue AttributeAccessor::getSystem(TransactionMethods* trx,
ExpressionContext* context, bool& mustDestroy) {
AqlValue const& value = context->getVariableValue(_variable, false, mustDestroy);
// get the AQL value
@ -89,7 +89,7 @@ AqlValue AttributeAccessor::getSystem(Transaction* trx,
}
/// @brief execute the accessor
AqlValue AttributeAccessor::getDynamic(Transaction* trx,
AqlValue AttributeAccessor::getDynamic(TransactionMethods* trx,
ExpressionContext* context, bool& mustDestroy) {
AqlValue const& value = context->getVariableValue(_variable, false, mustDestroy);
// get the AQL value

View File

@ -29,7 +29,7 @@
#include "Aql/types.h"
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
@ -44,8 +44,8 @@ class AttributeAccessor {
~AttributeAccessor() = default;
/// @brief execute the accessor
AqlValue getSystem(Transaction* trx, ExpressionContext* context, bool& mustDestroy);
AqlValue getDynamic(Transaction* trx, ExpressionContext* context, bool& mustDestroy);
AqlValue getSystem(TransactionMethods* trx, ExpressionContext* context, bool& mustDestroy);
AqlValue getDynamic(TransactionMethods* trx, ExpressionContext* context, bool& mustDestroy);
public:
void replaceVariable(std::unordered_map<VariableId, Variable const*> const& replacements);

View File

@ -31,7 +31,7 @@
#include "Rest/GeneralRequest.h"
namespace arangodb {
class Transaction;
class TransactionMethods;
struct ClusterCommResult;
namespace aql {
@ -99,7 +99,7 @@ class GatherBlock : public ExecutionBlock {
/// @brief OurLessThan: comparison method for elements of _gatherBlockPos
class OurLessThan {
public:
OurLessThan(Transaction* trx,
OurLessThan(TransactionMethods* trx,
std::vector<std::deque<AqlItemBlock*>>& gatherBlockBuffer,
std::vector<SortElementBlock>& sortRegisters)
: _trx(trx),
@ -110,7 +110,7 @@ class GatherBlock : public ExecutionBlock {
std::pair<size_t, size_t> const& b);
private:
Transaction* _trx;
TransactionMethods* _trx;
std::vector<std::deque<AqlItemBlock*>>& _gatherBlockBuffer;
std::vector<SortElementBlock>& _sortRegisters;
};

View File

@ -34,7 +34,7 @@
#include <velocypack/Builder.h>
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
struct Aggregator;
@ -143,24 +143,24 @@ class HashedCollectBlock : public ExecutionBlock {
/// @brief hasher for a vector of AQL values
struct GroupKeyHash {
GroupKeyHash(Transaction* trx, size_t num)
GroupKeyHash(TransactionMethods* trx, size_t num)
: _trx(trx), _num(num) {}
size_t operator()(std::vector<AqlValue> const& value) const;
Transaction* _trx;
TransactionMethods* _trx;
size_t const _num;
};
/// @brief comparator for a vector of AQL values
struct GroupKeyEqual {
explicit GroupKeyEqual(Transaction* trx)
explicit GroupKeyEqual(TransactionMethods* trx)
: _trx(trx) {}
bool operator()(std::vector<AqlValue> const&,
std::vector<AqlValue> const&) const;
Transaction* _trx;
TransactionMethods* _trx;
};
};

View File

@ -363,13 +363,13 @@ void Condition::andCombine(AstNode const* node) {
/// filtering(first) and sorting(second)
std::pair<bool, bool> Condition::findIndexes(
EnumerateCollectionNode const* node,
std::vector<Transaction::IndexHandle>& usedIndexes,
std::vector<TransactionMethods::IndexHandle>& usedIndexes,
SortCondition const* sortCondition) {
TRI_ASSERT(usedIndexes.empty());
Variable const* reference = node->outVariable();
std::string collectionName = node->collection()->getName();
Transaction* trx = _ast->query()->trx();
TransactionMethods* trx = _ast->query()->trx();
size_t const itemsInIndex = node->collection()->count();
if (_root == nullptr) {
@ -622,7 +622,7 @@ void Condition::optimize(ExecutionPlan* plan) {
return;
}
Transaction* trx = plan->getAst()->query()->trx();
TransactionMethods* trx = plan->getAst()->query()->trx();
TRI_ASSERT(_root != nullptr);
TRI_ASSERT(_root->type == NODE_TYPE_OPERATOR_NARY_OR);
@ -1073,7 +1073,7 @@ void Condition::deduplicateInOperation(AstNode* operation) {
}
/// @brief merge the values from two IN operations
AstNode* Condition::mergeInOperations(Transaction* trx, AstNode const* lhs, AstNode const* rhs) {
AstNode* Condition::mergeInOperations(TransactionMethods* trx, AstNode const* lhs, AstNode const* rhs) {
TRI_ASSERT(lhs->type == NODE_TYPE_OPERATOR_BINARY_IN);
TRI_ASSERT(rhs->type == NODE_TYPE_OPERATOR_BINARY_IN);

View File

@ -227,7 +227,7 @@ class Condition {
/// return value is a pair indicating whether the index can be used for
/// filtering(first) and sorting(second)
std::pair<bool, bool> findIndexes(EnumerateCollectionNode const*,
std::vector<Transaction::IndexHandle>&,
std::vector<TransactionMethods::IndexHandle>&,
SortCondition const*);
/// @brief get the attributes for a sub-condition that are const
@ -261,7 +261,7 @@ class Condition {
void deduplicateInOperation(AstNode*);
/// @brief merge the values from two IN operations
AstNode* mergeInOperations(Transaction* trx, AstNode const*, AstNode const*);
AstNode* mergeInOperations(TransactionMethods* trx, AstNode const*, AstNode const*);
/// @brief merges the current node with the sub nodes of same type
AstNode* collapse(AstNode const*);

View File

@ -194,7 +194,7 @@ bool ConditionFinder::before(ExecutionNode* en) {
break;
}
std::vector<Transaction::IndexHandle> usedIndexes;
std::vector<TransactionMethods::IndexHandle> usedIndexes;
auto canUseIndex =
condition->findIndexes(node, usedIndexes, sortCondition.get());

View File

@ -43,8 +43,8 @@ EnumerateCollectionBlock::EnumerateCollectionBlock(
_mmdr(new ManagedDocumentResult),
_cursor(_trx->indexScan(
_collection->getName(),
(ep->_random ? Transaction::CursorType::ANY
: Transaction::CursorType::ALL),
(ep->_random ? TransactionMethods::CursorType::ANY
: TransactionMethods::CursorType::ALL),
_mmdr.get(), 0, UINT64_MAX, 1000, false)),
_mustStoreResult(true) {
TRI_ASSERT(_cursor->successful());

View File

@ -57,7 +57,7 @@
#endif
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
class AqlItemBlock;
@ -206,7 +206,7 @@ class ExecutionBlock {
ExecutionNode const* getPlanNode() const { return _exeNode; }
Transaction* transaction() const { return _trx; }
TransactionMethods* transaction() const { return _trx; }
protected:
/// @brief generic method to get or skip some
@ -217,7 +217,7 @@ class ExecutionBlock {
ExecutionEngine* _engine;
/// @brief the transaction for this query
Transaction* _trx;
TransactionMethods* _trx;
/// @brief our corresponding ExecutionNode node
ExecutionNode const* _exeNode;

View File

@ -1168,10 +1168,10 @@ ExecutionEngine* ExecutionEngine::instantiateFromPlan(
engine = inst.get()->buildEngines();
root = engine->root();
// Now find all shards that take part:
if (Transaction::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders != nullptr) {
engine->_lockedShards = new std::unordered_set<std::string>(
*Transaction::_makeNolockHeaders);
engine->_previouslyLockedShards = Transaction::_makeNolockHeaders;
*TransactionMethods::_makeNolockHeaders);
engine->_previouslyLockedShards = TransactionMethods::_makeNolockHeaders;
} else {
engine->_lockedShards = new std::unordered_set<std::string>();
engine->_previouslyLockedShards = nullptr;
@ -1269,7 +1269,7 @@ ExecutionEngine* ExecutionEngine::instantiateFromPlan(
TRI_ERROR_QUERY_COLLECTION_LOCK_FAILED, message);
}
}
Transaction::_makeNolockHeaders = engine->_lockedShards;
TransactionMethods::_makeNolockHeaders = engine->_lockedShards;
} catch (...) {
// We need to destroy all queries that we have built and stuffed
// into the QueryRegistry as well as those that we have pushed to

View File

@ -79,8 +79,8 @@ class ExecutionEngine {
if (_root != nullptr && !_wasShutdown) {
// Take care of locking prevention measures in the cluster:
if (_lockedShards != nullptr) {
if (Transaction::_makeNolockHeaders == _lockedShards) {
Transaction::_makeNolockHeaders = _previouslyLockedShards;
if (TransactionMethods::_makeNolockHeaders == _lockedShards) {
TransactionMethods::_makeNolockHeaders = _previouslyLockedShards;
}
delete _lockedShards;
_lockedShards = nullptr;

View File

@ -69,7 +69,7 @@ static uint64_t checkTraversalDepthValue(AstNode const* node) {
}
static std::unique_ptr<traverser::TraverserOptions> CreateTraversalOptions(
Transaction* trx, AstNode const* direction, AstNode const* optionsNode) {
TransactionMethods* trx, AstNode const* direction, AstNode const* optionsNode) {
auto options = std::make_unique<traverser::TraverserOptions>(trx);

View File

@ -127,7 +127,7 @@ void Expression::variables(std::unordered_set<Variable const*>& result) const {
}
/// @brief execute the expression
AqlValue Expression::execute(Transaction* trx, ExpressionContext* ctx,
AqlValue Expression::execute(TransactionMethods* trx, ExpressionContext* ctx,
bool& mustDestroy) {
if (!_built) {
buildExpression(trx);
@ -177,7 +177,7 @@ AqlValue Expression::execute(Transaction* trx, ExpressionContext* ctx,
/// @brief execute the expression
/// TODO DEPRECATED
AqlValue Expression::execute(Transaction* trx,
AqlValue Expression::execute(TransactionMethods* trx,
AqlItemBlock const* argv, size_t startPos,
std::vector<Variable const*> const& vars,
std::vector<RegisterId> const& regs,
@ -255,7 +255,7 @@ void Expression::invalidate() {
/// this performs either a binary search (if the node is sorted) or a
/// linear search (if the node is not sorted)
bool Expression::findInArray(AqlValue const& left, AqlValue const& right,
Transaction* trx,
TransactionMethods* trx,
AstNode const* node) const {
TRI_ASSERT(right.isArray());
@ -408,7 +408,7 @@ void Expression::analyzeExpression() {
}
/// @brief build the expression
void Expression::buildExpression(Transaction* trx) {
void Expression::buildExpression(TransactionMethods* trx) {
TRI_ASSERT(!_built);
if (_type == UNPROCESSED) {
@ -440,7 +440,7 @@ void Expression::buildExpression(Transaction* trx) {
/// @brief execute an expression of type SIMPLE, the convention is that
/// the resulting AqlValue will be destroyed outside eventually
AqlValue Expression::executeSimpleExpression(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy, bool doCopy) {
switch (node->type) {
@ -541,7 +541,7 @@ void Expression::stringifyIfNotTooLong(
/// @brief execute an expression of type SIMPLE with ATTRIBUTE ACCESS
/// always creates a copy
AqlValue Expression::executeSimpleExpressionAttributeAccess(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy) {
// object lookup, e.g. users.name
TRI_ASSERT(node->numMembers() == 1);
@ -557,7 +557,7 @@ AqlValue Expression::executeSimpleExpressionAttributeAccess(
/// @brief execute an expression of type SIMPLE with INDEXED ACCESS
AqlValue Expression::executeSimpleExpressionIndexedAccess(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy) {
// array lookup, e.g. users[0]
// note: it depends on the type of the value whether an array lookup or an
@ -626,7 +626,7 @@ AqlValue Expression::executeSimpleExpressionIndexedAccess(
/// @brief execute an expression of type SIMPLE with ARRAY
AqlValue Expression::executeSimpleExpressionArray(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy) {
mustDestroy = false;
@ -660,7 +660,7 @@ AqlValue Expression::executeSimpleExpressionArray(
/// @brief execute an expression of type SIMPLE with OBJECT
AqlValue Expression::executeSimpleExpressionObject(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy) {
mustDestroy = false;
@ -799,7 +799,7 @@ AqlValue Expression::executeSimpleExpressionObject(
/// @brief execute an expression of type SIMPLE with VALUE
AqlValue Expression::executeSimpleExpressionValue(AstNode const* node,
Transaction* trx,
TransactionMethods* trx,
bool& mustDestroy) {
// this will not create a copy
mustDestroy = false;
@ -808,7 +808,7 @@ AqlValue Expression::executeSimpleExpressionValue(AstNode const* node,
/// @brief execute an expression of type SIMPLE with REFERENCE
AqlValue Expression::executeSimpleExpressionReference(
AstNode const* node, Transaction* trx,
AstNode const* node, TransactionMethods* trx,
bool& mustDestroy, bool doCopy) {
mustDestroy = false;
@ -828,7 +828,7 @@ AqlValue Expression::executeSimpleExpressionReference(
/// @brief execute an expression of type SIMPLE with RANGE
AqlValue Expression::executeSimpleExpressionRange(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
auto low = node->getMember(0);
auto high = node->getMember(1);
@ -849,7 +849,7 @@ AqlValue Expression::executeSimpleExpressionRange(
/// @brief execute an expression of type SIMPLE with FCALL
AqlValue Expression::executeSimpleExpressionFCall(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
mustDestroy = false;
// only some functions have C++ handlers
@ -914,7 +914,7 @@ AqlValue Expression::executeSimpleExpressionFCall(
/// @brief execute an expression of type SIMPLE with NOT
AqlValue Expression::executeSimpleExpressionNot(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
mustDestroy = false;
AqlValue operand =
@ -929,7 +929,7 @@ AqlValue Expression::executeSimpleExpressionNot(
/// @brief execute an expression of type SIMPLE with +
AqlValue Expression::executeSimpleExpressionPlus(AstNode const* node,
Transaction* trx,
TransactionMethods* trx,
bool& mustDestroy) {
mustDestroy = false;
AqlValue operand =
@ -963,7 +963,7 @@ AqlValue Expression::executeSimpleExpressionPlus(AstNode const* node,
/// @brief execute an expression of type SIMPLE with -
AqlValue Expression::executeSimpleExpressionMinus(AstNode const* node,
Transaction* trx,
TransactionMethods* trx,
bool& mustDestroy) {
mustDestroy = false;
AqlValue operand =
@ -999,7 +999,7 @@ AqlValue Expression::executeSimpleExpressionMinus(AstNode const* node,
/// @brief execute an expression of type SIMPLE with AND
AqlValue Expression::executeSimpleExpressionAnd(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
@ -1016,7 +1016,7 @@ AqlValue Expression::executeSimpleExpressionAnd(
/// @brief execute an expression of type SIMPLE with OR
AqlValue Expression::executeSimpleExpressionOr(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
@ -1033,7 +1033,7 @@ AqlValue Expression::executeSimpleExpressionOr(
/// @brief execute an expression of type SIMPLE with AND or OR
AqlValue Expression::executeSimpleExpressionNaryAndOr(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
size_t count = node->numMembers();
if (count == 0) {
// There is nothing to evaluate. So this is always true
@ -1078,7 +1078,7 @@ AqlValue Expression::executeSimpleExpressionNaryAndOr(
/// @brief execute an expression of type SIMPLE with COMPARISON
AqlValue Expression::executeSimpleExpressionComparison(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, false);
@ -1140,7 +1140,7 @@ AqlValue Expression::executeSimpleExpressionComparison(
/// @brief execute an expression of type SIMPLE with ARRAY COMPARISON
AqlValue Expression::executeSimpleExpressionArrayComparison(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue left =
executeSimpleExpression(node->getMember(0), trx, mustDestroy, false);
@ -1269,7 +1269,7 @@ AqlValue Expression::executeSimpleExpressionArrayComparison(
/// @brief execute an expression of type SIMPLE with TERNARY
AqlValue Expression::executeSimpleExpressionTernary(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue condition =
executeSimpleExpression(node->getMember(0), trx, mustDestroy, false);
@ -1291,7 +1291,7 @@ AqlValue Expression::executeSimpleExpressionTernary(
/// @brief execute an expression of type SIMPLE with EXPANSION
AqlValue Expression::executeSimpleExpressionExpansion(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
TRI_ASSERT(node->numMembers() == 5);
// LIMIT
@ -1480,7 +1480,7 @@ AqlValue Expression::executeSimpleExpressionExpansion(
/// @brief execute an expression of type SIMPLE with ITERATOR
AqlValue Expression::executeSimpleExpressionIterator(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
TRI_ASSERT(node != nullptr);
TRI_ASSERT(node->numMembers() == 2);
@ -1489,7 +1489,7 @@ AqlValue Expression::executeSimpleExpressionIterator(
/// @brief execute an expression of type SIMPLE with BINARY_* (+, -, * , /, %)
AqlValue Expression::executeSimpleExpressionArithmetic(
AstNode const* node, Transaction* trx, bool& mustDestroy) {
AstNode const* node, TransactionMethods* trx, bool& mustDestroy) {
AqlValue lhs = executeSimpleExpression(node->getMemberUnchecked(0), trx, mustDestroy, true);
AqlValueGuard guardLhs(lhs, mustDestroy);

View File

@ -34,7 +34,7 @@
#include <velocypack/Slice.h>
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace basics {
class StringBuffer;
@ -119,12 +119,12 @@ class Expression {
}
/// @brief execute the expression
AqlValue execute(Transaction* trx, ExpressionContext* ctx,
AqlValue execute(TransactionMethods* trx, ExpressionContext* ctx,
bool& mustDestroy);
/// @brief execute the expression
/// DEPRECATED
AqlValue execute(Transaction* trx, AqlItemBlock const*, size_t,
AqlValue execute(TransactionMethods* trx, AqlItemBlock const*, size_t,
std::vector<Variable const*> const&,
std::vector<RegisterId> const&, bool& mustDestroy);
@ -213,7 +213,7 @@ class Expression {
/// @brief find a value in an array
bool findInArray(AqlValue const&, AqlValue const&,
Transaction*,
TransactionMethods*,
AstNode const*) const;
/// @brief analyze the expression (determine its type etc.)
@ -221,108 +221,108 @@ class Expression {
/// @brief build the expression (if appropriate, compile it into
/// executable code)
void buildExpression(Transaction*);
void buildExpression(TransactionMethods*);
/// @brief execute an expression of type SIMPLE
AqlValue executeSimpleExpression(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy, bool);
/// @brief execute an expression of type SIMPLE with ATTRIBUTE ACCESS
AqlValue executeSimpleExpressionAttributeAccess(
AstNode const*, Transaction*, bool& mustDestroy);
AstNode const*, TransactionMethods*, bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with INDEXED ACCESS
AqlValue executeSimpleExpressionIndexedAccess(
AstNode const*, Transaction*,
AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with ARRAY
AqlValue executeSimpleExpressionArray(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with OBJECT
AqlValue executeSimpleExpressionObject(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with VALUE
AqlValue executeSimpleExpressionValue(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with REFERENCE
AqlValue executeSimpleExpressionReference(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy,
bool);
/// @brief execute an expression of type SIMPLE with FCALL
AqlValue executeSimpleExpressionFCall(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with RANGE
AqlValue executeSimpleExpressionRange(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with NOT
AqlValue executeSimpleExpressionNot(AstNode const*, Transaction*,
AqlValue executeSimpleExpressionNot(AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with +
AqlValue executeSimpleExpressionPlus(AstNode const*, Transaction*,
AqlValue executeSimpleExpressionPlus(AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with -
AqlValue executeSimpleExpressionMinus(AstNode const*, Transaction*,
AqlValue executeSimpleExpressionMinus(AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with AND
AqlValue executeSimpleExpressionAnd(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with OR
AqlValue executeSimpleExpressionOr(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with NARY AND or OR
AqlValue executeSimpleExpressionNaryAndOr(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with COMPARISON
AqlValue executeSimpleExpressionComparison(
AstNode const*, Transaction*,
AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with ARRAY COMPARISON
AqlValue executeSimpleExpressionArrayComparison(
AstNode const*, Transaction*,
AstNode const*, TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with TERNARY
AqlValue executeSimpleExpressionTernary(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with EXPANSION
AqlValue executeSimpleExpressionExpansion(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with EXPANSION
AqlValue executeSimpleExpressionIterator(AstNode const*,
Transaction*,
TransactionMethods*,
bool& mustDestroy);
/// @brief execute an expression of type SIMPLE with BINARY_* (+, -, * , /, %)
AqlValue executeSimpleExpressionArithmetic(
AstNode const*, Transaction*,
AstNode const*, TransactionMethods*,
bool& mustDestroy);
private:

View File

@ -63,7 +63,7 @@ void FixedVarExpressionContext::setVariableValue(Variable const* var,
}
void FixedVarExpressionContext::serializeAllVariables(
Transaction* trx, VPackBuilder& builder) const {
TransactionMethods* trx, VPackBuilder& builder) const {
TRI_ASSERT(builder.isOpenArray());
for (auto const& it : _vars) {
builder.openArray();

View File

@ -50,7 +50,7 @@ class FixedVarExpressionContext : public ExpressionContext {
void setVariableValue(Variable const*, AqlValue);
void serializeAllVariables(Transaction*,
void serializeAllVariables(TransactionMethods*,
arangodb::velocypack::Builder&) const;
private:

View File

@ -58,14 +58,14 @@ thread_local std::unordered_map<std::string, RegexMatcher*>* LikeCache =
nullptr;
/// @brief convert a number value into an AqlValue
static AqlValue NumberValue(Transaction* trx, int value) {
static AqlValue NumberValue(TransactionMethods* trx, int value) {
TransactionBuilderLeaser builder(trx);
builder->add(VPackValue(value));
return AqlValue(builder.get());
}
/// @brief convert a number value into an AqlValue
static AqlValue NumberValue(Transaction* trx, double value, bool nullify) {
static AqlValue NumberValue(TransactionMethods* trx, double value, bool nullify) {
if (std::isnan(value) || !std::isfinite(value) || value == HUGE_VAL || value == -HUGE_VAL) {
if (nullify) {
// convert to null
@ -203,7 +203,7 @@ static std::string BuildRegexPattern(char const* ptr, size_t length,
/// @brief extract a function parameter from the arguments
AqlValue Functions::ExtractFunctionParameterValue(
Transaction*, VPackFunctionParameters const& parameters,
TransactionMethods*, VPackFunctionParameters const& parameters,
size_t position) {
if (position >= parameters.size()) {
// parameter out of range
@ -214,7 +214,7 @@ AqlValue Functions::ExtractFunctionParameterValue(
/// @brief extra a collection name from an AqlValue
std::string Functions::ExtractCollectionName(
Transaction* trx, VPackFunctionParameters const& parameters,
TransactionMethods* trx, VPackFunctionParameters const& parameters,
size_t position) {
AqlValue value =
ExtractFunctionParameterValue(trx, parameters, position);
@ -342,7 +342,7 @@ static double ValueToNumber(VPackSlice const& slice, bool& isValid) {
}
/// @brief extract a boolean parameter from an array
static bool GetBooleanParameter(Transaction* trx,
static bool GetBooleanParameter(TransactionMethods* trx,
VPackFunctionParameters const& parameters,
size_t startParameter, bool defaultValue) {
size_t const n = parameters.size();
@ -357,7 +357,7 @@ static bool GetBooleanParameter(Transaction* trx,
/// @brief extract attribute names from the arguments
void Functions::ExtractKeys(std::unordered_set<std::string>& names,
arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters,
size_t startParameter, char const* functionName) {
size_t const n = parameters.size();
@ -394,7 +394,7 @@ void Functions::ExtractKeys(std::unordered_set<std::string>& names,
/// @brief append the VelocyPack value to a string buffer
/// Note: Backwards compatibility. Is different than Slice.toJson()
void Functions::Stringify(Transaction* trx,
void Functions::Stringify(TransactionMethods* trx,
arangodb::basics::VPackStringBufferAdapter& buffer,
VPackSlice const& slice) {
if (slice.isNull()) {
@ -422,7 +422,7 @@ void Functions::Stringify(Transaction* trx,
/// @brief append the VelocyPack value to a string buffer
/// Note: Backwards compatibility. Is different than Slice.toJson()
static void AppendAsString(Transaction* trx,
static void AppendAsString(TransactionMethods* trx,
arangodb::basics::VPackStringBufferAdapter& buffer,
AqlValue const& value) {
AqlValueMaterializer materializer(trx);
@ -432,7 +432,7 @@ static void AppendAsString(Transaction* trx,
}
/// @brief Checks if the given list contains the element
static bool ListContainsElement(Transaction* trx,
static bool ListContainsElement(TransactionMethods* trx,
VPackOptions const* options,
AqlValue const& list,
AqlValue const& testee, size_t& index) {
@ -481,7 +481,7 @@ static bool ListContainsElement(VPackOptions const* options,
/// If successful value will contain the variance and count
/// will contain the number of elements.
/// If not successful value and count contain garbage.
static bool Variance(Transaction* trx,
static bool Variance(TransactionMethods* trx,
AqlValue const& values, double& value, size_t& count) {
TRI_ASSERT(values.isArray());
value = 0.0;
@ -510,7 +510,7 @@ static bool Variance(Transaction* trx,
/// @brief Sorts the given list of Numbers in ASC order.
/// Removes all null entries.
/// Returns false if the list contains non-number values.
static bool SortNumberList(Transaction* trx,
static bool SortNumberList(TransactionMethods* trx,
AqlValue const& values,
std::vector<double>& result) {
TRI_ASSERT(values.isArray());
@ -534,7 +534,7 @@ static bool SortNumberList(Transaction* trx,
/// @brief Helper function to unset or keep all given names in the value.
/// Recursively iterates over sub-object and unsets or keeps their values
/// as well
static void UnsetOrKeep(Transaction* trx,
static void UnsetOrKeep(TransactionMethods* trx,
VPackSlice const& value,
std::unordered_set<std::string> const& names,
bool unset, // true means unset, false means keep
@ -562,7 +562,7 @@ static void UnsetOrKeep(Transaction* trx,
/// @brief Helper function to get a document by it's identifier
/// Lazy Locks the collection if necessary.
static void GetDocumentByIdentifier(Transaction* trx,
static void GetDocumentByIdentifier(TransactionMethods* trx,
std::string& collectionName,
std::string const& identifier,
bool ignoreError,
@ -615,7 +615,7 @@ static void GetDocumentByIdentifier(Transaction* trx,
/// Works for an array of objects as first parameter or arbitrary many
/// object parameters
AqlValue Functions::MergeParameters(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters,
char const* funcName,
bool recursive) {
@ -713,7 +713,7 @@ void Functions::DestroyThreadContext() { ClearRegexCache(); ClearLikeCache(); }
/// @brief function IS_NULL
AqlValue Functions::IsNull(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isNull(true));
@ -721,7 +721,7 @@ AqlValue Functions::IsNull(arangodb::aql::Query* query,
/// @brief function IS_BOOL
AqlValue Functions::IsBool(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isBoolean());
@ -729,7 +729,7 @@ AqlValue Functions::IsBool(arangodb::aql::Query* query,
/// @brief function IS_NUMBER
AqlValue Functions::IsNumber(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isNumber());
@ -737,7 +737,7 @@ AqlValue Functions::IsNumber(arangodb::aql::Query* query,
/// @brief function IS_STRING
AqlValue Functions::IsString(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isString());
@ -745,7 +745,7 @@ AqlValue Functions::IsString(arangodb::aql::Query* query,
/// @brief function IS_ARRAY
AqlValue Functions::IsArray(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isArray());
@ -753,7 +753,7 @@ AqlValue Functions::IsArray(arangodb::aql::Query* query,
/// @brief function IS_OBJECT
AqlValue Functions::IsObject(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.isObject());
@ -761,7 +761,7 @@ AqlValue Functions::IsObject(arangodb::aql::Query* query,
/// @brief function TYPENAME
AqlValue Functions::Typename(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -785,7 +785,7 @@ AqlValue Functions::Typename(arangodb::aql::Query* query,
/// @brief function TO_NUMBER
AqlValue Functions::ToNumber(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
bool failed;
@ -802,7 +802,7 @@ AqlValue Functions::ToNumber(arangodb::aql::Query* query,
/// @brief function TO_STRING
AqlValue Functions::ToString(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -820,7 +820,7 @@ AqlValue Functions::ToString(arangodb::aql::Query* query,
/// @brief function TO_BOOL
AqlValue Functions::ToBool(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue a = ExtractFunctionParameterValue(trx, parameters, 0);
return AqlValue(a.toBoolean());
@ -828,7 +828,7 @@ AqlValue Functions::ToBool(arangodb::aql::Query* query,
/// @brief function TO_ARRAY
AqlValue Functions::ToArray(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -864,7 +864,7 @@ AqlValue Functions::ToArray(arangodb::aql::Query* query,
/// @brief function LENGTH
AqlValue Functions::Length(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
TransactionBuilderLeaser builder(trx);
@ -905,7 +905,7 @@ AqlValue Functions::Length(arangodb::aql::Query* query,
/// @brief function FIRST
AqlValue Functions::First(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "FIRST", 1, 1);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -926,7 +926,7 @@ AqlValue Functions::First(arangodb::aql::Query* query,
/// @brief function LAST
AqlValue Functions::Last(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "LAST", 1, 1);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -949,7 +949,7 @@ AqlValue Functions::Last(arangodb::aql::Query* query,
/// @brief function NTH
AqlValue Functions::Nth(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "NTH", 2, 2);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -979,7 +979,7 @@ AqlValue Functions::Nth(arangodb::aql::Query* query,
/// @brief function CONTAINS
AqlValue Functions::Contains(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "CONTAINS", 2, 3);
@ -1043,7 +1043,7 @@ AqlValue Functions::Contains(arangodb::aql::Query* query,
/// @brief function CONCAT
AqlValue Functions::Concat(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
StringBufferLeaser buffer(trx);
arangodb::basics::VPackStringBufferAdapter adapter(buffer->stringBuffer());
@ -1087,7 +1087,7 @@ AqlValue Functions::Concat(arangodb::aql::Query* query,
/// @brief function CONCAT_SEPARATOR
AqlValue Functions::ConcatSeparator(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
StringBufferLeaser buffer(trx);
arangodb::basics::VPackStringBufferAdapter adapter(buffer->stringBuffer());
@ -1152,7 +1152,7 @@ AqlValue Functions::ConcatSeparator(arangodb::aql::Query* query,
/// @brief function LIKE
AqlValue Functions::Like(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "LIKE", 2, 3);
bool const caseInsensitive = GetBooleanParameter(trx, parameters, 2, false);
@ -1219,7 +1219,7 @@ AqlValue Functions::Like(arangodb::aql::Query* query,
/// @brief function REGEX_TEST
AqlValue Functions::RegexTest(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "REGEX_TEST", 2, 3);
bool const caseInsensitive = GetBooleanParameter(trx, parameters, 2, false);
@ -1286,7 +1286,7 @@ AqlValue Functions::RegexTest(arangodb::aql::Query* query,
/// @brief function REGEX_REPLACE
AqlValue Functions::RegexReplace(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "REGEX_REPLACE", 3, 4);
bool const caseInsensitive = GetBooleanParameter(trx, parameters, 3, false);
@ -1357,7 +1357,7 @@ AqlValue Functions::RegexReplace(arangodb::aql::Query* query,
/// @brief function PASSTHRU
AqlValue Functions::Passthru(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
if (parameters.empty()) {
return AqlValue(arangodb::basics::VelocyPackHelper::NullValue());
@ -1368,7 +1368,7 @@ AqlValue Functions::Passthru(arangodb::aql::Query* query,
/// @brief function UNSET
AqlValue Functions::Unset(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNSET", 2);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1394,7 +1394,7 @@ AqlValue Functions::Unset(arangodb::aql::Query* query,
/// @brief function UNSET_RECURSIVE
AqlValue Functions::UnsetRecursive(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNSET_RECURSIVE", 2);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1420,7 +1420,7 @@ AqlValue Functions::UnsetRecursive(arangodb::aql::Query* query,
/// @brief function KEEP
AqlValue Functions::Keep(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "KEEP", 2);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1447,21 +1447,21 @@ AqlValue Functions::Keep(arangodb::aql::Query* query,
/// @brief function MERGE
AqlValue Functions::Merge(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
return MergeParameters(query, trx, parameters, "MERGE", false);
}
/// @brief function MERGE_RECURSIVE
AqlValue Functions::MergeRecursive(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
return MergeParameters(query, trx, parameters, "MERGE_RECURSIVE", true);
}
/// @brief function HAS
AqlValue Functions::Has(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
if (n < 2) {
@ -1492,7 +1492,7 @@ AqlValue Functions::Has(arangodb::aql::Query* query,
/// @brief function ATTRIBUTES
AqlValue Functions::Attributes(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
@ -1557,7 +1557,7 @@ AqlValue Functions::Attributes(arangodb::aql::Query* query,
/// @brief function VALUES
AqlValue Functions::Values(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
@ -1607,7 +1607,7 @@ AqlValue Functions::Values(arangodb::aql::Query* query,
/// @brief function MIN
AqlValue Functions::Min(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1638,7 +1638,7 @@ AqlValue Functions::Min(arangodb::aql::Query* query,
/// @brief function MAX
AqlValue Functions::Max(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1665,7 +1665,7 @@ AqlValue Functions::Max(arangodb::aql::Query* query,
/// @brief function SUM
AqlValue Functions::Sum(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1697,7 +1697,7 @@ AqlValue Functions::Sum(arangodb::aql::Query* query,
/// @brief function AVERAGE
AqlValue Functions::Average(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1739,7 +1739,7 @@ AqlValue Functions::Average(arangodb::aql::Query* query,
/// @brief function RANDOM_TOKEN
AqlValue Functions::RandomToken(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1755,7 +1755,7 @@ AqlValue Functions::RandomToken(arangodb::aql::Query* query,
/// @brief function MD5
AqlValue Functions::Md5(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
StringBufferLeaser buffer(trx);
@ -1782,7 +1782,7 @@ AqlValue Functions::Md5(arangodb::aql::Query* query,
/// @brief function SHA1
AqlValue Functions::Sha1(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
StringBufferLeaser buffer(trx);
@ -1809,7 +1809,7 @@ AqlValue Functions::Sha1(arangodb::aql::Query* query,
/// @brief function HASH
AqlValue Functions::Hash(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1824,7 +1824,7 @@ AqlValue Functions::Hash(arangodb::aql::Query* query,
/// @brief function UNIQUE
AqlValue Functions::Unique(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNIQUE", 1, 1);
@ -1866,7 +1866,7 @@ AqlValue Functions::Unique(arangodb::aql::Query* query,
/// @brief function SORTED_UNIQUE
AqlValue Functions::SortedUnique(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "SORTED_UNIQUE", 1, 1);
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
@ -1903,7 +1903,7 @@ AqlValue Functions::SortedUnique(arangodb::aql::Query* query,
/// @brief function UNION
AqlValue Functions::Union(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNION", 2);
@ -1952,7 +1952,7 @@ AqlValue Functions::Union(arangodb::aql::Query* query,
/// @brief function UNION_DISTINCT
AqlValue Functions::UnionDistinct(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNION_DISTINCT", 2);
size_t const n = parameters.size();
@ -2014,7 +2014,7 @@ AqlValue Functions::UnionDistinct(arangodb::aql::Query* query,
/// @brief function INTERSECTION
AqlValue Functions::Intersection(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "INTERSECTION", 2);
@ -2085,7 +2085,7 @@ AqlValue Functions::Intersection(arangodb::aql::Query* query,
/// @brief function OUTERSECTION
AqlValue Functions::Outersection(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "OUTERSECTION", 2);
@ -2145,7 +2145,7 @@ AqlValue Functions::Outersection(arangodb::aql::Query* query,
/// @brief function DISTANCE
AqlValue Functions::Distance(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "DISTANCE", 4, 4);
@ -2199,7 +2199,7 @@ AqlValue Functions::Distance(arangodb::aql::Query* query,
/// @brief function FLATTEN
AqlValue Functions::Flatten(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "FLATTEN", 1, 2);
@ -2237,7 +2237,7 @@ AqlValue Functions::Flatten(arangodb::aql::Query* query,
/// @brief function ZIP
AqlValue Functions::Zip(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ZIP", 2, 2);
@ -2280,7 +2280,7 @@ AqlValue Functions::Zip(arangodb::aql::Query* query,
/// @brief function JSON_STRINGIFY
AqlValue Functions::JsonStringify(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "JSON_STRINGIFY", 1, 1);
@ -2299,7 +2299,7 @@ AqlValue Functions::JsonStringify(arangodb::aql::Query* query,
/// @brief function JSON_PARSE
AqlValue Functions::JsonParse(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "JSON_PARSE", 1, 1);
@ -2328,7 +2328,7 @@ AqlValue Functions::JsonParse(arangodb::aql::Query* query,
/// @brief function PARSE_IDENTIFIER
AqlValue Functions::ParseIdentifier(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "PARSE_IDENTIFIER", 1, 1);
@ -2375,7 +2375,7 @@ AqlValue Functions::ParseIdentifier(
/// @brief function Slice
AqlValue Functions::Slice(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "SLICE", 2, 3);
@ -2441,7 +2441,7 @@ AqlValue Functions::Slice(arangodb::aql::Query* query,
/// @brief function Minus
AqlValue Functions::Minus(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "MINUS", 2);
@ -2508,7 +2508,7 @@ AqlValue Functions::Minus(arangodb::aql::Query* query,
/// @brief function Document
AqlValue Functions::Document(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "DOCUMENT", 1, 2);
@ -2584,7 +2584,7 @@ AqlValue Functions::Document(arangodb::aql::Query* query,
/// @brief function ROUND
AqlValue Functions::Round(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ROUND", 1, 1);
@ -2598,7 +2598,7 @@ AqlValue Functions::Round(arangodb::aql::Query* query,
/// @brief function ABS
AqlValue Functions::Abs(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ABS", 1, 1);
@ -2610,7 +2610,7 @@ AqlValue Functions::Abs(arangodb::aql::Query* query,
/// @brief function CEIL
AqlValue Functions::Ceil(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "CEIL", 1, 1);
@ -2622,7 +2622,7 @@ AqlValue Functions::Ceil(arangodb::aql::Query* query,
/// @brief function FLOOR
AqlValue Functions::Floor(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "FLOOR", 1, 1);
@ -2634,7 +2634,7 @@ AqlValue Functions::Floor(arangodb::aql::Query* query,
/// @brief function SQRT
AqlValue Functions::Sqrt(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "SQRT", 1, 1);
@ -2646,7 +2646,7 @@ AqlValue Functions::Sqrt(arangodb::aql::Query* query,
/// @brief function POW
AqlValue Functions::Pow(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "POW", 2, 2);
@ -2661,7 +2661,7 @@ AqlValue Functions::Pow(arangodb::aql::Query* query,
/// @brief function LOG
AqlValue Functions::Log(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "LOG", 1, 1);
@ -2673,7 +2673,7 @@ AqlValue Functions::Log(arangodb::aql::Query* query,
/// @brief function LOG2
AqlValue Functions::Log2(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "LOG2", 1, 1);
@ -2685,7 +2685,7 @@ AqlValue Functions::Log2(arangodb::aql::Query* query,
/// @brief function LOG10
AqlValue Functions::Log10(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "LOG10", 1, 1);
@ -2697,7 +2697,7 @@ AqlValue Functions::Log10(arangodb::aql::Query* query,
/// @brief function EXP
AqlValue Functions::Exp(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "EXP", 1, 1);
@ -2709,7 +2709,7 @@ AqlValue Functions::Exp(arangodb::aql::Query* query,
/// @brief function EXP2
AqlValue Functions::Exp2(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "EXP2", 1, 1);
@ -2721,7 +2721,7 @@ AqlValue Functions::Exp2(arangodb::aql::Query* query,
/// @brief function SIN
AqlValue Functions::Sin(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "SIN", 1, 1);
@ -2733,7 +2733,7 @@ AqlValue Functions::Sin(arangodb::aql::Query* query,
/// @brief function COS
AqlValue Functions::Cos(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "COS", 1, 1);
@ -2745,7 +2745,7 @@ AqlValue Functions::Cos(arangodb::aql::Query* query,
/// @brief function TAN
AqlValue Functions::Tan(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "TAN", 1, 1);
@ -2757,7 +2757,7 @@ AqlValue Functions::Tan(arangodb::aql::Query* query,
/// @brief function ASIN
AqlValue Functions::Asin(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ASIN", 1, 1);
@ -2769,7 +2769,7 @@ AqlValue Functions::Asin(arangodb::aql::Query* query,
/// @brief function ACOS
AqlValue Functions::Acos(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ACOS", 1, 1);
@ -2781,7 +2781,7 @@ AqlValue Functions::Acos(arangodb::aql::Query* query,
/// @brief function ATAN
AqlValue Functions::Atan(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ATAN", 1, 1);
@ -2793,7 +2793,7 @@ AqlValue Functions::Atan(arangodb::aql::Query* query,
/// @brief function ATAN2
AqlValue Functions::Atan2(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "ATAN2", 2, 2);
@ -2807,7 +2807,7 @@ AqlValue Functions::Atan2(arangodb::aql::Query* query,
/// @brief function RADIANS
AqlValue Functions::Radians(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "RADIANS", 1, 1);
@ -2820,7 +2820,7 @@ AqlValue Functions::Radians(arangodb::aql::Query* query,
/// @brief function DEGREES
AqlValue Functions::Degrees(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "DEGREES", 1, 1);
@ -2833,7 +2833,7 @@ AqlValue Functions::Degrees(arangodb::aql::Query* query,
/// @brief function PI
AqlValue Functions::Pi(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "PI", 0, 0);
@ -2843,7 +2843,7 @@ AqlValue Functions::Pi(arangodb::aql::Query* query,
/// @brief function RAND
AqlValue Functions::Rand(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "RAND", 0, 0);
@ -2853,7 +2853,7 @@ AqlValue Functions::Rand(arangodb::aql::Query* query,
/// @brief function FIRST_DOCUMENT
AqlValue Functions::FirstDocument(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
for (size_t i = 0; i < n; ++i) {
@ -2868,7 +2868,7 @@ AqlValue Functions::FirstDocument(arangodb::aql::Query* query,
/// @brief function FIRST_LIST
AqlValue Functions::FirstList(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
for (size_t i = 0; i < n; ++i) {
@ -2883,7 +2883,7 @@ AqlValue Functions::FirstList(arangodb::aql::Query* query,
/// @brief function PUSH
AqlValue Functions::Push(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "PUSH", 2, 3);
@ -2929,7 +2929,7 @@ AqlValue Functions::Push(arangodb::aql::Query* query,
/// @brief function POP
AqlValue Functions::Pop(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "POP", 1, 1);
AqlValue list = ExtractFunctionParameterValue(trx, parameters, 0);
@ -2964,7 +2964,7 @@ AqlValue Functions::Pop(arangodb::aql::Query* query,
/// @brief function APPEND
AqlValue Functions::Append(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "APPEND", 2, 3);
AqlValue list = ExtractFunctionParameterValue(trx, parameters, 0);
@ -3040,7 +3040,7 @@ AqlValue Functions::Append(arangodb::aql::Query* query,
/// @brief function UNSHIFT
AqlValue Functions::Unshift(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "UNSHIFT", 2, 3);
AqlValue list = ExtractFunctionParameterValue(trx, parameters, 0);
@ -3085,7 +3085,7 @@ AqlValue Functions::Unshift(arangodb::aql::Query* query,
/// @brief function SHIFT
AqlValue Functions::Shift(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "SHIFT", 1, 1);
@ -3121,7 +3121,7 @@ AqlValue Functions::Shift(arangodb::aql::Query* query,
/// @brief function REMOVE_VALUE
AqlValue Functions::RemoveValue(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "REMOVE_VALUE", 2, 3);
@ -3179,7 +3179,7 @@ AqlValue Functions::RemoveValue(arangodb::aql::Query* query,
/// @brief function REMOVE_VALUES
AqlValue Functions::RemoveValues(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "REMOVE_VALUES", 2, 2);
@ -3223,7 +3223,7 @@ AqlValue Functions::RemoveValues(arangodb::aql::Query* query,
/// @brief function REMOVE_NTH
AqlValue Functions::RemoveNth(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "REMOVE_NTH", 2, 2);
@ -3273,7 +3273,7 @@ AqlValue Functions::RemoveNth(arangodb::aql::Query* query,
/// @brief function NOT_NULL
AqlValue Functions::NotNull(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
size_t const n = parameters.size();
for (size_t i = 0; i < n; ++i) {
@ -3287,7 +3287,7 @@ AqlValue Functions::NotNull(arangodb::aql::Query* query,
/// @brief function CURRENT_DATABASE
AqlValue Functions::CurrentDatabase(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "CURRENT_DATABASE", 0, 0);
@ -3298,7 +3298,7 @@ AqlValue Functions::CurrentDatabase(
/// @brief function COLLECTION_COUNT
AqlValue Functions::CollectionCount(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "COLLECTION_COUNT", 1, 1);
@ -3328,7 +3328,7 @@ AqlValue Functions::CollectionCount(
/// @brief function VARIANCE_SAMPLE
AqlValue Functions::VarianceSample(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "VARIANCE_SAMPLE", 1, 1);
@ -3357,7 +3357,7 @@ AqlValue Functions::VarianceSample(
/// @brief function VARIANCE_POPULATION
AqlValue Functions::VariancePopulation(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "VARIANCE_POPULATION", 1, 1);
@ -3387,7 +3387,7 @@ AqlValue Functions::VariancePopulation(
/// @brief function STDDEV_SAMPLE
AqlValue Functions::StdDevSample(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "STDDEV_SAMPLE", 1, 1);
@ -3416,7 +3416,7 @@ AqlValue Functions::StdDevSample(
/// @brief function STDDEV_POPULATION
AqlValue Functions::StdDevPopulation(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "STDDEV_POPULATION", 1, 1);
@ -3445,7 +3445,7 @@ AqlValue Functions::StdDevPopulation(
/// @brief function MEDIAN
AqlValue Functions::Median(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "MEDIAN", 1, 1);
@ -3476,7 +3476,7 @@ AqlValue Functions::Median(arangodb::aql::Query* query,
/// @brief function PERCENTILE
AqlValue Functions::Percentile(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "PERCENTILE", 2, 3);
@ -3573,7 +3573,7 @@ AqlValue Functions::Percentile(arangodb::aql::Query* query,
/// @brief function RANGE
AqlValue Functions::Range(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "RANGE", 2, 3);
@ -3622,7 +3622,7 @@ AqlValue Functions::Range(arangodb::aql::Query* query,
/// @brief function POSITION
AqlValue Functions::Position(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "POSITION", 2, 3);
@ -3670,7 +3670,7 @@ AqlValue Functions::Position(arangodb::aql::Query* query,
/// @brief function IS_SAME_COLLECTION
AqlValue Functions::IsSameCollection(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "IS_SAME_COLLECTION", 2, 2);

View File

@ -29,7 +29,7 @@
#include "Aql/AqlValue.h"
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace basics {
class VPackStringBufferAdapter;
@ -43,7 +43,7 @@ typedef std::function<bool()> ExecutionCondition;
typedef SmallVector<AqlValue> VPackFunctionParameters;
typedef std::function<AqlValue(arangodb::aql::Query*, Transaction*,
typedef std::function<AqlValue(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&)>
FunctionImplementation;
@ -61,18 +61,18 @@ struct Functions {
/// @brief extract a function parameter from the arguments
static AqlValue ExtractFunctionParameterValue(
Transaction*, VPackFunctionParameters const& parameters,
TransactionMethods*, VPackFunctionParameters const& parameters,
size_t position);
/// @brief extra a collection name from an AqlValue
static std::string ExtractCollectionName(
Transaction* trx, VPackFunctionParameters const& parameters,
TransactionMethods* trx, VPackFunctionParameters const& parameters,
size_t position);
/// @brief extract attribute names from the arguments
static void ExtractKeys(std::unordered_set<std::string>& names,
arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters,
size_t startParameter, char const* functionName);
@ -80,7 +80,7 @@ struct Functions {
/// Works for an array of objects as first parameter or arbitrary many
/// object parameters
static AqlValue MergeParameters(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters,
char const* funcName, bool recursive);
@ -94,210 +94,210 @@ struct Functions {
static void DestroyThreadContext();
/// @brief helper function. not callable as a "normal" AQL function
static void Stringify(Transaction* trx,
static void Stringify(TransactionMethods* trx,
arangodb::basics::VPackStringBufferAdapter& buffer,
VPackSlice const& slice);
static AqlValue IsNull(arangodb::aql::Query*, Transaction*,
static AqlValue IsNull(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsBool(arangodb::aql::Query*, Transaction*,
static AqlValue IsBool(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsNumber(arangodb::aql::Query*, Transaction*,
static AqlValue IsNumber(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsString(arangodb::aql::Query*, Transaction*,
static AqlValue IsString(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsArray(arangodb::aql::Query*, Transaction*,
static AqlValue IsArray(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsObject(arangodb::aql::Query*, Transaction*,
static AqlValue IsObject(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Typename(arangodb::aql::Query*, Transaction*,
static AqlValue Typename(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ToNumber(arangodb::aql::Query*, Transaction*,
static AqlValue ToNumber(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ToString(arangodb::aql::Query*, Transaction*,
static AqlValue ToString(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ToBool(arangodb::aql::Query*, Transaction*,
static AqlValue ToBool(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ToArray(arangodb::aql::Query*, Transaction*,
static AqlValue ToArray(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Length(arangodb::aql::Query*, Transaction*,
static AqlValue Length(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue First(arangodb::aql::Query*, Transaction*,
static AqlValue First(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Last(arangodb::aql::Query*, Transaction*,
static AqlValue Last(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Nth(arangodb::aql::Query*, Transaction*,
static AqlValue Nth(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Contains(arangodb::aql::Query*, Transaction*,
static AqlValue Contains(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Concat(arangodb::aql::Query*, Transaction*,
static AqlValue Concat(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ConcatSeparator(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Like(arangodb::aql::Query*, Transaction*,
static AqlValue Like(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RegexTest(arangodb::aql::Query*, Transaction*,
static AqlValue RegexTest(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RegexReplace(arangodb::aql::Query*, Transaction*,
static AqlValue RegexReplace(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Passthru(arangodb::aql::Query*, Transaction*,
static AqlValue Passthru(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Unset(arangodb::aql::Query*, Transaction*,
static AqlValue Unset(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue UnsetRecursive(arangodb::aql::Query*, Transaction*,
static AqlValue UnsetRecursive(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Keep(arangodb::aql::Query*, Transaction*,
static AqlValue Keep(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Merge(arangodb::aql::Query*, Transaction*,
static AqlValue Merge(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue MergeRecursive(arangodb::aql::Query*, Transaction*,
static AqlValue MergeRecursive(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Has(arangodb::aql::Query*, Transaction*,
static AqlValue Has(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Attributes(arangodb::aql::Query*, Transaction*,
static AqlValue Attributes(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Values(arangodb::aql::Query*, Transaction*,
static AqlValue Values(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Min(arangodb::aql::Query*, Transaction*,
static AqlValue Min(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Max(arangodb::aql::Query*, Transaction*,
static AqlValue Max(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Sum(arangodb::aql::Query*, Transaction*,
static AqlValue Sum(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Average(arangodb::aql::Query*, Transaction*,
static AqlValue Average(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RandomToken(arangodb::aql::Query*, Transaction*,
static AqlValue RandomToken(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Md5(arangodb::aql::Query*, Transaction*,
static AqlValue Md5(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Sha1(arangodb::aql::Query*, Transaction*,
static AqlValue Sha1(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Hash(arangodb::aql::Query*, Transaction*,
static AqlValue Hash(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Unique(arangodb::aql::Query*, Transaction*,
static AqlValue Unique(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue SortedUnique(arangodb::aql::Query*, Transaction*,
static AqlValue SortedUnique(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Union(arangodb::aql::Query*, Transaction*,
static AqlValue Union(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue UnionDistinct(arangodb::aql::Query*, Transaction*,
static AqlValue UnionDistinct(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Intersection(arangodb::aql::Query*, Transaction*,
static AqlValue Intersection(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Outersection(arangodb::aql::Query*, Transaction*,
static AqlValue Outersection(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Distance(arangodb::aql::Query*, Transaction*,
static AqlValue Distance(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Flatten(arangodb::aql::Query*, Transaction*,
static AqlValue Flatten(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Zip(arangodb::aql::Query*, Transaction*,
static AqlValue Zip(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue JsonStringify(arangodb::aql::Query*, Transaction*,
static AqlValue JsonStringify(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue JsonParse(arangodb::aql::Query*, Transaction*,
static AqlValue JsonParse(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue ParseIdentifier(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Slice(arangodb::aql::Query*, Transaction*,
static AqlValue Slice(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Minus(arangodb::aql::Query*, Transaction*,
static AqlValue Minus(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Document(arangodb::aql::Query*, Transaction*,
static AqlValue Document(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Round(arangodb::aql::Query*, Transaction*,
static AqlValue Round(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Abs(arangodb::aql::Query*, Transaction*,
static AqlValue Abs(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Ceil(arangodb::aql::Query*, Transaction*,
static AqlValue Ceil(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Floor(arangodb::aql::Query*, Transaction*,
static AqlValue Floor(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Sqrt(arangodb::aql::Query*, Transaction*,
static AqlValue Sqrt(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Pow(arangodb::aql::Query*, Transaction*,
static AqlValue Pow(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Log(arangodb::aql::Query*, Transaction*,
static AqlValue Log(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Log2(arangodb::aql::Query*, Transaction*,
static AqlValue Log2(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Log10(arangodb::aql::Query*, Transaction*,
static AqlValue Log10(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Exp(arangodb::aql::Query*, Transaction*,
static AqlValue Exp(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Exp2(arangodb::aql::Query*, Transaction*,
static AqlValue Exp2(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Sin(arangodb::aql::Query*, Transaction*,
static AqlValue Sin(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Cos(arangodb::aql::Query*, Transaction*,
static AqlValue Cos(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Tan(arangodb::aql::Query*, Transaction*,
static AqlValue Tan(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Asin(arangodb::aql::Query*, Transaction*,
static AqlValue Asin(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Acos(arangodb::aql::Query*, Transaction*,
static AqlValue Acos(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Atan(arangodb::aql::Query*, Transaction*,
static AqlValue Atan(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Atan2(arangodb::aql::Query*, Transaction*,
static AqlValue Atan2(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Radians(arangodb::aql::Query*, Transaction*,
static AqlValue Radians(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Degrees(arangodb::aql::Query*, Transaction*,
static AqlValue Degrees(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Pi(arangodb::aql::Query*, Transaction*,
static AqlValue Pi(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Rand(arangodb::aql::Query*, Transaction*,
static AqlValue Rand(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue FirstDocument(arangodb::aql::Query*, Transaction*,
static AqlValue FirstDocument(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue FirstList(arangodb::aql::Query*, Transaction*,
static AqlValue FirstList(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Push(arangodb::aql::Query*, Transaction*,
static AqlValue Push(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Pop(arangodb::aql::Query*, Transaction*,
static AqlValue Pop(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Append(arangodb::aql::Query*, Transaction*,
static AqlValue Append(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Unshift(arangodb::aql::Query*, Transaction*,
static AqlValue Unshift(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Shift(arangodb::aql::Query*, Transaction*,
static AqlValue Shift(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RemoveValue(arangodb::aql::Query*, Transaction*,
static AqlValue RemoveValue(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RemoveValues(arangodb::aql::Query*, Transaction*,
static AqlValue RemoveValues(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue RemoveNth(arangodb::aql::Query*, Transaction*,
static AqlValue RemoveNth(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue NotNull(arangodb::aql::Query*, Transaction*,
static AqlValue NotNull(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue CurrentDatabase(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue CollectionCount(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue VarianceSample(arangodb::aql::Query*, Transaction*,
static AqlValue VarianceSample(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue VariancePopulation(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue StdDevSample(arangodb::aql::Query*, Transaction*,
static AqlValue StdDevSample(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue StdDevPopulation(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Median(arangodb::aql::Query*, Transaction*,
static AqlValue Median(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Percentile(arangodb::aql::Query*, Transaction*,
static AqlValue Percentile(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Range(arangodb::aql::Query*, Transaction*,
static AqlValue Range(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Position(arangodb::aql::Query*, Transaction*,
static AqlValue Position(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue IsSameCollection(arangodb::aql::Query*,
Transaction*,
TransactionMethods*,
VPackFunctionParameters const&);
};
}

View File

@ -698,7 +698,7 @@ arangodb::OperationCursor* IndexBlock::orderCursor(size_t currentIndex) {
node->outVariable(),
_mmdr.get(),
UINT64_MAX,
Transaction::defaultBatchSize(),
TransactionMethods::defaultBatchSize(),
node->_reverse
));
} else {

View File

@ -124,7 +124,7 @@ class IndexBlock final : public ExecutionBlock {
size_t _currentIndex;
/// @brief _indexes holds all Indexes used in this block
std::vector<Transaction::IndexHandle> _indexes;
std::vector<TransactionMethods::IndexHandle> _indexes;
/// @brief _nonConstExpressions, list of all non const expressions, mapped
/// by their _condition node path indexes

View File

@ -37,7 +37,7 @@ using namespace arangodb::aql;
/// @brief constructor
IndexNode::IndexNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
Collection const* collection, Variable const* outVariable,
std::vector<Transaction::IndexHandle> const& indexes,
std::vector<TransactionMethods::IndexHandle> const& indexes,
Condition* condition, bool reverse)
: ExecutionNode(plan, id),
_vocbase(vocbase),
@ -53,7 +53,7 @@ IndexNode::IndexNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
}
/// @brief return the transaction for the node
Transaction* IndexNode::trx() const {
TransactionMethods* IndexNode::trx() const {
return _plan->getAst()->query()->trx();
};

View File

@ -52,7 +52,7 @@ class IndexNode : public ExecutionNode {
public:
IndexNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
Collection const* collection, Variable const* outVariable,
std::vector<Transaction::IndexHandle> const& indexes,
std::vector<TransactionMethods::IndexHandle> const& indexes,
Condition* condition, bool reverse);
IndexNode(ExecutionPlan*, arangodb::velocypack::Slice const& base);
@ -75,7 +75,7 @@ class IndexNode : public ExecutionNode {
Condition* condition() const { return _condition; }
/// @brief return the transaction for the node
Transaction* trx() const;
TransactionMethods* trx() const;
/// @brief whether or not all indexes are accessed in reverse order
bool reverse() const { return _reverse; }
@ -107,7 +107,7 @@ class IndexNode : public ExecutionNode {
double estimateCost(size_t&) const override final;
/// @brief getIndexes, hand out the indexes used
std::vector<Transaction::IndexHandle> const& getIndexes() const { return _indexes; }
std::vector<TransactionMethods::IndexHandle> const& getIndexes() const { return _indexes; }
private:
/// @brief the database
@ -120,7 +120,7 @@ class IndexNode : public ExecutionNode {
Variable const* _outVariable;
/// @brief the index
std::vector<Transaction::IndexHandle> _indexes;
std::vector<TransactionMethods::IndexHandle> _indexes;
/// @brief the index(es) condition
Condition* _condition;

View File

@ -1773,7 +1773,7 @@ struct SortToIndexNode final : public WalkerWorker<ExecutionNode> {
// now check if any of the collection's indexes covers it
Variable const* outVariable = enumerateCollectionNode->outVariable();
std::vector<Transaction::IndexHandle> usedIndexes;
std::vector<TransactionMethods::IndexHandle> usedIndexes;
auto trx = _plan->getAst()->query()->trx();
size_t coveredAttributes = 0;
auto resultPair = trx->getIndexForSortCondition(
@ -1829,7 +1829,7 @@ struct SortToIndexNode final : public WalkerWorker<ExecutionNode> {
TRI_ASSERT(outVariable != nullptr);
auto index = indexes[0];
Transaction* trx = indexNode->trx();
TransactionMethods* trx = indexNode->trx();
bool isSorted = false;
bool isSparse = false;
std::vector<std::vector<arangodb::basics::AttributeName>> fields =
@ -4395,7 +4395,7 @@ bool applyGeoOptimization(bool near, ExecutionPlan* plan, MMFilesGeoIndexInfo& f
auto inode = new IndexNode(
plan, plan->nextId(), first.collectionNode->vocbase(),
first.collectionNode->collection(), first.collectionNode->outVariable(),
std::vector<Transaction::IndexHandle>{Transaction::IndexHandle{first.index}},
std::vector<TransactionMethods::IndexHandle>{TransactionMethods::IndexHandle{first.index}},
condition.get(), false);
plan->registerNode(inode);
condition.release();

View File

@ -42,7 +42,7 @@
struct TRI_vocbase_t;
namespace arangodb {
class Transaction;
class TransactionMethods;
class TransactionContext;
namespace velocypack {
@ -121,7 +121,7 @@ class Query {
public:
/// @brief Inject a transaction from outside. Use with care!
void injectTransaction (Transaction* trx) {
void injectTransaction (TransactionMethods* trx) {
_trx = trx;
init();
}
@ -265,7 +265,7 @@ class Query {
void engine(ExecutionEngine* engine) { _engine = engine; }
/// @brief return the transaction, if prepared
inline Transaction* trx() { return _trx; }
inline TransactionMethods* trx() { return _trx; }
/// @brief get the plan for the query
ExecutionPlan* plan() const { return _plan.get(); }
@ -443,7 +443,7 @@ class Query {
/// @brief the transaction object, in a distributed query every part of
/// the query has its own transaction object. The transaction object is
/// created in the prepare method.
Transaction* _trx;
TransactionMethods* _trx;
/// @brief the ExecutionEngine object, if the query is prepared
ExecutionEngine* _engine;

View File

@ -93,9 +93,9 @@ void QueryRegistry::insert(QueryId id, Query* query, double ttl) {
_queries.find(vocbase->name())->second.end());
// If we have set _makeNolockHeaders, we need to unset it:
if (Transaction::_makeNolockHeaders != nullptr) {
if (Transaction::_makeNolockHeaders == query->engine()->lockedShards()) {
Transaction::_makeNolockHeaders = nullptr;
if (TransactionMethods::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders == query->engine()->lockedShards()) {
TransactionMethods::_makeNolockHeaders = nullptr;
}
// else {
// We have not set it, just leave it alone. This happens in particular
@ -131,9 +131,9 @@ Query* QueryRegistry::open(TRI_vocbase_t* vocbase, QueryId id) {
// If we had set _makeNolockHeaders, we need to reset it:
if (qi->_query->engine()->lockedShards() != nullptr) {
if (Transaction::_makeNolockHeaders == nullptr) {
if (TransactionMethods::_makeNolockHeaders == nullptr) {
// std::cout << "Setting _makeNolockHeaders\n";
Transaction::_makeNolockHeaders = qi->_query->engine()->lockedShards();
TransactionMethods::_makeNolockHeaders = qi->_query->engine()->lockedShards();
} else {
LOG_TOPIC(WARN, arangodb::Logger::FIXME) << "Found strange lockedShards in thread, not overwriting!";
}
@ -164,16 +164,16 @@ void QueryRegistry::close(TRI_vocbase_t* vocbase, QueryId id, double ttl) {
}
// If we have set _makeNolockHeaders, we need to unset it:
if (Transaction::_makeNolockHeaders != nullptr) {
if (Transaction::_makeNolockHeaders ==
if (TransactionMethods::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders ==
qi->_query->engine()->lockedShards()) {
// std::cout << "Resetting _makeNolockHeaders to nullptr\n";
Transaction::_makeNolockHeaders = nullptr;
TransactionMethods::_makeNolockHeaders = nullptr;
} else {
if (Transaction::_makeNolockHeaders != nullptr) {
if (Transaction::_makeNolockHeaders ==
if (TransactionMethods::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders ==
qi->_query->engine()->lockedShards()) {
Transaction::_makeNolockHeaders = nullptr;
TransactionMethods::_makeNolockHeaders = nullptr;
}
// else {
// We have not set it, just leave it alone. This happens in particular
@ -210,8 +210,8 @@ void QueryRegistry::destroy(std::string const& vocbase, QueryId id,
if (!qi->_isOpen) {
// If we had set _makeNolockHeaders, we need to reset it:
if (qi->_query->engine()->lockedShards() != nullptr) {
if (Transaction::_makeNolockHeaders == nullptr) {
Transaction::_makeNolockHeaders = qi->_query->engine()->lockedShards();
if (TransactionMethods::_makeNolockHeaders == nullptr) {
TransactionMethods::_makeNolockHeaders = qi->_query->engine()->lockedShards();
} else {
LOG_TOPIC(WARN, arangodb::Logger::FIXME) << "Found strange lockedShards in thread, not overwriting!";
}

View File

@ -91,9 +91,9 @@ struct ConstDistanceExpanderLocal {
if (collection->readDocument(_block->transaction(), *mmdr, element)) {
VPackSlice edge(mmdr->vpack());
VPackSlice from =
Transaction::extractFromFromDocument(edge);
TransactionMethods::extractFromFromDocument(edge);
if (from == v) {
VPackSlice to = Transaction::extractToFromDocument(edge);
VPackSlice to = TransactionMethods::extractToFromDocument(edge);
if (to != v) {
resEdges.emplace_back(edge);
neighbors.emplace_back(to);
@ -146,9 +146,9 @@ struct ConstDistanceExpanderCluster {
VPackSlice edges = result.slice().get("edges");
for (auto const& edge : VPackArrayIterator(edges)) {
VPackSlice from = Transaction::extractFromFromDocument(edge);
VPackSlice from = TransactionMethods::extractFromFromDocument(edge);
if (from == v) {
VPackSlice to = Transaction::extractToFromDocument(edge);
VPackSlice to = TransactionMethods::extractToFromDocument(edge);
if (to != v) {
resEdges.emplace_back(edge);
neighbors.emplace_back(to);
@ -229,8 +229,8 @@ struct EdgeWeightExpanderLocal {
if (collection->readDocument(_block->transaction(), *mmdr, element)) {
VPackSlice edge(mmdr->vpack());
VPackSlice from =
Transaction::extractFromFromDocument(edge);
VPackSlice to = Transaction::extractToFromDocument(edge);
TransactionMethods::extractFromFromDocument(edge);
VPackSlice to = TransactionMethods::extractToFromDocument(edge);
double currentWeight = edgeCollection->weightEdge(edge);
if (from == source) {
inserter(candidates, result, from, to, currentWeight, edge);
@ -307,8 +307,8 @@ struct EdgeWeightExpanderCluster {
VPackSlice edges = edgesBuilder.slice().get("edges");
for (auto const& edge : VPackArrayIterator(edges)) {
VPackSlice from = Transaction::extractFromFromDocument(edge);
VPackSlice to = Transaction::extractToFromDocument(edge);
VPackSlice from = TransactionMethods::extractFromFromDocument(edge);
VPackSlice to = TransactionMethods::extractToFromDocument(edge);
double currentWeight = edgeCollection->weightEdge(edge);
if (from == source) {
inserter(from, to, currentWeight, edge);

View File

@ -29,7 +29,7 @@
#include "Aql/SortNode.h"
namespace arangodb {
class Transaction;
class TransactionMethods;
namespace aql {
@ -54,7 +54,7 @@ class SortBlock final : public ExecutionBlock {
/// @brief OurLessThan
class OurLessThan {
public:
OurLessThan(Transaction* trx,
OurLessThan(TransactionMethods* trx,
std::deque<AqlItemBlock*>& buffer,
std::vector<std::pair<RegisterId, bool>>& sortRegisters)
: _trx(trx),
@ -65,7 +65,7 @@ class SortBlock final : public ExecutionBlock {
std::pair<size_t, size_t> const& b) const;
private:
Transaction* _trx;
TransactionMethods* _trx;
std::deque<AqlItemBlock*>& _buffer;
std::vector<std::pair<RegisterId, bool>>& _sortRegisters;
};

View File

@ -59,7 +59,7 @@ V8Expression::~V8Expression() {
/// @brief execute the expression
AqlValue V8Expression::execute(v8::Isolate* isolate, Query* query,
Transaction* trx,
TransactionMethods* trx,
ExpressionContext* context,
bool& mustDestroy) {
bool const hasRestrictions = !_attributeRestrictions.empty();

View File

@ -64,7 +64,7 @@ struct V8Expression {
/// @brief execute the expression
AqlValue execute(v8::Isolate* isolate, Query* query,
Transaction*, ExpressionContext* context, bool& mustDestroy);
TransactionMethods*, ExpressionContext* context, bool& mustDestroy);
/// @brief the isolate used when executing and destroying the expression
v8::Isolate* isolate;

View File

@ -1079,11 +1079,11 @@ std::pair<ClusterCommResult*, HttpRequest*> ClusterComm::prepareRequest(std::str
std::unordered_map<std::string, std::string> headersCopy(headerFields);
if (destination.substr(0, 6) == "shard:") {
if (Transaction::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders != nullptr) {
// LOCKING-DEBUG
// std::cout << "Found Nolock header\n";
auto it = Transaction::_makeNolockHeaders->find(result->shardID);
if (it != Transaction::_makeNolockHeaders->end()) {
auto it = TransactionMethods::_makeNolockHeaders->find(result->shardID);
if (it != TransactionMethods::_makeNolockHeaders->end()) {
// LOCKING-DEBUG
// std::cout << "Found our shard\n";
headersCopy["X-Arango-Nolock"] = result->shardID;

View File

@ -962,7 +962,7 @@ int deleteDocumentOnCoordinator(
VPackSlice const node, VPackValueLength const index) -> int {
// Sort out the _key attribute and identify the shard responsible for it.
StringRef _key(Transaction::extractKeyPart(node));
StringRef _key(TransactionMethods::extractKeyPart(node));
ShardID shardID;
if (_key.empty()) {
// We have invalid input at this point.

View File

@ -37,7 +37,7 @@ ClusterTraverser::ClusterTraverser(
arangodb::traverser::TraverserOptions* opts,
ManagedDocumentResult* mmdr,
std::unordered_map<ServerID, traverser::TraverserEngineID> const* engines,
std::string const& dbname, Transaction* trx)
std::string const& dbname, TransactionMethods* trx)
: Traverser(opts, trx, mmdr), _dbname(dbname), _engines(engines) {
_opts->linkTraverser(this);
}

View File

@ -32,7 +32,7 @@
namespace arangodb {
class CollectionNameResolver;
class ManagedDocumentResult;
class Transaction;
class TransactionMethods;
namespace traverser {
class ClusterEdgeCursor;
@ -47,7 +47,7 @@ class ClusterTraverser final : public Traverser {
TraverserOptions* opts,
ManagedDocumentResult* mmdr,
std::unordered_map<ServerID, traverser::TraverserEngineID> const* engines,
std::string const& dbname, Transaction* trx);
std::string const& dbname, TransactionMethods* trx);
~ClusterTraverser() {}

View File

@ -32,7 +32,7 @@ struct TRI_vocbase_t;
namespace arangodb {
class Transaction;
class TransactionMethods;
class TransactionContext;
namespace aql {
@ -85,7 +85,7 @@ class BaseTraverserEngine {
protected:
std::unique_ptr<TraverserOptions> _opts;
arangodb::aql::Query* _query;
Transaction* _trx;
TransactionMethods* _trx;
arangodb::aql::Collections _collections;
std::unordered_set<std::string> _locked;
std::unordered_map<std::string, std::vector<std::string>> _vertexShards;

View File

@ -494,7 +494,7 @@ bool Index::implicitlyUnique() const {
}
void Index::batchInsert(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::pair<TRI_voc_rid_t, arangodb::velocypack::Slice>> const&
documents,
arangodb::basics::LocalTaskQueue* queue) {
@ -520,7 +520,7 @@ int Index::drop() {
}
/// @brief default implementation for sizeHint
int Index::sizeHint(Transaction*, size_t) {
int Index::sizeHint(TransactionMethods*, size_t) {
// do nothing
return TRI_ERROR_NO_ERROR;
}
@ -555,7 +555,7 @@ bool Index::supportsSortCondition(arangodb::aql::SortCondition const*,
}
/// @brief default iterator factory method. does not create an iterator
IndexIterator* Index::iteratorForCondition(Transaction*,
IndexIterator* Index::iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,

View File

@ -53,7 +53,7 @@ class SortCondition;
struct Variable;
}
class Transaction;
class TransactionMethods;
}
namespace arangodb {
@ -238,13 +238,13 @@ class Index {
virtual void toVelocyPackFigures(arangodb::velocypack::Builder&) const;
std::shared_ptr<arangodb::velocypack::Builder> toVelocyPackFigures() const;
virtual int insert(Transaction*, TRI_voc_rid_t revisionId,
virtual int insert(TransactionMethods*, TRI_voc_rid_t revisionId,
arangodb::velocypack::Slice const&, bool isRollback) = 0;
virtual int remove(Transaction*, TRI_voc_rid_t revisionId,
virtual int remove(TransactionMethods*, TRI_voc_rid_t revisionId,
arangodb::velocypack::Slice const&, bool isRollback) = 0;
virtual void batchInsert(
Transaction*,
TransactionMethods*,
std::vector<std::pair<TRI_voc_rid_t, arangodb::velocypack::Slice>> const&,
arangodb::basics::LocalTaskQueue* queue = nullptr);
@ -256,7 +256,7 @@ class Index {
virtual int drop();
// give index a hint about the expected size
virtual int sizeHint(Transaction*, size_t);
virtual int sizeHint(TransactionMethods*, size_t);
virtual bool hasBatchInsert() const;
@ -268,7 +268,7 @@ class Index {
arangodb::aql::Variable const*, size_t,
double&, size_t&) const;
virtual IndexIterator* iteratorForCondition(Transaction*,
virtual IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,

View File

@ -30,7 +30,7 @@
using namespace arangodb;
IndexIterator::IndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::Index const* index)
: _collection(collection),

View File

@ -55,7 +55,7 @@
namespace arangodb {
class Index;
class LogicalCollection;
class Transaction;
class TransactionMethods;
/// @brief a base class to iterate over the index. An iterator is requested
/// at the index itself
@ -71,14 +71,14 @@ class IndexIterator {
IndexIterator& operator=(IndexIterator const&) = delete;
IndexIterator() = delete;
IndexIterator(LogicalCollection*, Transaction*, ManagedDocumentResult*, arangodb::Index const*);
IndexIterator(LogicalCollection*, TransactionMethods*, ManagedDocumentResult*, arangodb::Index const*);
virtual ~IndexIterator();
virtual char const* typeName() const = 0;
LogicalCollection* collection() const { return _collection; }
Transaction* transaction() const { return _trx; }
TransactionMethods* transaction() const { return _trx; }
virtual bool hasExtra() const;
@ -93,7 +93,7 @@ class IndexIterator {
protected:
LogicalCollection* _collection;
Transaction* _trx;
TransactionMethods* _trx;
ManagedDocumentResult* _mmdr;
IndexLookupContext _context;
bool _responsible;
@ -102,7 +102,7 @@ class IndexIterator {
/// @brief Special iterator if the condition cannot have any result
class EmptyIndexIterator final : public IndexIterator {
public:
EmptyIndexIterator(LogicalCollection* collection, Transaction* trx, ManagedDocumentResult* mmdr, arangodb::Index const* index)
EmptyIndexIterator(LogicalCollection* collection, TransactionMethods* trx, ManagedDocumentResult* mmdr, arangodb::Index const* index)
: IndexIterator(collection, trx, mmdr, index) {}
~EmptyIndexIterator() {}
@ -128,7 +128,7 @@ class EmptyIndexIterator final : public IndexIterator {
class MultiIndexIterator final : public IndexIterator {
public:
MultiIndexIterator(LogicalCollection* collection, Transaction* trx,
MultiIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::Index const* index,
std::vector<IndexIterator*> const& iterators)

View File

@ -37,7 +37,7 @@ namespace arangodb {
class IndexLookupContext {
public:
IndexLookupContext() = delete;
IndexLookupContext(Transaction* trx, LogicalCollection* collection, ManagedDocumentResult* result, size_t numFields)
IndexLookupContext(TransactionMethods* trx, LogicalCollection* collection, ManagedDocumentResult* result, size_t numFields)
: _trx(trx), _collection(collection), _result(result), _numFields(numFields) {
TRI_ASSERT(_trx != nullptr);
TRI_ASSERT(_collection != nullptr);
@ -61,7 +61,7 @@ class IndexLookupContext {
inline size_t numFields() const { return _numFields; }
private:
Transaction* _trx;
TransactionMethods* _trx;
LogicalCollection* _collection;
ManagedDocumentResult* _result;
size_t const _numFields;

View File

@ -48,7 +48,7 @@ static ExecutionCondition const NotInCoordinator = [] {
!arangodb::ServerState::instance()->isCoordinator();
};
static AqlValue buildGeoResult(Transaction* trx,
static AqlValue buildGeoResult(TransactionMethods* trx,
LogicalCollection* collection,
arangodb::aql::Query* query,
GeoCoordinates* cors,
@ -134,7 +134,7 @@ static AqlValue buildGeoResult(Transaction* trx,
/// @brief Load geoindex for collection name
static arangodb::MMFilesGeoIndex* getGeoIndex(
Transaction* trx, TRI_voc_cid_t const& cid,
TransactionMethods* trx, TRI_voc_cid_t const& cid,
std::string const& collectionName) {
// NOTE:
// Due to trx lock the shared_index stays valid
@ -172,7 +172,7 @@ static arangodb::MMFilesGeoIndex* getGeoIndex(
/// @brief function FULLTEXT
AqlValue MMFilesAqlFunctions::Fulltext(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "FULLTEXT", 3, 4);
@ -311,7 +311,7 @@ AqlValue MMFilesAqlFunctions::Fulltext(
/// @brief function NEAR
AqlValue MMFilesAqlFunctions::Near(arangodb::aql::Query* query,
Transaction* trx,
TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "NEAR", 3, 5);
@ -374,7 +374,7 @@ AqlValue MMFilesAqlFunctions::Near(arangodb::aql::Query* query,
/// @brief function WITHIN
AqlValue MMFilesAqlFunctions::Within(
arangodb::aql::Query* query, Transaction* trx,
arangodb::aql::Query* query, TransactionMethods* trx,
VPackFunctionParameters const& parameters) {
ValidateParameters(parameters, "WITHIN", 4, 5);

View File

@ -31,13 +31,13 @@ namespace aql {
struct Function;
struct MMFilesAqlFunctions : public Functions {
static AqlValue Fulltext(arangodb::aql::Query*, Transaction*,
static AqlValue Fulltext(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Near(arangodb::aql::Query*, Transaction*,
static AqlValue Near(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static AqlValue Within(arangodb::aql::Query*, Transaction*,
static AqlValue Within(arangodb::aql::Query*, TransactionMethods*,
VPackFunctionParameters const&);
static void RegisterFunctions();

View File

@ -72,7 +72,7 @@ int MMFilesCollection::OpenIteratorHandleDocumentMarker(TRI_df_marker_t const* m
MMFilesCollection::OpenIteratorState* state) {
LogicalCollection* collection = state->_collection;
MMFilesCollection* c = static_cast<MMFilesCollection*>(collection->getPhysical());
Transaction* trx = state->_trx;
TransactionMethods* trx = state->_trx;
TRI_ASSERT(trx != nullptr);
VPackSlice const slice(reinterpret_cast<char const*>(marker) + MMFilesDatafileHelper::VPackOffset(TRI_DF_MARKER_VPACK_DOCUMENT));
@ -81,7 +81,7 @@ int MMFilesCollection::OpenIteratorHandleDocumentMarker(TRI_df_marker_t const* m
VPackSlice keySlice;
TRI_voc_rid_t revisionId;
Transaction::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
TransactionMethods::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
c->setRevision(revisionId, false);
@ -168,14 +168,14 @@ int MMFilesCollection::OpenIteratorHandleDeletionMarker(TRI_df_marker_t const* m
MMFilesCollection::OpenIteratorState* state) {
LogicalCollection* collection = state->_collection;
MMFilesCollection* c = static_cast<MMFilesCollection*>(collection->getPhysical());
Transaction* trx = state->_trx;
TransactionMethods* trx = state->_trx;
VPackSlice const slice(reinterpret_cast<char const*>(marker) + MMFilesDatafileHelper::VPackOffset(TRI_DF_MARKER_VPACK_REMOVE));
VPackSlice keySlice;
TRI_voc_rid_t revisionId;
Transaction::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
TransactionMethods::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
c->setRevision(revisionId, false);
if (state->_trackKeys) {
@ -1088,7 +1088,7 @@ void MMFilesCollection::finishCompaction() {
}
/// @brief iterate all markers of the collection
int MMFilesCollection::iterateMarkersOnLoad(Transaction* trx) {
int MMFilesCollection::iterateMarkersOnLoad(TransactionMethods* trx) {
// initialize state for iteration
OpenIteratorState openState(_logicalCollection, trx);

View File

@ -54,7 +54,7 @@ class MMFilesCollection final : public PhysicalCollection {
TRI_voc_fid_t _fid;
std::unordered_map<TRI_voc_fid_t, DatafileStatisticsContainer*> _stats;
DatafileStatisticsContainer* _dfi;
Transaction* _trx;
TransactionMethods* _trx;
ManagedDocumentResult _mmdr;
IndexLookupContext _context;
uint64_t _deletions;
@ -63,7 +63,7 @@ class MMFilesCollection final : public PhysicalCollection {
int64_t _initialCount;
bool const _trackKeys;
OpenIteratorState(LogicalCollection* collection, Transaction* trx)
OpenIteratorState(LogicalCollection* collection, TransactionMethods* trx)
: _collection(collection),
_primaryIndex(collection->primaryIndex()),
_tid(0),
@ -161,7 +161,7 @@ class MMFilesCollection final : public PhysicalCollection {
Ditches* ditches() const override { return &_ditches; }
/// @brief iterate all markers of a collection on load
int iterateMarkersOnLoad(Transaction* trx) override;
int iterateMarkersOnLoad(TransactionMethods* trx) override;
private:
static int OpenIteratorHandleDocumentMarker(TRI_df_marker_t const* marker,

View File

@ -144,7 +144,7 @@ static bool ScanMarker(TRI_df_marker_t const* marker, void* data,
}
VPackSlice slice(reinterpret_cast<char const*>(marker) + MMFilesDatafileHelper::VPackOffset(type));
state->documentOperations[collectionId][Transaction::extractKeyFromDocument(slice).copyString()] = marker;
state->documentOperations[collectionId][TransactionMethods::extractKeyFromDocument(slice).copyString()] = marker;
state->operationsCount[collectionId]++;
break;
}
@ -575,7 +575,7 @@ void MMFilesCollectorThread::processCollectionMarker(
VPackSlice keySlice;
TRI_voc_rid_t revisionId = 0;
Transaction::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
TransactionMethods::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
bool wasAdjusted = false;
MMFilesSimpleIndexElement element = collection->primaryIndex()->lookupKey(&trx, keySlice);
@ -607,7 +607,7 @@ void MMFilesCollectorThread::processCollectionMarker(
VPackSlice keySlice;
TRI_voc_rid_t revisionId = 0;
Transaction::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
TransactionMethods::extractKeyAndRevFromDocument(slice, keySlice, revisionId);
MMFilesSimpleIndexElement found = collection->primaryIndex()->lookupKey(&trx, keySlice);

View File

@ -69,7 +69,7 @@ static char const* ReasonNothingToCompact =
/// @brief compaction state
namespace arangodb {
struct CompactionContext {
Transaction* _trx;
TransactionMethods* _trx;
LogicalCollection* _collection;
MMFilesDatafile* _compactor;
DatafileStatisticsContainer _dfi;
@ -236,7 +236,7 @@ int MMFilesCompactorThread::removeDatafile(LogicalCollection* collection,
/// @brief calculate the target size for the compactor to be created
MMFilesCompactorThread::CompactionInitialContext MMFilesCompactorThread::getCompactionContext(
Transaction* trx, LogicalCollection* collection,
TransactionMethods* trx, LogicalCollection* collection,
std::vector<compaction_info_t> const& toCompact) {
CompactionInitialContext context(trx, collection);
@ -274,7 +274,7 @@ MMFilesCompactorThread::CompactionInitialContext MMFilesCompactorThread::getComp
VPackSlice const slice(reinterpret_cast<char const*>(marker) + MMFilesDatafileHelper::VPackOffset(type));
TRI_ASSERT(slice.isObject());
VPackSlice keySlice = Transaction::extractKeyFromDocument(slice);
VPackSlice keySlice = TransactionMethods::extractKeyFromDocument(slice);
// check if the document is still active
auto primaryIndex = collection->primaryIndex();
@ -363,7 +363,7 @@ void MMFilesCompactorThread::compactDatafiles(LogicalCollection* collection,
VPackSlice const slice(reinterpret_cast<char const*>(marker) + MMFilesDatafileHelper::VPackOffset(type));
TRI_ASSERT(slice.isObject());
VPackSlice keySlice = Transaction::extractKeyFromDocument(slice);
VPackSlice keySlice = TransactionMethods::extractKeyFromDocument(slice);
// check if the document is still active
auto primaryIndex = collection->primaryIndex();

View File

@ -36,7 +36,7 @@ struct TRI_vocbase_t;
namespace arangodb {
struct CompactionContext;
class LogicalCollection;
class Transaction;
class TransactionMethods;
class MMFilesCompactorThread final : public Thread {
private:
@ -48,14 +48,14 @@ class MMFilesCompactorThread final : public Thread {
/// @brief auxiliary struct used when initializing compaction
struct CompactionInitialContext {
Transaction* _trx;
TransactionMethods* _trx;
LogicalCollection* _collection;
int64_t _targetSize;
TRI_voc_fid_t _fid;
bool _keepDeletions;
bool _failed;
CompactionInitialContext(Transaction* trx, LogicalCollection* collection)
CompactionInitialContext(TransactionMethods* trx, LogicalCollection* collection)
: _trx(trx), _collection(collection), _targetSize(0), _fid(0), _keepDeletions(false), _failed(false) {}
};
@ -76,7 +76,7 @@ class MMFilesCompactorThread final : public Thread {
private:
/// @brief calculate the target size for the compactor to be created
CompactionInitialContext getCompactionContext(
Transaction* trx, LogicalCollection* collection,
TransactionMethods* trx, LogicalCollection* collection,
std::vector<compaction_info_t> const& toCompact);
/// @brief compact the specified datafiles

View File

@ -88,7 +88,7 @@ void MMFilesDocumentOperation::setRevisions(DocumentDescriptor const& oldRevisio
}
}
void MMFilesDocumentOperation::revert(Transaction* trx) {
void MMFilesDocumentOperation::revert(TransactionMethods* trx) {
TRI_ASSERT(trx != nullptr);
if (_status == StatusType::SWAPPED || _status == StatusType::REVERTED) {
@ -153,9 +153,9 @@ void MMFilesDocumentOperation::revert(Transaction* trx) {
}
// let the primary index entry point to the correct document
MMFilesSimpleIndexElement* element = _collection->primaryIndex()->lookupKeyRef(trx, Transaction::extractKeyFromDocument(newDoc));
MMFilesSimpleIndexElement* element = _collection->primaryIndex()->lookupKeyRef(trx, TransactionMethods::extractKeyFromDocument(newDoc));
if (element != nullptr && element->revisionId() != 0) {
VPackSlice keySlice(Transaction::extractKeyFromDocument(oldDoc));
VPackSlice keySlice(TransactionMethods::extractKeyFromDocument(oldDoc));
element->updateRevisionId(oldRevisionId, static_cast<uint32_t>(keySlice.begin() - oldDoc.begin()));
}
_collection->updateRevision(oldRevisionId, oldDoc.begin(), 0, false);

View File

@ -29,7 +29,7 @@
namespace arangodb {
class LogicalCollection;
class Transaction;
class TransactionMethods;
struct MMFilesDocumentOperation {
enum class StatusType : uint8_t {
@ -72,7 +72,7 @@ struct MMFilesDocumentOperation {
_status = StatusType::HANDLED;
}
void revert(Transaction*);
void revert(TransactionMethods*);
private:
LogicalCollection* _collection;

View File

@ -105,7 +105,7 @@ static bool IsEqualElementEdgeByKey(void* userData, MMFilesSimpleIndexElement co
}
}
MMFilesEdgeIndexIterator::MMFilesEdgeIndexIterator(LogicalCollection* collection, Transaction* trx,
MMFilesEdgeIndexIterator::MMFilesEdgeIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::MMFilesEdgeIndex const* index,
TRI_MMFilesEdgeIndexHash_t const* indexImpl,
@ -392,7 +392,7 @@ void MMFilesEdgeIndex::toVelocyPackFigures(VPackBuilder& builder) const {
// builder.add("buckets", VPackValue(_numBuckets));
}
int MMFilesEdgeIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesEdgeIndex::insert(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
MMFilesSimpleIndexElement fromElement(buildFromElement(revisionId, doc));
MMFilesSimpleIndexElement toElement(buildToElement(revisionId, doc));
@ -412,7 +412,7 @@ int MMFilesEdgeIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
return TRI_ERROR_NO_ERROR;
}
int MMFilesEdgeIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesEdgeIndex::remove(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
MMFilesSimpleIndexElement fromElement(buildFromElement(revisionId, doc));
MMFilesSimpleIndexElement toElement(buildToElement(revisionId, doc));
@ -432,7 +432,7 @@ int MMFilesEdgeIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
}
}
void MMFilesEdgeIndex::batchInsert(Transaction* trx,
void MMFilesEdgeIndex::batchInsert(TransactionMethods* trx,
std::vector<std::pair<TRI_voc_rid_t, VPackSlice>> const& documents,
arangodb::basics::LocalTaskQueue* queue) {
if (documents.empty()) {
@ -462,7 +462,7 @@ void MMFilesEdgeIndex::batchInsert(Transaction* trx,
// _from
for (auto const& it : documents) {
VPackSlice value(Transaction::extractFromFromDocument(it.second));
VPackSlice value(TransactionMethods::extractFromFromDocument(it.second));
fromElements->emplace_back(MMFilesSimpleIndexElement(
it.first, value,
static_cast<uint32_t>(value.begin() - it.second.begin())));
@ -470,7 +470,7 @@ void MMFilesEdgeIndex::batchInsert(Transaction* trx,
// _to
for (auto const& it : documents) {
VPackSlice value(Transaction::extractToFromDocument(it.second));
VPackSlice value(TransactionMethods::extractToFromDocument(it.second));
toElements->emplace_back(MMFilesSimpleIndexElement(
it.first, value,
static_cast<uint32_t>(value.begin() - it.second.begin())));
@ -489,7 +489,7 @@ int MMFilesEdgeIndex::unload() {
}
/// @brief provides a size hint for the edge index
int MMFilesEdgeIndex::sizeHint(Transaction* trx, size_t size) {
int MMFilesEdgeIndex::sizeHint(TransactionMethods* trx, size_t size) {
// we assume this is called when setting up the index and the index
// is still empty
TRI_ASSERT(_edgesFrom->size() == 0);
@ -525,7 +525,7 @@ bool MMFilesEdgeIndex::supportsFilterCondition(
/// @brief creates an IndexIterator for the given Condition
IndexIterator* MMFilesEdgeIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool reverse) const {
@ -609,7 +609,7 @@ void MMFilesEdgeIndex::expandInSearchValues(VPackSlice const slice,
/// @brief create the iterator
IndexIterator* MMFilesEdgeIndex::createEqIterator(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* attrNode,
arangodb::aql::AstNode const* valNode) const {
@ -632,7 +632,7 @@ IndexIterator* MMFilesEdgeIndex::createEqIterator(
/// @brief create the iterator
IndexIterator* MMFilesEdgeIndex::createInIterator(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* attrNode,
arangodb::aql::AstNode const* valNode) const {
@ -680,14 +680,14 @@ void MMFilesEdgeIndex::handleValNode(VPackBuilder* keys,
MMFilesSimpleIndexElement MMFilesEdgeIndex::buildFromElement(TRI_voc_rid_t revisionId, VPackSlice const& doc) const {
TRI_ASSERT(doc.isObject());
VPackSlice value(Transaction::extractFromFromDocument(doc));
VPackSlice value(TransactionMethods::extractFromFromDocument(doc));
TRI_ASSERT(value.isString());
return MMFilesSimpleIndexElement(revisionId, value, static_cast<uint32_t>(value.begin() - doc.begin()));
}
MMFilesSimpleIndexElement MMFilesEdgeIndex::buildToElement(TRI_voc_rid_t revisionId, VPackSlice const& doc) const {
TRI_ASSERT(doc.isObject());
VPackSlice value(Transaction::extractToFromDocument(doc));
VPackSlice value(TransactionMethods::extractToFromDocument(doc));
TRI_ASSERT(value.isString());
return MMFilesSimpleIndexElement(revisionId, value, static_cast<uint32_t>(value.begin() - doc.begin()));
}

View File

@ -47,7 +47,7 @@ typedef arangodb::basics::AssocMulti<arangodb::velocypack::Slice, MMFilesSimpleI
class MMFilesEdgeIndexIterator final : public IndexIterator {
public:
MMFilesEdgeIndexIterator(LogicalCollection* collection, Transaction* trx,
MMFilesEdgeIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::MMFilesEdgeIndex const* index,
TRI_MMFilesEdgeIndexHash_t const* indexImpl,
@ -112,19 +112,19 @@ class MMFilesEdgeIndex final : public Index {
void toVelocyPackFigures(VPackBuilder&) const override;
int insert(Transaction*, TRI_voc_rid_t,
int insert(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t,
int remove(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback) override;
void batchInsert(Transaction*,
void batchInsert(TransactionMethods*,
std::vector<std::pair<TRI_voc_rid_t, VPackSlice>> const&,
arangodb::basics::LocalTaskQueue*) override;
int unload() override;
int sizeHint(Transaction*, size_t) override;
int sizeHint(TransactionMethods*, size_t) override;
bool hasBatchInsert() const override { return true; }
@ -136,7 +136,7 @@ class MMFilesEdgeIndex final : public Index {
arangodb::aql::Variable const*, size_t, size_t&,
double&) const override;
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,
@ -153,12 +153,12 @@ class MMFilesEdgeIndex final : public Index {
private:
/// @brief create the iterator
IndexIterator* createEqIterator(Transaction*,
IndexIterator* createEqIterator(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::AstNode const*) const;
IndexIterator* createInIterator(Transaction*,
IndexIterator* createInIterator(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::AstNode const*) const;

View File

@ -211,7 +211,7 @@ bool MMFilesFulltextIndex::matchesDefinition(VPackSlice const& info) const {
return true;
}
int MMFilesFulltextIndex::insert(Transaction*, TRI_voc_rid_t revisionId,
int MMFilesFulltextIndex::insert(TransactionMethods*, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
int res = TRI_ERROR_NO_ERROR;
@ -231,7 +231,7 @@ int MMFilesFulltextIndex::insert(Transaction*, TRI_voc_rid_t revisionId,
return res;
}
int MMFilesFulltextIndex::remove(Transaction*, TRI_voc_rid_t revisionId,
int MMFilesFulltextIndex::remove(TransactionMethods*, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
TRI_DeleteDocumentMMFilesFulltextIndex(_fulltextIndex, revisionId);

View File

@ -65,9 +65,9 @@ class MMFilesFulltextIndex final : public Index {
bool matchesDefinition(VPackSlice const&) const override;
int insert(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int insert(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int unload() override;

View File

@ -35,7 +35,7 @@
using namespace arangodb;
MMFilesGeoIndexIterator::MMFilesGeoIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesGeoIndex const* index,
arangodb::aql::AstNode const* cond,
@ -224,7 +224,7 @@ DocumentIdentifierToken MMFilesGeoIndex::toDocumentIdentifierToken(uint64_t inte
/// @brief creates an IndexIterator for the given Condition
IndexIterator* MMFilesGeoIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool) const {
@ -377,7 +377,7 @@ bool MMFilesGeoIndex::matchesDefinition(VPackSlice const& info) const {
return true;
}
int MMFilesGeoIndex::insert(Transaction*, TRI_voc_rid_t revisionId,
int MMFilesGeoIndex::insert(TransactionMethods*, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
double latitude;
double longitude;
@ -444,7 +444,7 @@ int MMFilesGeoIndex::insert(Transaction*, TRI_voc_rid_t revisionId,
return TRI_ERROR_NO_ERROR;
}
int MMFilesGeoIndex::remove(Transaction*, TRI_voc_rid_t revisionId,
int MMFilesGeoIndex::remove(TransactionMethods*, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
double latitude = 0.0;
double longitude = 0.0;
@ -523,7 +523,7 @@ int MMFilesGeoIndex::unload() {
}
/// @brief looks up all points within a given radius
GeoCoordinates* MMFilesGeoIndex::withinQuery(Transaction* trx, double lat,
GeoCoordinates* MMFilesGeoIndex::withinQuery(TransactionMethods* trx, double lat,
double lon, double radius) const {
GeoCoordinate gc;
gc.latitude = lat;
@ -533,7 +533,7 @@ GeoCoordinates* MMFilesGeoIndex::withinQuery(Transaction* trx, double lat,
}
/// @brief looks up the nearest points
GeoCoordinates* MMFilesGeoIndex::nearQuery(Transaction* trx, double lat,
GeoCoordinates* MMFilesGeoIndex::nearQuery(TransactionMethods* trx, double lat,
double lon, size_t count) const {
GeoCoordinate gc;
gc.latitude = lat;

View File

@ -44,7 +44,7 @@ class MMFilesGeoIndexIterator final : public IndexIterator {
public:
/// @brief Construct an MMFilesGeoIndexIterator based on Ast Conditions
MMFilesGeoIndexIterator(LogicalCollection* collection, Transaction* trx,
MMFilesGeoIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesGeoIndex const* index,
arangodb::aql::AstNode const*,
@ -107,7 +107,7 @@ friend class MMFilesGeoIndexIterator;
return TRI_IDX_TYPE_GEO2_INDEX;
}
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,
@ -128,18 +128,18 @@ friend class MMFilesGeoIndexIterator;
bool matchesDefinition(VPackSlice const& info) const override;
int insert(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int insert(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int unload() override;
/// @brief looks up all points within a given radius
GeoCoordinates* withinQuery(Transaction*, double, double,
GeoCoordinates* withinQuery(TransactionMethods*, double, double,
double) const;
/// @brief looks up the nearest points
GeoCoordinates* nearQuery(Transaction*, double, double,
GeoCoordinates* nearQuery(TransactionMethods*, double, double,
size_t) const;
bool isSame(std::vector<std::string> const& location, bool geoJson) const {

View File

@ -42,7 +42,7 @@
using namespace arangodb;
LookupBuilder::LookupBuilder(
Transaction* trx, arangodb::aql::AstNode const* node,
TransactionMethods* trx, arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference,
std::vector<std::vector<arangodb::basics::AttributeName>> const& fields)
: _builder(trx), _usesIn(false), _isEmpty(false), _inStorage(trx) {
@ -285,7 +285,7 @@ static bool IsEqualKeyElementUnique(void* userData, VPackSlice const* left,
}
MMFilesHashIndexIterator::MMFilesHashIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesHashIndex const* index,
arangodb::aql::AstNode const* node,
@ -330,7 +330,7 @@ void MMFilesHashIndexIterator::reset() {
}
MMFilesHashIndexIteratorVPack::MMFilesHashIndexIteratorVPack(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesHashIndex const* index,
std::unique_ptr<arangodb::velocypack::Builder>& searchValues)
@ -589,7 +589,7 @@ bool MMFilesHashIndex::matchesDefinition(VPackSlice const& info) const {
return true;
}
int MMFilesHashIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesHashIndex::insert(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
if (_unique) {
return insertUnique(trx, revisionId, doc, isRollback);
@ -599,7 +599,7 @@ int MMFilesHashIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
}
/// @brief removes an entry from the hash array part of the hash index
int MMFilesHashIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesHashIndex::remove(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesHashIndexElement*> elements;
int res = fillElement<MMFilesHashIndexElement>(elements, revisionId, doc);
@ -630,7 +630,7 @@ int MMFilesHashIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
return res;
}
void MMFilesHashIndex::batchInsert(Transaction* trx,
void MMFilesHashIndex::batchInsert(TransactionMethods* trx,
std::vector<std::pair<TRI_voc_rid_t, VPackSlice>> const& documents,
arangodb::basics::LocalTaskQueue* queue) {
TRI_ASSERT(queue != nullptr);
@ -652,7 +652,7 @@ int MMFilesHashIndex::unload() {
}
/// @brief provides a size hint for the hash index
int MMFilesHashIndex::sizeHint(Transaction* trx, size_t size) {
int MMFilesHashIndex::sizeHint(TransactionMethods* trx, size_t size) {
if (_sparse) {
// for sparse indexes, we assume that we will have less index entries
// than if the index would be fully populated
@ -670,7 +670,7 @@ int MMFilesHashIndex::sizeHint(Transaction* trx, size_t size) {
}
/// @brief locates entries in the hash index given VelocyPack slices
int MMFilesHashIndex::lookup(Transaction* trx,
int MMFilesHashIndex::lookup(TransactionMethods* trx,
VPackSlice key,
std::vector<MMFilesHashIndexElement*>& documents) const {
if (key.isNone()) {
@ -701,7 +701,7 @@ int MMFilesHashIndex::lookup(Transaction* trx,
return TRI_ERROR_NO_ERROR;
}
int MMFilesHashIndex::insertUnique(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesHashIndex::insertUnique(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesHashIndexElement*> elements;
int res = fillElement<MMFilesHashIndexElement>(elements, revisionId, doc);
@ -744,7 +744,7 @@ int MMFilesHashIndex::insertUnique(Transaction* trx, TRI_voc_rid_t revisionId,
}
void MMFilesHashIndex::batchInsertUnique(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::pair<TRI_voc_rid_t, VPackSlice>> const& documents,
arangodb::basics::LocalTaskQueue* queue) {
TRI_ASSERT(queue != nullptr);
@ -801,7 +801,7 @@ void MMFilesHashIndex::batchInsertUnique(
queue->enqueueCallback(cbTask);
}
int MMFilesHashIndex::insertMulti(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesHashIndex::insertMulti(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesHashIndexElement*> elements;
int res = fillElement<MMFilesHashIndexElement>(elements, revisionId, doc);
@ -863,7 +863,7 @@ int MMFilesHashIndex::insertMulti(Transaction* trx, TRI_voc_rid_t revisionId,
}
void MMFilesHashIndex::batchInsertMulti(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::pair<TRI_voc_rid_t, VPackSlice>> const& documents,
arangodb::basics::LocalTaskQueue* queue) {
TRI_ASSERT(queue != nullptr);
@ -920,7 +920,7 @@ void MMFilesHashIndex::batchInsertMulti(
queue->enqueueCallback(cbTask);
}
int MMFilesHashIndex::removeUniqueElement(Transaction* trx,
int MMFilesHashIndex::removeUniqueElement(TransactionMethods* trx,
MMFilesHashIndexElement* element,
bool isRollback) {
TRI_IF_FAILURE("RemoveHashIndex") { return TRI_ERROR_DEBUG; }
@ -940,7 +940,7 @@ int MMFilesHashIndex::removeUniqueElement(Transaction* trx,
return TRI_ERROR_NO_ERROR;
}
int MMFilesHashIndex::removeMultiElement(Transaction* trx,
int MMFilesHashIndex::removeMultiElement(TransactionMethods* trx,
MMFilesHashIndexElement* element,
bool isRollback) {
TRI_IF_FAILURE("RemoveHashIndex") { return TRI_ERROR_DEBUG; }
@ -972,7 +972,7 @@ bool MMFilesHashIndex::supportsFilterCondition(
/// @brief creates an IndexIterator for the given Condition
IndexIterator* MMFilesHashIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool) const {

View File

@ -64,7 +64,7 @@ class LookupBuilder {
public:
LookupBuilder(
Transaction*, arangodb::aql::AstNode const*,
TransactionMethods*, arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,
std::vector<std::vector<arangodb::basics::AttributeName>> const&);
@ -83,7 +83,7 @@ class MMFilesHashIndexIterator final : public IndexIterator {
public:
/// @brief Construct an MMFilesHashIndexIterator based on Ast Conditions
MMFilesHashIndexIterator(LogicalCollection* collection, Transaction* trx,
MMFilesHashIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesHashIndex const* index,
arangodb::aql::AstNode const*,
@ -109,7 +109,7 @@ class MMFilesHashIndexIteratorVPack final : public IndexIterator {
/// @brief Construct an MMFilesHashIndexIterator based on VelocyPack
MMFilesHashIndexIteratorVPack(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesHashIndex const* index,
std::unique_ptr<arangodb::velocypack::Builder>& searchValues);
@ -163,20 +163,20 @@ class MMFilesHashIndex final : public MMFilesPathBasedIndex {
bool matchesDefinition(VPackSlice const& info) const override;
int insert(Transaction*, TRI_voc_rid_t,
int insert(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t,
int remove(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback) override;
void batchInsert(
Transaction*,
TransactionMethods*,
std::vector<std::pair<TRI_voc_rid_t, arangodb::velocypack::Slice>> const&,
arangodb::basics::LocalTaskQueue* queue = nullptr) override;
int unload() override;
int sizeHint(Transaction*, size_t) override;
int sizeHint(TransactionMethods*, size_t) override;
bool hasBatchInsert() const override { return true; }
@ -184,7 +184,7 @@ class MMFilesHashIndex final : public MMFilesPathBasedIndex {
arangodb::aql::Variable const*, size_t, size_t&,
double&) const override;
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,
@ -195,28 +195,28 @@ class MMFilesHashIndex final : public MMFilesPathBasedIndex {
private:
/// @brief locates entries in the hash index given a velocypack slice
int lookup(Transaction*, arangodb::velocypack::Slice,
int lookup(TransactionMethods*, arangodb::velocypack::Slice,
std::vector<MMFilesHashIndexElement*>&) const;
int insertUnique(Transaction*, TRI_voc_rid_t,
int insertUnique(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback);
void batchInsertUnique(
Transaction*,
TransactionMethods*,
std::vector<std::pair<TRI_voc_rid_t, arangodb::velocypack::Slice>> const&,
arangodb::basics::LocalTaskQueue* queue = nullptr);
int insertMulti(Transaction*, TRI_voc_rid_t,
int insertMulti(TransactionMethods*, TRI_voc_rid_t,
arangodb::velocypack::Slice const&, bool isRollback);
void batchInsertMulti(
Transaction*,
TransactionMethods*,
std::vector<std::pair<TRI_voc_rid_t, arangodb::velocypack::Slice>> const&,
arangodb::basics::LocalTaskQueue* queue = nullptr);
int removeUniqueElement(Transaction*, MMFilesHashIndexElement*, bool);
int removeUniqueElement(TransactionMethods*, MMFilesHashIndexElement*, bool);
int removeMultiElement(Transaction*, MMFilesHashIndexElement*, bool);
int removeMultiElement(TransactionMethods*, MMFilesHashIndexElement*, bool);
bool accessFitsIndex(arangodb::aql::AstNode const* access,
arangodb::aql::AstNode const* other,

View File

@ -84,7 +84,7 @@ static size_t sortWeight(arangodb::aql::AstNode const* node) {
// ...........................................................................
PersistentIndexIterator::PersistentIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::PersistentIndex const* index,
arangodb::MMFilesPrimaryIndex* primaryIndex,
@ -232,7 +232,7 @@ void PersistentIndex::toVelocyPackFigures(VPackBuilder& builder) const {
}
/// @brief inserts a document into the index
int PersistentIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
int PersistentIndex::insert(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
auto comparator = RocksDBFeature::instance()->comparator();
std::vector<MMFilesSkiplistIndexElement*> elements;
@ -259,7 +259,7 @@ int PersistentIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, numPaths());
VPackSlice const key = Transaction::extractKeyFromDocument(doc);
VPackSlice const key = TransactionMethods::extractKeyFromDocument(doc);
std::string const prefix =
buildPrefix(trx->vocbase()->id(), _collection->cid(), _iid);
@ -389,7 +389,7 @@ int PersistentIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
}
/// @brief removes a document from the index
int PersistentIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
int PersistentIndex::remove(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesSkiplistIndexElement*> elements;
@ -415,7 +415,7 @@ int PersistentIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, numPaths());
VPackSlice const key = Transaction::extractKeyFromDocument(doc);
VPackSlice const key = TransactionMethods::extractKeyFromDocument(doc);
VPackBuilder builder;
std::vector<std::string> values;
@ -469,7 +469,7 @@ int PersistentIndex::drop() {
/// @brief attempts to locate an entry in the index
/// Warning: who ever calls this function is responsible for destroying
/// the PersistentIndexIterator* results
PersistentIndexIterator* PersistentIndex::lookup(Transaction* trx,
PersistentIndexIterator* PersistentIndex::lookup(TransactionMethods* trx,
ManagedDocumentResult* mmdr,
VPackSlice const searchValues,
bool reverse) const {
@ -857,7 +857,7 @@ bool PersistentIndex::supportsSortCondition(
}
IndexIterator* PersistentIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool reverse) const {

View File

@ -51,7 +51,7 @@ struct Variable;
class LogicalCollection;
class MMFilesPrimaryIndex;
class PersistentIndex;
class Transaction;
class TransactionMethods;
/// @brief Iterator structure for RocksDB. We require a start and stop node
class PersistentIndexIterator final : public IndexIterator {
@ -59,7 +59,7 @@ class PersistentIndexIterator final : public IndexIterator {
friend class PersistentIndex;
public:
PersistentIndexIterator(LogicalCollection* collection, Transaction* trx,
PersistentIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::PersistentIndex const* index,
arangodb::MMFilesPrimaryIndex* primaryIndex,
@ -150,9 +150,9 @@ class PersistentIndex final : public MMFilesPathBasedIndex {
return value;
}
int insert(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int insert(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int unload() override;
@ -162,7 +162,7 @@ class PersistentIndex final : public MMFilesPathBasedIndex {
///
/// Warning: who ever calls this function is responsible for destroying
/// the velocypack::Slice and the PersistentIndexIterator* results
PersistentIndexIterator* lookup(Transaction*,
PersistentIndexIterator* lookup(TransactionMethods*,
ManagedDocumentResult* mmdr,
arangodb::velocypack::Slice const,
bool reverse) const;
@ -175,7 +175,7 @@ class PersistentIndex final : public MMFilesPathBasedIndex {
arangodb::aql::Variable const*, size_t,
double&, size_t&) const override;
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,

View File

@ -88,7 +88,7 @@ static bool IsEqualElementElement(void* userData, MMFilesSimpleIndexElement cons
}
MMFilesPrimaryIndexIterator::MMFilesPrimaryIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
std::unique_ptr<VPackBuilder>& keys)
@ -127,7 +127,7 @@ bool MMFilesPrimaryIndexIterator::next(TokenCallback const& cb, size_t limit) {
void MMFilesPrimaryIndexIterator::reset() { _iterator.reset(); }
AllIndexIterator::AllIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
MMFilesPrimaryIndexImpl const* indexImpl,
@ -154,7 +154,7 @@ bool AllIndexIterator::next(TokenCallback const& cb, size_t limit) {
void AllIndexIterator::reset() { _position.reset(); }
AnyIndexIterator::AnyIndexIterator(LogicalCollection* collection, Transaction* trx,
AnyIndexIterator::AnyIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
MMFilesPrimaryIndexImpl const* indexImpl)
@ -225,14 +225,14 @@ void MMFilesPrimaryIndex::toVelocyPackFigures(VPackBuilder& builder) const {
_primaryIndex->appendToVelocyPack(builder);
}
int MMFilesPrimaryIndex::insert(Transaction*, TRI_voc_rid_t, VPackSlice const&, bool) {
int MMFilesPrimaryIndex::insert(TransactionMethods*, TRI_voc_rid_t, VPackSlice const&, bool) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
LOG_TOPIC(WARN, arangodb::Logger::FIXME) << "insert() called for primary index";
#endif
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "insert() called for primary index");
}
int MMFilesPrimaryIndex::remove(Transaction*, TRI_voc_rid_t, VPackSlice const&, bool) {
int MMFilesPrimaryIndex::remove(TransactionMethods*, TRI_voc_rid_t, VPackSlice const&, bool) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
LOG_TOPIC(WARN, arangodb::Logger::FIXME) << "remove() called for primary index";
#endif
@ -247,7 +247,7 @@ int MMFilesPrimaryIndex::unload() {
}
/// @brief looks up an element given a key
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(Transaction* trx,
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(TransactionMethods* trx,
VPackSlice const& key) const {
ManagedDocumentResult mmdr;
IndexLookupContext context(trx, _collection, &mmdr, 1);
@ -256,7 +256,7 @@ MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(Transaction* trx,
}
/// @brief looks up an element given a key
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(Transaction* trx,
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(TransactionMethods* trx,
VPackSlice const& key,
ManagedDocumentResult& mmdr) const {
IndexLookupContext context(trx, _collection, &mmdr, 1);
@ -265,7 +265,7 @@ MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupKey(Transaction* trx,
}
/// @brief looks up an element given a key
MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(Transaction* trx,
MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(TransactionMethods* trx,
VPackSlice const& key) const {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
@ -278,7 +278,7 @@ MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(Transaction* trx,
}
/// @brief looks up an element given a key
MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(Transaction* trx,
MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(TransactionMethods* trx,
VPackSlice const& key,
ManagedDocumentResult& mmdr) const {
IndexLookupContext context(trx, _collection, &mmdr, 1);
@ -296,7 +296,7 @@ MMFilesSimpleIndexElement* MMFilesPrimaryIndex::lookupKeyRef(Transaction* trx,
/// Convention: position === 0 indicates a new start.
/// DEPRECATED
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupSequential(
Transaction* trx, arangodb::basics::BucketPosition& position,
TransactionMethods* trx, arangodb::basics::BucketPosition& position,
uint64_t& total) {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
@ -305,7 +305,7 @@ MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupSequential(
/// @brief request an iterator over all elements in the index in
/// a sequential order.
IndexIterator* MMFilesPrimaryIndex::allIterator(Transaction* trx,
IndexIterator* MMFilesPrimaryIndex::allIterator(TransactionMethods* trx,
ManagedDocumentResult* mmdr,
bool reverse) const {
return new AllIndexIterator(_collection, trx, mmdr, this, _primaryIndex, reverse);
@ -314,7 +314,7 @@ IndexIterator* MMFilesPrimaryIndex::allIterator(Transaction* trx,
/// @brief request an iterator over all elements in the index in
/// a random order. It is guaranteed that each element is found
/// exactly once unless the collection is modified.
IndexIterator* MMFilesPrimaryIndex::anyIterator(Transaction* trx,
IndexIterator* MMFilesPrimaryIndex::anyIterator(TransactionMethods* trx,
ManagedDocumentResult* mmdr) const {
return new AnyIndexIterator(_collection, trx, mmdr, this, _primaryIndex);
}
@ -325,7 +325,7 @@ IndexIterator* MMFilesPrimaryIndex::anyIterator(Transaction* trx,
/// Convention: position === UINT64_MAX indicates a new start.
/// DEPRECATED
MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupSequentialReverse(
Transaction* trx, arangodb::basics::BucketPosition& position) {
TransactionMethods* trx, arangodb::basics::BucketPosition& position) {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
return _primaryIndex->findSequentialReverse(&context, position);
@ -333,7 +333,7 @@ MMFilesSimpleIndexElement MMFilesPrimaryIndex::lookupSequentialReverse(
/// @brief adds a key/element to the index
/// returns a status code, and *found will contain a found element (if any)
int MMFilesPrimaryIndex::insertKey(Transaction* trx, TRI_voc_rid_t revisionId, VPackSlice const& doc) {
int MMFilesPrimaryIndex::insertKey(TransactionMethods* trx, TRI_voc_rid_t revisionId, VPackSlice const& doc) {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
MMFilesSimpleIndexElement element(buildKeyElement(revisionId, doc));
@ -341,7 +341,7 @@ int MMFilesPrimaryIndex::insertKey(Transaction* trx, TRI_voc_rid_t revisionId, V
return _primaryIndex->insert(&context, element);
}
int MMFilesPrimaryIndex::insertKey(Transaction* trx, TRI_voc_rid_t revisionId, VPackSlice const& doc, ManagedDocumentResult& mmdr) {
int MMFilesPrimaryIndex::insertKey(TransactionMethods* trx, TRI_voc_rid_t revisionId, VPackSlice const& doc, ManagedDocumentResult& mmdr) {
IndexLookupContext context(trx, _collection, &mmdr, 1);
MMFilesSimpleIndexElement element(buildKeyElement(revisionId, doc));
@ -349,12 +349,12 @@ int MMFilesPrimaryIndex::insertKey(Transaction* trx, TRI_voc_rid_t revisionId, V
}
/// @brief removes an key/element from the index
int MMFilesPrimaryIndex::removeKey(Transaction* trx,
int MMFilesPrimaryIndex::removeKey(TransactionMethods* trx,
TRI_voc_rid_t revisionId, VPackSlice const& doc) {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
VPackSlice keySlice(Transaction::extractKeyFromDocument(doc));
VPackSlice keySlice(TransactionMethods::extractKeyFromDocument(doc));
MMFilesSimpleIndexElement found = _primaryIndex->removeByKey(&context, keySlice.begin());
if (!found) {
@ -364,11 +364,11 @@ int MMFilesPrimaryIndex::removeKey(Transaction* trx,
return TRI_ERROR_NO_ERROR;
}
int MMFilesPrimaryIndex::removeKey(Transaction* trx,
int MMFilesPrimaryIndex::removeKey(TransactionMethods* trx,
TRI_voc_rid_t revisionId, VPackSlice const& doc, ManagedDocumentResult& mmdr) {
IndexLookupContext context(trx, _collection, &mmdr, 1);
VPackSlice keySlice(Transaction::extractKeyFromDocument(doc));
VPackSlice keySlice(TransactionMethods::extractKeyFromDocument(doc));
MMFilesSimpleIndexElement found = _primaryIndex->removeByKey(&context, keySlice.begin());
if (!found) {
@ -379,7 +379,7 @@ int MMFilesPrimaryIndex::removeKey(Transaction* trx,
}
/// @brief resizes the index
int MMFilesPrimaryIndex::resize(Transaction* trx, size_t targetSize) {
int MMFilesPrimaryIndex::resize(TransactionMethods* trx, size_t targetSize) {
ManagedDocumentResult result;
IndexLookupContext context(trx, _collection, &result, 1);
return _primaryIndex->resize(&context, targetSize);
@ -411,7 +411,7 @@ bool MMFilesPrimaryIndex::supportsFilterCondition(
/// @brief creates an IndexIterator for the given Condition
IndexIterator* MMFilesPrimaryIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool reverse) const {
@ -459,7 +459,7 @@ arangodb::aql::AstNode* MMFilesPrimaryIndex::specializeCondition(
/// @brief create the iterator, for a single attribute, IN operator
IndexIterator* MMFilesPrimaryIndex::createInIterator(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* attrNode,
arangodb::aql::AstNode const* valNode) const {
@ -492,7 +492,7 @@ IndexIterator* MMFilesPrimaryIndex::createInIterator(
/// @brief create the iterator, for a single attribute, EQ operator
IndexIterator* MMFilesPrimaryIndex::createEqIterator(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* attrNode,
arangodb::aql::AstNode const* valNode) const {
@ -515,7 +515,7 @@ IndexIterator* MMFilesPrimaryIndex::createEqIterator(
}
/// @brief add a single value node to the iterator's keys
void MMFilesPrimaryIndex::handleValNode(Transaction* trx,
void MMFilesPrimaryIndex::handleValNode(TransactionMethods* trx,
VPackBuilder* keys,
arangodb::aql::AstNode const* valNode,
bool isId) const {
@ -559,7 +559,7 @@ void MMFilesPrimaryIndex::handleValNode(Transaction* trx,
MMFilesSimpleIndexElement MMFilesPrimaryIndex::buildKeyElement(TRI_voc_rid_t revisionId, VPackSlice const& doc) const {
TRI_ASSERT(doc.isObject());
VPackSlice value(Transaction::extractKeyFromDocument(doc));
VPackSlice value(TransactionMethods::extractKeyFromDocument(doc));
TRI_ASSERT(value.isString());
return MMFilesSimpleIndexElement(revisionId, value, static_cast<uint32_t>(value.begin() - doc.begin()));
}

View File

@ -39,14 +39,14 @@ namespace arangodb {
class MMFilesPrimaryIndex;
struct MMFilesSimpleIndexElement;
class Transaction;
class TransactionMethods;
typedef arangodb::basics::AssocUnique<uint8_t, MMFilesSimpleIndexElement> MMFilesPrimaryIndexImpl;
class MMFilesPrimaryIndexIterator final : public IndexIterator {
public:
MMFilesPrimaryIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
std::unique_ptr<VPackBuilder>& keys);
@ -68,7 +68,7 @@ class MMFilesPrimaryIndexIterator final : public IndexIterator {
class AllIndexIterator final : public IndexIterator {
public:
AllIndexIterator(LogicalCollection* collection,
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
MMFilesPrimaryIndexImpl const* indexImpl,
@ -91,7 +91,7 @@ class AllIndexIterator final : public IndexIterator {
class AnyIndexIterator final : public IndexIterator {
public:
AnyIndexIterator(LogicalCollection* collection, Transaction* trx,
AnyIndexIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
MMFilesPrimaryIndex const* index,
MMFilesPrimaryIndexImpl const* indexImpl);
@ -144,34 +144,34 @@ class MMFilesPrimaryIndex final : public Index {
void toVelocyPack(VPackBuilder&, bool) const override;
void toVelocyPackFigures(VPackBuilder&) const override;
int insert(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int insert(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int unload() override;
MMFilesSimpleIndexElement lookupKey(Transaction*, VPackSlice const&) const;
MMFilesSimpleIndexElement lookupKey(Transaction*, VPackSlice const&, ManagedDocumentResult&) const;
MMFilesSimpleIndexElement* lookupKeyRef(Transaction*, VPackSlice const&) const;
MMFilesSimpleIndexElement* lookupKeyRef(Transaction*, VPackSlice const&, ManagedDocumentResult&) const;
MMFilesSimpleIndexElement lookupKey(TransactionMethods*, VPackSlice const&) const;
MMFilesSimpleIndexElement lookupKey(TransactionMethods*, VPackSlice const&, ManagedDocumentResult&) const;
MMFilesSimpleIndexElement* lookupKeyRef(TransactionMethods*, VPackSlice const&) const;
MMFilesSimpleIndexElement* lookupKeyRef(TransactionMethods*, VPackSlice const&, ManagedDocumentResult&) const;
/// @brief a method to iterate over all elements in the index in
/// a sequential order.
/// Returns nullptr if all documents have been returned.
/// Convention: position === 0 indicates a new start.
/// DEPRECATED
MMFilesSimpleIndexElement lookupSequential(Transaction*,
MMFilesSimpleIndexElement lookupSequential(TransactionMethods*,
arangodb::basics::BucketPosition& position,
uint64_t& total);
/// @brief request an iterator over all elements in the index in
/// a sequential order.
IndexIterator* allIterator(Transaction*, ManagedDocumentResult*, bool reverse) const;
IndexIterator* allIterator(TransactionMethods*, ManagedDocumentResult*, bool reverse) const;
/// @brief request an iterator over all elements in the index in
/// a random order. It is guaranteed that each element is found
/// exactly once unless the collection is modified.
IndexIterator* anyIterator(Transaction*, ManagedDocumentResult*) const;
IndexIterator* anyIterator(TransactionMethods*, ManagedDocumentResult*) const;
/// @brief a method to iterate over all elements in the index in
/// reversed sequential order.
@ -179,15 +179,15 @@ class MMFilesPrimaryIndex final : public Index {
/// Convention: position === UINT64_MAX indicates a new start.
/// DEPRECATED
MMFilesSimpleIndexElement lookupSequentialReverse(
Transaction*, arangodb::basics::BucketPosition& position);
TransactionMethods*, arangodb::basics::BucketPosition& position);
int insertKey(Transaction*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&);
int insertKey(Transaction*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&, ManagedDocumentResult&);
int insertKey(TransactionMethods*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&);
int insertKey(TransactionMethods*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&, ManagedDocumentResult&);
int removeKey(Transaction*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&);
int removeKey(Transaction*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&, ManagedDocumentResult&);
int removeKey(TransactionMethods*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&);
int removeKey(TransactionMethods*, TRI_voc_rid_t revisionId, arangodb::velocypack::Slice const&, ManagedDocumentResult&);
int resize(Transaction*, size_t);
int resize(TransactionMethods*, size_t);
void invokeOnAllElements(std::function<bool(DocumentIdentifierToken const&)>);
void invokeOnAllElementsForRemoval(std::function<bool(MMFilesSimpleIndexElement&)>);
@ -196,7 +196,7 @@ class MMFilesPrimaryIndex final : public Index {
arangodb::aql::Variable const*, size_t, size_t&,
double&) const override;
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,
@ -209,20 +209,20 @@ class MMFilesPrimaryIndex final : public Index {
/// @brief create the iterator, for a single attribute, IN operator
IndexIterator* createInIterator(
Transaction*,
TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::AstNode const*) const;
/// @brief create the iterator, for a single attribute, EQ operator
IndexIterator* createEqIterator(
Transaction*,
TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::AstNode const*) const;
/// @brief add a single value node to the iterator's keys
void handleValNode(Transaction* trx,
void handleValNode(TransactionMethods* trx,
VPackBuilder* keys,
arangodb::aql::AstNode const* valNode,
bool isId) const;

View File

@ -118,7 +118,7 @@ VPackSlice const* BaseSkiplistLookupBuilder::getUpperLookup() const {
bool BaseSkiplistLookupBuilder::includeUpper() const { return _includeUpper; }
SkiplistLookupBuilder::SkiplistLookupBuilder(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::vector<arangodb::aql::AstNode const*>>& ops,
arangodb::aql::Variable const* var, bool reverse)
: BaseSkiplistLookupBuilder(trx) {
@ -255,7 +255,7 @@ bool SkiplistLookupBuilder::next() {
}
SkiplistInLookupBuilder::SkiplistInLookupBuilder(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::vector<arangodb::aql::AstNode const*>>& ops,
arangodb::aql::Variable const* var, bool reverse)
: BaseSkiplistLookupBuilder(trx), _dataBuilder(trx), _done(false) {
@ -500,7 +500,7 @@ void SkiplistInLookupBuilder::buildSearchValues() {
}
}
MMFilesSkiplistIterator::MMFilesSkiplistIterator(LogicalCollection* collection, Transaction* trx,
MMFilesSkiplistIterator::MMFilesSkiplistIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::MMFilesSkiplistIndex const* index,
TRI_Skiplist const* skiplist, size_t numPaths,
@ -707,7 +707,7 @@ void MMFilesSkiplistIndex::toVelocyPackFigures(VPackBuilder& builder) const {
}
/// @brief inserts a document into a skiplist index
int MMFilesSkiplistIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesSkiplistIndex::insert(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesSkiplistIndexElement*> elements;
@ -758,7 +758,7 @@ int MMFilesSkiplistIndex::insert(Transaction* trx, TRI_voc_rid_t revisionId,
}
/// @brief removes a document from a skiplist index
int MMFilesSkiplistIndex::remove(Transaction* trx, TRI_voc_rid_t revisionId,
int MMFilesSkiplistIndex::remove(TransactionMethods* trx, TRI_voc_rid_t revisionId,
VPackSlice const& doc, bool isRollback) {
std::vector<MMFilesSkiplistIndexElement*> elements;
@ -1210,7 +1210,7 @@ bool MMFilesSkiplistIndex::findMatchingConditions(
}
IndexIterator* MMFilesSkiplistIndex::iteratorForCondition(
Transaction* trx,
TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::aql::AstNode const* node,
arangodb::aql::Variable const* reference, bool reverse) const {

View File

@ -43,7 +43,7 @@ struct Variable;
}
class MMFilesSkiplistIndex;
class Transaction;
class TransactionMethods;
/// @brief Abstract Builder for lookup values in skiplist index
@ -61,7 +61,7 @@ class BaseSkiplistLookupBuilder {
arangodb::velocypack::Slice _upperSlice;
public:
explicit BaseSkiplistLookupBuilder(Transaction* trx) :
explicit BaseSkiplistLookupBuilder(TransactionMethods* trx) :
_lowerBuilder(trx), _upperBuilder(trx)
{
_isEquality = true;
@ -109,7 +109,7 @@ class SkiplistLookupBuilder : public BaseSkiplistLookupBuilder {
public:
SkiplistLookupBuilder(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::vector<arangodb::aql::AstNode const*>>&,
arangodb::aql::Variable const*, bool);
@ -142,7 +142,7 @@ class SkiplistInLookupBuilder : public BaseSkiplistLookupBuilder {
public:
SkiplistInLookupBuilder(
Transaction* trx,
TransactionMethods* trx,
std::vector<std::vector<arangodb::aql::AstNode const*>>&,
arangodb::aql::Variable const*, bool);
@ -192,7 +192,7 @@ class MMFilesSkiplistIterator final : public IndexIterator {
MMFilesSkiplistCmpType)> _CmpElmElm;
public:
MMFilesSkiplistIterator(LogicalCollection* collection, Transaction* trx,
MMFilesSkiplistIterator(LogicalCollection* collection, TransactionMethods* trx,
ManagedDocumentResult* mmdr,
arangodb::MMFilesSkiplistIndex const* index,
TRI_Skiplist const* skiplist, size_t numPaths,
@ -291,9 +291,9 @@ class MMFilesSkiplistIndex final : public MMFilesPathBasedIndex {
void toVelocyPack(VPackBuilder&, bool) const override;
void toVelocyPackFigures(VPackBuilder&) const override;
int insert(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int insert(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(Transaction*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int remove(TransactionMethods*, TRI_voc_rid_t, arangodb::velocypack::Slice const&, bool isRollback) override;
int unload() override;
@ -305,7 +305,7 @@ class MMFilesSkiplistIndex final : public MMFilesPathBasedIndex {
arangodb::aql::Variable const*, size_t,
double&, size_t&) const override;
IndexIterator* iteratorForCondition(Transaction*,
IndexIterator* iteratorForCondition(TransactionMethods*,
ManagedDocumentResult*,
arangodb::aql::AstNode const*,
arangodb::aql::Variable const*,

View File

@ -111,7 +111,7 @@ void MMFilesTransactionCollection::addOperation(MMFilesDocumentOperation* operat
_operations->push_back(operation);
}
void MMFilesTransactionCollection::freeOperations(Transaction* activeTrx, bool mustRollback) {
void MMFilesTransactionCollection::freeOperations(TransactionMethods* activeTrx, bool mustRollback) {
if (!hasOperations()) {
return;
}
@ -311,10 +311,10 @@ int MMFilesTransactionCollection::doLock(AccessMode::Type type, int nestingLevel
TRI_ASSERT(_collection != nullptr);
if (Transaction::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders != nullptr) {
std::string collName(_collection->name());
auto it = Transaction::_makeNolockHeaders->find(collName);
if (it != Transaction::_makeNolockHeaders->end()) {
auto it = TransactionMethods::_makeNolockHeaders->find(collName);
if (it != TransactionMethods::_makeNolockHeaders->end()) {
// do not lock by command
// LOCKING-DEBUG
// std::cout << "LockCollection blocked: " << collName << std::endl;
@ -359,10 +359,10 @@ int MMFilesTransactionCollection::doUnlock(AccessMode::Type type, int nestingLev
TRI_ASSERT(_collection != nullptr);
if (Transaction::_makeNolockHeaders != nullptr) {
if (TransactionMethods::_makeNolockHeaders != nullptr) {
std::string collName(_collection->name());
auto it = Transaction::_makeNolockHeaders->find(collName);
if (it != Transaction::_makeNolockHeaders->end()) {
auto it = TransactionMethods::_makeNolockHeaders->find(collName);
if (it != TransactionMethods::_makeNolockHeaders->end()) {
// do not lock by command
// LOCKING-DEBUG
// std::cout << "UnlockCollection blocked: " << collName << std::endl;

View File

@ -31,7 +31,7 @@
namespace arangodb {
struct MMFilesDocumentOperation;
class Transaction;
class TransactionMethods;
class TransactionState;
/// @brief collection used in a transaction
@ -59,7 +59,7 @@ class MMFilesTransactionCollection final : public TransactionCollection {
/// @brief whether or not any write operations for the collection happened
bool hasOperations() const override;
void freeOperations(Transaction* activeTrx, bool mustRollback) override;
void freeOperations(TransactionMethods* activeTrx, bool mustRollback) override;
bool canAccess(AccessMode::Type accessType) const override;
int updateUsage(AccessMode::Type accessType, int nestingLevel) override;

View File

@ -60,7 +60,7 @@ int MMFilesTransactionState::beginTransaction(TransactionHints hints, int nestin
LOG_TRX(this, nestingLevel) << "beginning " << AccessMode::typeString(_type) << " transaction";
if (nestingLevel == 0) {
TRI_ASSERT(_status == Transaction::Status::CREATED);
TRI_ASSERT(_status == TransactionMethods::Status::CREATED);
auto logfileManager = MMFilesLogfileManager::instance();
@ -96,7 +96,7 @@ int MMFilesTransactionState::beginTransaction(TransactionHints hints, int nestin
}
} else {
TRI_ASSERT(_status == Transaction::Status::RUNNING);
TRI_ASSERT(_status == TransactionMethods::Status::RUNNING);
}
int res = useCollections(nestingLevel);
@ -104,14 +104,14 @@ int MMFilesTransactionState::beginTransaction(TransactionHints hints, int nestin
if (res == TRI_ERROR_NO_ERROR) {
// all valid
if (nestingLevel == 0) {
updateStatus(Transaction::Status::RUNNING);
updateStatus(TransactionMethods::Status::RUNNING);
// defer writing of the begin marker until necessary!
}
} else {
// something is wrong
if (nestingLevel == 0) {
updateStatus(Transaction::Status::ABORTED);
updateStatus(TransactionMethods::Status::ABORTED);
}
// free what we have got so far
@ -122,10 +122,10 @@ int MMFilesTransactionState::beginTransaction(TransactionHints hints, int nestin
}
/// @brief commit a transaction
int MMFilesTransactionState::commitTransaction(Transaction* activeTrx, int nestingLevel) {
int MMFilesTransactionState::commitTransaction(TransactionMethods* activeTrx, int nestingLevel) {
LOG_TRX(this, nestingLevel) << "committing " << AccessMode::typeString(_type) << " transaction";
TRI_ASSERT(_status == Transaction::Status::RUNNING);
TRI_ASSERT(_status == TransactionMethods::Status::RUNNING);
int res = TRI_ERROR_NO_ERROR;
@ -150,7 +150,7 @@ int MMFilesTransactionState::commitTransaction(Transaction* activeTrx, int nesti
return res;
}
updateStatus(Transaction::Status::COMMITTED);
updateStatus(TransactionMethods::Status::COMMITTED);
// if a write query, clear the query cache for the participating collections
if (AccessMode::isWriteOrExclusive(_type) &&
@ -168,17 +168,17 @@ int MMFilesTransactionState::commitTransaction(Transaction* activeTrx, int nesti
}
/// @brief abort and rollback a transaction
int MMFilesTransactionState::abortTransaction(Transaction* activeTrx, int nestingLevel) {
int MMFilesTransactionState::abortTransaction(TransactionMethods* activeTrx, int nestingLevel) {
LOG_TRX(this, nestingLevel) << "aborting " << AccessMode::typeString(_type) << " transaction";
TRI_ASSERT(_status == Transaction::Status::RUNNING);
TRI_ASSERT(_status == TransactionMethods::Status::RUNNING);
int res = TRI_ERROR_NO_ERROR;
if (nestingLevel == 0) {
res = writeAbortMarker();
updateStatus(Transaction::Status::ABORTED);
updateStatus(TransactionMethods::Status::ABORTED);
freeOperations(activeTrx);
}
@ -330,8 +330,8 @@ int MMFilesTransactionState::addOperation(TRI_voc_rid_t revisionId,
}
/// @brief free all operations for a transaction
void MMFilesTransactionState::freeOperations(Transaction* activeTrx) {
bool const mustRollback = (_status == Transaction::Status::ABORTED);
void MMFilesTransactionState::freeOperations(TransactionMethods* activeTrx) {
bool const mustRollback = (_status == TransactionMethods::Status::ABORTED);
TRI_ASSERT(activeTrx != nullptr);

View File

@ -42,7 +42,7 @@ namespace arangodb {
class LogicalCollection;
struct MMFilesDocumentOperation;
class MMFilesWalMarker;
class Transaction;
class TransactionMethods;
class TransactionCollection;
/// @brief transaction type
@ -55,13 +55,13 @@ class MMFilesTransactionState final : public TransactionState {
int beginTransaction(TransactionHints hints, int nestingLevel) override;
/// @brief commit a transaction
int commitTransaction(Transaction* trx, int nestingLevel) override;
int commitTransaction(TransactionMethods* trx, int nestingLevel) override;
/// @brief abort a transaction
int abortTransaction(Transaction* trx, int nestingLevel) override;
int abortTransaction(TransactionMethods* trx, int nestingLevel) override;
bool hasFailedOperations() const override {
return (_hasOperations && _status == Transaction::Status::ABORTED);
return (_hasOperations && _status == TransactionMethods::Status::ABORTED);
}
/// @brief add a WAL operation for a transaction collection
@ -96,7 +96,7 @@ class MMFilesTransactionState final : public TransactionState {
int writeCommitMarker();
/// @brief free all operations for a transaction
void freeOperations(Transaction* activeTrx);
void freeOperations(TransactionMethods* activeTrx);
};
}

View File

@ -350,7 +350,7 @@ bool MMFilesWalRecoverState::InitialScanMarker(TRI_df_marker_t const* marker,
MMFilesDatafileHelper::VPackOffset(type));
if (payloadSlice.isObject()) {
TRI_voc_rid_t revisionId =
Transaction::extractRevFromDocument(payloadSlice);
TransactionMethods::extractRevFromDocument(payloadSlice);
if (revisionId != UINT64_MAX && revisionId > state->maxRevisionId) {
state->maxRevisionId = revisionId;
}

View File

@ -473,7 +473,7 @@ bool InitialSyncer::checkAborted() {
////////////////////////////////////////////////////////////////////////////////
int InitialSyncer::applyCollectionDump(
Transaction& trx, std::string const& collectionName,
TransactionMethods& trx, std::string const& collectionName,
SimpleHttpResult* response, uint64_t& markersProcessed,
std::string& errorMsg) {
std::string const invalidMsg = "received invalid JSON data for collection " +

View File

@ -161,7 +161,7 @@ class InitialSyncer : public Syncer {
/// @brief apply the data from a collection dump
//////////////////////////////////////////////////////////////////////////////
int applyCollectionDump(Transaction&,
int applyCollectionDump(TransactionMethods&,
std::string const&,
httpclient::SimpleHttpResult*, uint64_t&,
std::string&);

View File

@ -370,7 +370,7 @@ arangodb::LogicalCollection* Syncer::getCollectionByIdOrName(TRI_voc_cid_t cid,
////////////////////////////////////////////////////////////////////////////////
int Syncer::applyCollectionDumpMarker(
Transaction& trx, std::string const& collectionName,
TransactionMethods& trx, std::string const& collectionName,
TRI_replication_operation_e type, VPackSlice const& old,
VPackSlice const& slice, std::string& errorMsg) {

View File

@ -45,7 +45,7 @@ class SimpleHttpClient;
class SimpleHttpResult;
}
class Transaction;
class TransactionMethods;
class Syncer {
public:
@ -130,7 +130,7 @@ class Syncer {
/// @brief apply a single marker from the collection dump
//////////////////////////////////////////////////////////////////////////////
int applyCollectionDumpMarker(Transaction&,
int applyCollectionDumpMarker(TransactionMethods&,
std::string const&,
TRI_replication_operation_e,
arangodb::velocypack::Slice const&,

View File

@ -67,7 +67,7 @@ void RestEdgesHandler::readCursor(
aql::AstNode* condition, aql::Variable const* var,
std::string const& collectionName, SingleCollectionTransaction& trx,
std::function<void(DocumentIdentifierToken const&)> cb) {
Transaction::IndexHandle indexId;
TransactionMethods::IndexHandle indexId;
bool foundIdx = trx.getBestIndexHandleForFilterCondition(
collectionName, condition, var, 1000, indexId);
if (!foundIdx) {

View File

@ -1889,7 +1889,7 @@ int RestReplicationHandler::processRestoreIndexesCoordinator(
////////////////////////////////////////////////////////////////////////////////
int RestReplicationHandler::applyCollectionDumpMarker(
Transaction& trx, CollectionNameResolver const& resolver,
TransactionMethods& trx, CollectionNameResolver const& resolver,
std::string const& collectionName, TRI_replication_operation_e type,
VPackSlice const& old, VPackSlice const& slice, std::string& errorMsg) {
if (type == REPLICATION_MARKER_DOCUMENT) {
@ -2041,7 +2041,7 @@ static int restoreDataParser(char const* ptr, char const* pos,
////////////////////////////////////////////////////////////////////////////////
int RestReplicationHandler::processRestoreDataBatch(
Transaction& trx,
TransactionMethods& trx,
std::string const& collectionName, bool useRevision, bool force,
std::string& errorMsg) {
std::string const invalidMsg =

View File

@ -33,7 +33,7 @@ namespace arangodb {
class ClusterInfo;
class CollectionNameResolver;
class LogicalCollection;
class Transaction;
class TransactionMethods;
////////////////////////////////////////////////////////////////////////////////
/// @brief replication request handler
@ -204,7 +204,7 @@ class RestReplicationHandler : public RestVocbaseBaseHandler {
/// @brief apply a single marker from the collection dump
//////////////////////////////////////////////////////////////////////////////
int applyCollectionDumpMarker(Transaction&,
int applyCollectionDumpMarker(TransactionMethods&,
CollectionNameResolver const&,
std::string const&,
TRI_replication_operation_e,
@ -215,7 +215,7 @@ class RestReplicationHandler : public RestVocbaseBaseHandler {
/// @brief restores the data of a collection TODO MOVE
//////////////////////////////////////////////////////////////////////////////
int processRestoreDataBatch(Transaction&,
int processRestoreDataBatch(TransactionMethods&,
std::string const&, bool, bool,
std::string&);

View File

@ -633,7 +633,7 @@ void RestVocbaseBaseHandler::prepareExecute() {
if (found) {
_nolockHeaderSet =
new std::unordered_set<std::string>{std::string(shardId)};
Transaction::_makeNolockHeaders = _nolockHeaderSet;
TransactionMethods::_makeNolockHeaders = _nolockHeaderSet;
}
}
@ -643,7 +643,7 @@ void RestVocbaseBaseHandler::prepareExecute() {
void RestVocbaseBaseHandler::finalizeExecute() {
if (_nolockHeaderSet != nullptr) {
Transaction::_makeNolockHeaders = nullptr;
TransactionMethods::_makeNolockHeaders = nullptr;
delete _nolockHeaderSet;
_nolockHeaderSet = nullptr;
}

View File

@ -30,7 +30,7 @@
namespace arangodb {
class LogicalCollection;
class Transaction;
class TransactionMethods;
class TransactionState;
/// @brief collection used in a transaction
@ -71,7 +71,7 @@ class TransactionCollection {
/// @brief whether or not any write operations for the collection happened
virtual bool hasOperations() const = 0;
virtual void freeOperations(Transaction* activeTrx, bool mustRollback) = 0;
virtual void freeOperations(TransactionMethods* activeTrx, bool mustRollback) = 0;
virtual bool canAccess(AccessMode::Type accessType) const = 0;
virtual int updateUsage(AccessMode::Type accessType, int nestingLevel) = 0;

View File

@ -45,7 +45,7 @@ TransactionState::TransactionState(TRI_vocbase_t* vocbase)
: _vocbase(vocbase),
_id(0),
_type(AccessMode::Type::READ),
_status(Transaction::Status::CREATED),
_status(TransactionMethods::Status::CREATED),
_arena(),
_collections{_arena}, // assign arena to vector
_rocksTransaction(nullptr),
@ -55,11 +55,11 @@ TransactionState::TransactionState(TRI_vocbase_t* vocbase)
_hasOperations(false),
_waitForSync(false),
_beginWritten(false),
_timeout(Transaction::DefaultLockTimeout) {}
_timeout(TransactionMethods::DefaultLockTimeout) {}
/// @brief free a transaction container
TransactionState::~TransactionState() {
TRI_ASSERT(_status != Transaction::Status::RUNNING);
TRI_ASSERT(_status != TransactionMethods::Status::RUNNING);
delete _rocksTransaction;
@ -86,8 +86,8 @@ std::vector<std::string> TransactionState::collectionNames() const {
/// @brief return the collection from a transaction
TransactionCollection* TransactionState::collection(TRI_voc_cid_t cid, AccessMode::Type accessType) {
TRI_ASSERT(_status == Transaction::Status::CREATED ||
_status == Transaction::Status::RUNNING);
TRI_ASSERT(_status == TransactionMethods::Status::CREATED ||
_status == TransactionMethods::Status::RUNNING);
size_t unused;
TransactionCollection* trxCollection = findCollection(cid, unused);
@ -118,7 +118,7 @@ int TransactionState::addCollection(TRI_voc_cid_t cid,
// upgrade transaction type if required
if (nestingLevel == 0) {
if (!force) {
TRI_ASSERT(_status == Transaction::Status::CREATED);
TRI_ASSERT(_status == TransactionMethods::Status::CREATED);
}
if (AccessMode::isWriteOrExclusive(accessType) && !AccessMode::isWriteOrExclusive(_type)) {
@ -281,16 +281,16 @@ void TransactionState::clearQueryCache() {
}
/// @brief update the status of a transaction
void TransactionState::updateStatus(Transaction::Status status) {
TRI_ASSERT(_status == Transaction::Status::CREATED ||
_status == Transaction::Status::RUNNING);
void TransactionState::updateStatus(TransactionMethods::Status status) {
TRI_ASSERT(_status == TransactionMethods::Status::CREATED ||
_status == TransactionMethods::Status::RUNNING);
if (_status == Transaction::Status::CREATED) {
TRI_ASSERT(status == Transaction::Status::RUNNING ||
status == Transaction::Status::ABORTED);
} else if (_status == Transaction::Status::RUNNING) {
TRI_ASSERT(status == Transaction::Status::COMMITTED ||
status == Transaction::Status::ABORTED);
if (_status == TransactionMethods::Status::CREATED) {
TRI_ASSERT(status == TransactionMethods::Status::RUNNING ||
status == TransactionMethods::Status::ABORTED);
} else if (_status == TransactionMethods::Status::RUNNING) {
TRI_ASSERT(status == TransactionMethods::Status::COMMITTED ||
status == TransactionMethods::Status::ABORTED);
}
_status = status;

View File

@ -38,7 +38,7 @@ class Transaction;
}
namespace arangodb {
class Transaction;
class TransactionMethods;
class TransactionCollection;
/// @brief transaction type
@ -85,7 +85,7 @@ class TransactionState {
}
/// @brief update the status of a transaction
void updateStatus(Transaction::Status status);
void updateStatus(TransactionMethods::Status status);
/// @brief whether or not a specific hint is set for the transaction
bool hasHint(TransactionHints::Hint hint) const {
@ -96,10 +96,10 @@ class TransactionState {
virtual int beginTransaction(TransactionHints hints, int nestingLevel) = 0;
/// @brief commit a transaction
virtual int commitTransaction(Transaction* trx, int nestingLevel) = 0;
virtual int commitTransaction(TransactionMethods* trx, int nestingLevel) = 0;
/// @brief abort a transaction
virtual int abortTransaction(Transaction* trx, int nestingLevel) = 0;
virtual int abortTransaction(TransactionMethods* trx, int nestingLevel) = 0;
/// TODO: implement this in base class
virtual bool hasFailedOperations() const = 0;
@ -114,7 +114,7 @@ class TransactionState {
}
/// @brief free all operations for a transaction
void freeOperations(Transaction* activeTrx);
void freeOperations(TransactionMethods* activeTrx);
/// @brief release collection locks for a transaction
int releaseCollections();
@ -127,7 +127,7 @@ class TransactionState {
TRI_vocbase_t* _vocbase; // vocbase
TRI_voc_tid_t _id; // local trx id
AccessMode::Type _type; // access type (read|write)
Transaction::Status _status; // current status
TransactionMethods::Status _status; // current status
protected:
SmallVector<TransactionCollection*>::allocator_type::arena_type _arena; // memory for collections

View File

@ -32,7 +32,7 @@
namespace arangodb {
class AqlTransaction final : public Transaction {
class AqlTransaction final : public TransactionMethods {
public:
//////////////////////////////////////////////////////////////////////////////
/// @brief create the transaction and add all collections from the query
@ -43,7 +43,7 @@ class AqlTransaction final : public Transaction {
std::shared_ptr<TransactionContext> transactionContext,
std::map<std::string, aql::Collection*> const* collections,
bool isMainTransaction)
: Transaction(transactionContext),
: TransactionMethods(transactionContext),
_collections(*collections) {
if (!isMainTransaction) {
addHint(TransactionHints::Hint::LOCK_NEVER, true);
@ -118,7 +118,7 @@ class AqlTransaction final : public Transaction {
/// AQL query running on the coordinator
//////////////////////////////////////////////////////////////////////////////
Transaction* clone() const override {
TransactionMethods* clone() const override {
return new AqlTransaction(StandaloneTransactionContext::Create(_vocbase),
&_collections, false);
}

View File

@ -125,7 +125,7 @@ void CollectionKeys::create(TRI_voc_tick_t maxTick) {
// now sort all markers without the read-lock
std::sort(_vpack.begin(), _vpack.end(),
[](uint8_t const* lhs, uint8_t const* rhs) -> bool {
return (StringRef(Transaction::extractKeyFromDocument(VPackSlice(lhs))) < StringRef(Transaction::extractKeyFromDocument(VPackSlice(rhs))));
return (StringRef(TransactionMethods::extractKeyFromDocument(VPackSlice(lhs))) < StringRef(TransactionMethods::extractKeyFromDocument(VPackSlice(rhs))));
});
}
@ -154,13 +154,13 @@ std::tuple<std::string, std::string, uint64_t> CollectionKeys::hashChunk(
// we can get away with the fast hash function here, as key values are
// restricted to strings
hash ^= Transaction::extractKeyFromDocument(current).hashString();
hash ^= Transaction::extractRevSliceFromDocument(current).hash();
hash ^= TransactionMethods::extractKeyFromDocument(current).hashString();
hash ^= TransactionMethods::extractRevSliceFromDocument(current).hash();
}
return std::make_tuple(
Transaction::extractKeyFromDocument(first).copyString(),
Transaction::extractKeyFromDocument(last).copyString(),
TransactionMethods::extractKeyFromDocument(first).copyString(),
TransactionMethods::extractKeyFromDocument(last).copyString(),
hash);
}

View File

@ -33,11 +33,11 @@ struct TRI_vocbase_t;
namespace arangodb {
class ReplicationTransaction : public Transaction {
class ReplicationTransaction : public TransactionMethods {
public:
/// @brief create the transaction
ReplicationTransaction(TRI_vocbase_t* vocbase)
: Transaction(StandaloneTransactionContext::Create(vocbase)) {
: TransactionMethods(StandaloneTransactionContext::Create(vocbase)) {
_vocbase->use();
}

View File

@ -40,7 +40,7 @@ using namespace arangodb;
SingleCollectionTransaction::SingleCollectionTransaction(
std::shared_ptr<TransactionContext> transactionContext, TRI_voc_cid_t cid,
AccessMode::Type accessType)
: Transaction(transactionContext),
: TransactionMethods(transactionContext),
_cid(cid),
_trxCollection(nullptr),
_documentCollection(nullptr),
@ -59,7 +59,7 @@ SingleCollectionTransaction::SingleCollectionTransaction(
SingleCollectionTransaction::SingleCollectionTransaction(
std::shared_ptr<TransactionContext> transactionContext,
std::string const& name, AccessMode::Type accessType)
: Transaction(transactionContext),
: TransactionMethods(transactionContext),
_cid(0),
_trxCollection(nullptr),
_documentCollection(nullptr),

View File

@ -33,7 +33,7 @@ namespace arangodb {
class DocumentDitch;
class TransactionContext;
class SingleCollectionTransaction : public Transaction {
class SingleCollectionTransaction : public TransactionMethods {
public:
//////////////////////////////////////////////////////////////////////////////

View File

@ -55,7 +55,7 @@ struct CustomTypeHandler final : public VPackCustomTypeHandler {
std::string toString(VPackSlice const& value, VPackOptions const* options,
VPackSlice const& base) override final {
return Transaction::extractIdString(resolver, value, base);
return TransactionMethods::extractIdString(resolver, value, base);
}
TRI_vocbase_t* vocbase;

View File

@ -46,7 +46,7 @@ struct CustomTypeHandler;
class CollectionNameResolver;
class DocumentDitch;
class LogicalCollection;
class Transaction;
class TransactionMethods;
class TransactionState;
class TransactionContext {

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
#define LOG_TRX(trx, level) \
LOG_TOPIC(TRACE, arangodb::Logger::FIXME) << "trx #" << trx->_id << "." << level << " (" << Transaction::statusString(trx->_status) << "): "
LOG_TOPIC(TRACE, arangodb::Logger::FIXME) << "trx #" << trx->_id << "." << level << " (" << TransactionMethods::statusString(trx->_status) << "): "
#else
@ -89,7 +89,7 @@ class TransactionContext;
class TransactionState;
class TransactionCollection;
class Transaction {
class TransactionMethods {
friend class traverser::BaseTraverserEngine;
public:
@ -106,15 +106,15 @@ class Transaction {
/// @brief return the status of the transaction as a string
static char const* statusString(Status status) {
switch (status) {
case Transaction::Status::UNDEFINED:
case TransactionMethods::Status::UNDEFINED:
return "undefined";
case Transaction::Status::CREATED:
case TransactionMethods::Status::CREATED:
return "created";
case Transaction::Status::RUNNING:
case TransactionMethods::Status::RUNNING:
return "running";
case Transaction::Status::COMMITTED:
case TransactionMethods::Status::COMMITTED:
return "committed";
case Transaction::Status::ABORTED:
case TransactionMethods::Status::ABORTED:
return "aborted";
}
@ -126,7 +126,7 @@ class Transaction {
static constexpr double DefaultLockTimeout = 30.0;
class IndexHandle {
friend class Transaction;
friend class TransactionMethods;
std::shared_ptr<arangodb::Index> _index;
public:
IndexHandle() = default;
@ -151,21 +151,21 @@ class Transaction {
double const TRX_FOLLOWER_TIMEOUT = 3.0;
/// @brief Transaction
/// @brief TransactionMethods
private:
Transaction() = delete;
Transaction(Transaction const&) = delete;
Transaction& operator=(Transaction const&) = delete;
TransactionMethods() = delete;
TransactionMethods(TransactionMethods const&) = delete;
TransactionMethods& operator=(TransactionMethods const&) = delete;
protected:
/// @brief create the transaction
explicit Transaction(std::shared_ptr<TransactionContext> transactionContext);
explicit TransactionMethods(std::shared_ptr<TransactionContext> transactionContext);
public:
/// @brief destroy the transaction
virtual ~Transaction();
virtual ~TransactionMethods();
public:
@ -470,7 +470,7 @@ class Transaction {
virtual int lockCollections();
/// @brief Clone this transaction. Only works for selected sub-classes
virtual Transaction* clone() const;
virtual TransactionMethods* clone() const;
private:
@ -619,7 +619,7 @@ class Transaction {
bool sortOrs(arangodb::aql::Ast* ast,
arangodb::aql::AstNode* root,
arangodb::aql::Variable const* variable,
std::vector<Transaction::IndexHandle>& usedIndexes);
std::vector<TransactionMethods::IndexHandle>& usedIndexes);
/// @brief findIndexHandleForAndNode
std::pair<bool, bool> findIndexHandleForAndNode(
@ -627,7 +627,7 @@ class Transaction {
arangodb::aql::Variable const* reference,
arangodb::aql::SortCondition const* sortCondition,
size_t itemsInCollection,
std::vector<Transaction::IndexHandle>& usedIndexes,
std::vector<TransactionMethods::IndexHandle>& usedIndexes,
arangodb::aql::AstNode*& specializedCondition,
bool& isSparse) const;
@ -636,7 +636,7 @@ class Transaction {
arangodb::aql::AstNode*& node,
arangodb::aql::Variable const* reference,
size_t itemsInCollection,
Transaction::IndexHandle& usedIndex) const;
TransactionMethods::IndexHandle& usedIndex) const;
/// @brief Get one index by id for a collection name, coordinator case
std::shared_ptr<arangodb::Index> indexForCollectionCoordinator(
@ -743,7 +743,7 @@ class Transaction {
class StringBufferLeaser {
public:
explicit StringBufferLeaser(Transaction*);
explicit StringBufferLeaser(TransactionMethods*);
explicit StringBufferLeaser(TransactionContext*);
~StringBufferLeaser();
arangodb::basics::StringBuffer* stringBuffer() const { return _stringBuffer; }
@ -756,7 +756,7 @@ class StringBufferLeaser {
class TransactionBuilderLeaser {
public:
explicit TransactionBuilderLeaser(Transaction*);
explicit TransactionBuilderLeaser(TransactionMethods*);
explicit TransactionBuilderLeaser(TransactionContext*);
~TransactionBuilderLeaser();
inline arangodb::velocypack::Builder* builder() const { return _builder; }

View File

@ -31,7 +31,7 @@
namespace arangodb {
class UserTransaction final : public Transaction {
class UserTransaction final : public TransactionMethods {
public:
/// @brief create the transaction
UserTransaction(std::shared_ptr<V8TransactionContext> transactionContext,
@ -40,7 +40,7 @@ class UserTransaction final : public Transaction {
std::vector<std::string> const& exclusiveCollections,
double lockTimeout, bool waitForSync,
bool allowImplicitCollections)
: Transaction(transactionContext) {
: TransactionMethods(transactionContext) {
addHint(TransactionHints::Hint::LOCK_ENTIRELY, false);
if (lockTimeout >= 0.0) {

View File

@ -32,7 +32,7 @@ using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::traverser;
ShortestPathOptions::ShortestPathOptions(Transaction* trx)
ShortestPathOptions::ShortestPathOptions(TransactionMethods* trx)
: BasicOptions(trx),
direction("outbound"),
useWeight(false),

View File

@ -41,11 +41,11 @@ namespace traverser {
// Should not be used directly, use specialization instead.
struct BasicOptions {
Transaction* _trx;
TransactionMethods* _trx;
protected:
explicit BasicOptions(Transaction* trx)
explicit BasicOptions(TransactionMethods* trx)
: _trx(trx) {}
virtual ~BasicOptions() {
@ -57,7 +57,7 @@ struct BasicOptions {
public:
Transaction* trx() { return _trx; }
TransactionMethods* trx() { return _trx; }
};
@ -73,7 +73,7 @@ struct ShortestPathOptions : BasicOptions {
arangodb::velocypack::Builder startBuilder;
arangodb::velocypack::Builder endBuilder;
explicit ShortestPathOptions(Transaction* trx);
explicit ShortestPathOptions(TransactionMethods* trx);
void setStart(std::string const&);
void setEnd(std::string const&);

View File

@ -223,7 +223,7 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
// We directly read the entire cursor. so batchsize == limit
std::unique_ptr<OperationCursor> opCursor =
trx.indexScan(collectionName, Transaction::CursorType::ALL, nullptr, skip,
trx.indexScan(collectionName, TransactionMethods::CursorType::ALL, nullptr, skip,
limit, limit, false);
if (opCursor->failed()) {
@ -393,10 +393,10 @@ static void JS_ChecksumCollection(
collection->readDocument(&trx, mmdr, token);
VPackSlice const slice(mmdr.vpack());
uint64_t localHash = Transaction::extractKeyFromDocument(slice).hashString();
uint64_t localHash = TransactionMethods::extractKeyFromDocument(slice).hashString();
if (withRevisions) {
localHash += Transaction::extractRevSliceFromDocument(slice).hash();
localHash += TransactionMethods::extractRevSliceFromDocument(slice).hash();
}
if (withData) {

View File

@ -156,7 +156,7 @@ static void JS_Transaction(v8::FunctionCallbackInfo<v8::Value> const& args) {
// extract the properties from the object
// "lockTimeout"
double lockTimeout = Transaction::DefaultLockTimeout;
double lockTimeout = TransactionMethods::DefaultLockTimeout;
if (object->Has(TRI_V8_ASCII_STRING("lockTimeout"))) {
static std::string const timeoutError =

View File

@ -26,7 +26,7 @@
using namespace arangodb::traverser;
EdgeCollectionInfo::EdgeCollectionInfo(Transaction* trx,
EdgeCollectionInfo::EdgeCollectionInfo(TransactionMethods* trx,
std::string const& collectionName,
TRI_edge_direction_e const direction,
std::string const& weightAttribute,

Some files were not shown because too many files have changed in this diff Show More