mirror of https://gitee.com/bigwinds/arangodb
Added an option to serialize Variables in TraverserOptions.
This commit is contained in:
parent
02f854beeb
commit
64e4ee636d
|
@ -61,3 +61,14 @@ void FixedVarExpressionContext::setVariableValue(Variable const* var,
|
|||
AqlValue value) {
|
||||
_vars.emplace(var, value);
|
||||
}
|
||||
|
||||
void FixedVarExpressionContext::serializeAllVariables(
|
||||
arangodb::Transaction* trx, VPackBuilder& builder) const {
|
||||
TRI_ASSERT(builder.isOpenArray());
|
||||
for (auto const& it : _vars) {
|
||||
builder.openArray();
|
||||
it.first->toVelocyPack(builder);
|
||||
it.second.toVelocyPack(trx, builder, true);
|
||||
builder.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ class FixedVarExpressionContext : public ExpressionContext {
|
|||
|
||||
void setVariableValue(Variable const*, AqlValue);
|
||||
|
||||
void serializeAllVariables(arangodb::Transaction*,
|
||||
arangodb::velocypack::Builder&) const;
|
||||
|
||||
private:
|
||||
/// @brief temporary storage for expression data context
|
||||
std::unordered_map<Variable const*, AqlValue> _vars;
|
||||
|
|
|
@ -294,6 +294,8 @@ void TraversalBlock::initializePaths(AqlItemBlock const* items, size_t pos) {
|
|||
return;
|
||||
}
|
||||
|
||||
initializeExpressions(items, pos);
|
||||
|
||||
if (!_useRegister) {
|
||||
if (!_usedConstant) {
|
||||
_usedConstant = true;
|
||||
|
@ -326,7 +328,6 @@ void TraversalBlock::initializePaths(AqlItemBlock const* items, size_t pos) {
|
|||
"allowed");
|
||||
}
|
||||
}
|
||||
initializeExpressions(items, pos);
|
||||
|
||||
// cppcheck-suppress style
|
||||
DEBUG_END_BLOCK();
|
||||
|
|
|
@ -649,3 +649,9 @@ void arangodb::traverser::TraverserOptions::linkTraverser(
|
|||
_traverser = trav;
|
||||
}
|
||||
|
||||
void arangodb::traverser::TraverserOptions::serializeVariables(
|
||||
VPackBuilder& builder) const {
|
||||
TRI_ASSERT(builder.isOpenArray());
|
||||
_ctx->serializeAllVariables(_trx, builder);
|
||||
}
|
||||
|
||||
|
|
|
@ -161,6 +161,8 @@ struct TraverserOptions {
|
|||
|
||||
void linkTraverser(arangodb::traverser::ClusterTraverser*);
|
||||
|
||||
void serializeVariables(arangodb::velocypack::Builder&) const;
|
||||
|
||||
private:
|
||||
EdgeCursor* nextCursorLocal(arangodb::velocypack::Slice, size_t,
|
||||
std::vector<LookupInfo>&) const;
|
||||
|
|
Loading…
Reference in New Issue