mirror of https://gitee.com/bigwinds/arangodb
fix size_t vs uint64_t confusion
This commit is contained in:
parent
16a9ddd78d
commit
1e78acad49
|
@ -184,7 +184,7 @@ static bool checkPathVariableAccessFeasible(Ast* ast, AstNode* parent,
|
|||
auto unusedWalker = [](AstNode const* n, void*) {};
|
||||
bool isEdge = false;
|
||||
// We define that depth == UINT64_MAX is "ALL depths"
|
||||
size_t depth = UINT64_MAX;
|
||||
uint64_t depth = UINT64_MAX;
|
||||
void* unused = nullptr;
|
||||
AstNode* parentOfReplace = nullptr;
|
||||
size_t replaceIdx = 0;
|
||||
|
@ -239,7 +239,7 @@ static bool checkPathVariableAccessFeasible(Ast* ast, AstNode* parent,
|
|||
notSupported = true;
|
||||
return node;
|
||||
}
|
||||
depth = static_cast<size_t>(node->value.value._int);
|
||||
depth = static_cast<uint64_t>(node->value.value._int);
|
||||
break;
|
||||
}
|
||||
case NODE_TYPE_ITERATOR:
|
||||
|
|
|
@ -1121,7 +1121,7 @@ void TraversalNode::setCondition(arangodb::aql::Condition* condition) {
|
|||
}
|
||||
|
||||
void TraversalNode::registerCondition(bool isConditionOnEdge,
|
||||
size_t conditionLevel,
|
||||
uint64_t conditionLevel,
|
||||
AstNode const* condition) {
|
||||
Ast::getReferencedVariables(condition, _conditionVariables);
|
||||
if (isConditionOnEdge) {
|
||||
|
|
|
@ -218,7 +218,7 @@ class TraversalNode : public ExecutionNode {
|
|||
/// @brief register a filter condition on a given search depth.
|
||||
/// If this condition is not fulfilled a traversal will abort.
|
||||
/// The condition will contain the local variable for it's accesses.
|
||||
void registerCondition(bool, size_t, AstNode const*);
|
||||
void registerCondition(bool, uint64_t, AstNode const*);
|
||||
|
||||
/// @brief register a filter condition for all search depths
|
||||
/// If this condition is not fulfilled a traversal will abort.
|
||||
|
@ -328,11 +328,11 @@ class TraversalNode : public ExecutionNode {
|
|||
std::vector<AstNode const*> _globalVertexConditions;
|
||||
|
||||
/// @brief List of all depth specific conditions for edges
|
||||
std::unordered_map<size_t, std::unique_ptr<TraversalEdgeConditionBuilder>>
|
||||
std::unordered_map<uint64_t, std::unique_ptr<TraversalEdgeConditionBuilder>>
|
||||
_edgeConditions;
|
||||
|
||||
/// @brief List of all depth specific conditions for vertices
|
||||
std::unordered_map<size_t, AstNode*> _vertexConditions;
|
||||
std::unordered_map<uint64_t, AstNode*> _vertexConditions;
|
||||
|
||||
/// @brief Flag if options are already prepared. After
|
||||
/// this flag was set the node cannot be cloned
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
using ClusterEdgeCursor = arangodb::traverser::ClusterEdgeCursor;
|
||||
|
||||
ClusterEdgeCursor::ClusterEdgeCursor(VPackSlice v, size_t depth,
|
||||
ClusterEdgeCursor::ClusterEdgeCursor(VPackSlice v, uint64_t depth,
|
||||
arangodb::traverser::ClusterTraverser* traverser)
|
||||
: _position(0) {
|
||||
TransactionBuilderLeaser leased(traverser->_trx);
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace traverser {
|
|||
class ClusterEdgeCursor : public EdgeCursor {
|
||||
|
||||
public:
|
||||
ClusterEdgeCursor(arangodb::velocypack::Slice, size_t, ClusterTraverser*);
|
||||
ClusterEdgeCursor(arangodb::velocypack::Slice, uint64_t, ClusterTraverser*);
|
||||
|
||||
~ClusterEdgeCursor() {
|
||||
}
|
||||
|
|
|
@ -222,10 +222,10 @@ class BreadthFirstEnumerator final : public PathEnumerator {
|
|||
/// @brief Marker for the search depth. Used to abort searching.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
size_t _currentDepth;
|
||||
uint64_t _currentDepth;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief position in _toSerach. If this is >= _toSearch.size() we are done
|
||||
/// @brief position in _toSearch. If this is >= _toSearch.size() we are done
|
||||
/// with this depth.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -288,7 +288,7 @@ class NeighborsEnumerator final : public PathEnumerator {
|
|||
_lastDepth;
|
||||
|
||||
std::unordered_set<arangodb::basics::VPackHashedSlice, arangodb::basics::VelocyPackHelper::VPackHashedStringHash, arangodb::basics::VelocyPackHelper::VPackHashedStringEqual>::iterator _iterator;
|
||||
size_t _searchDepth;
|
||||
uint64_t _searchDepth;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Vector storing the position at current search depth
|
||||
|
|
|
@ -259,6 +259,6 @@ bool SingleServerTraverser::getVertex(VPackSlice edge,
|
|||
}
|
||||
|
||||
bool SingleServerTraverser::getSingleVertex(VPackSlice edge, VPackSlice vertex,
|
||||
size_t depth, VPackSlice& result) {
|
||||
uint64_t depth, VPackSlice& result) {
|
||||
return _vertexGetter->getSingleVertex(edge, vertex, depth, result);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class SingleServerTraverser final : public Traverser {
|
|||
/// Returns true if the vertex passes filtering conditions
|
||||
|
||||
bool getSingleVertex(arangodb::velocypack::Slice, arangodb::velocypack::Slice,
|
||||
size_t depth, arangodb::velocypack::Slice&) override;
|
||||
uint64_t depth, arangodb::velocypack::Slice&) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Function to fetch the real data of a vertex into an AQLValue
|
||||
|
|
|
@ -89,7 +89,7 @@ bool Traverser::VertexGetter::getVertex(
|
|||
|
||||
bool Traverser::VertexGetter::getSingleVertex(VPackSlice edge,
|
||||
VPackSlice cmp,
|
||||
size_t depth,
|
||||
uint64_t depth,
|
||||
VPackSlice& result) {
|
||||
VPackSlice from = Transaction::extractFromFromDocument(edge);
|
||||
if (from != cmp) {
|
||||
|
@ -132,7 +132,7 @@ bool Traverser::UniqueVertexGetter::getVertex(
|
|||
}
|
||||
|
||||
bool Traverser::UniqueVertexGetter::getSingleVertex(
|
||||
VPackSlice edge, VPackSlice cmp, size_t depth, VPackSlice& result) {
|
||||
VPackSlice edge, VPackSlice cmp, uint64_t depth, VPackSlice& result) {
|
||||
result = Transaction::extractFromFromDocument(edge);
|
||||
|
||||
if (cmp == result) {
|
||||
|
@ -181,7 +181,7 @@ Traverser::Traverser(arangodb::traverser::TraverserOptions* opts, arangodb::Tran
|
|||
|
||||
bool arangodb::traverser::Traverser::edgeMatchesConditions(VPackSlice e,
|
||||
VPackSlice vid,
|
||||
size_t depth,
|
||||
uint64_t depth,
|
||||
size_t cursorId) {
|
||||
if (!_opts->evaluateEdgeExpression(e, vid, depth, cursorId)) {
|
||||
++_filteredPaths;
|
||||
|
@ -190,7 +190,7 @@ bool arangodb::traverser::Traverser::edgeMatchesConditions(VPackSlice e,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool arangodb::traverser::Traverser::vertexMatchesConditions(VPackSlice v, size_t depth) {
|
||||
bool arangodb::traverser::Traverser::vertexMatchesConditions(VPackSlice v, uint64_t depth) {
|
||||
TRI_ASSERT(v.isString());
|
||||
if (_opts->vertexHasFilter(depth)) {
|
||||
aql::AqlValue vertex = fetchVertexData(v);
|
||||
|
|
|
@ -184,7 +184,7 @@ class Traverser {
|
|||
std::vector<arangodb::velocypack::Slice>&);
|
||||
|
||||
virtual bool getSingleVertex(arangodb::velocypack::Slice,
|
||||
arangodb::velocypack::Slice, size_t,
|
||||
arangodb::velocypack::Slice, uint64_t,
|
||||
arangodb::velocypack::Slice&);
|
||||
|
||||
virtual void reset(arangodb::velocypack::Slice);
|
||||
|
@ -208,7 +208,7 @@ class Traverser {
|
|||
std::vector<arangodb::velocypack::Slice>&) override;
|
||||
|
||||
bool getSingleVertex(arangodb::velocypack::Slice,
|
||||
arangodb::velocypack::Slice, size_t,
|
||||
arangodb::velocypack::Slice, uint64_t,
|
||||
arangodb::velocypack::Slice&) override;
|
||||
|
||||
void reset(arangodb::velocypack::Slice) override;
|
||||
|
@ -268,7 +268,7 @@ class Traverser {
|
|||
/// Returns true if the vertex passes filtering conditions
|
||||
|
||||
virtual bool getSingleVertex(arangodb::velocypack::Slice,
|
||||
arangodb::velocypack::Slice, size_t,
|
||||
arangodb::velocypack::Slice, uint64_t,
|
||||
arangodb::velocypack::Slice&) = 0;
|
||||
public:
|
||||
|
||||
|
@ -329,9 +329,9 @@ class Traverser {
|
|||
bool hasMore() { return !_done; }
|
||||
|
||||
bool edgeMatchesConditions(arangodb::velocypack::Slice,
|
||||
arangodb::velocypack::Slice, size_t, size_t);
|
||||
arangodb::velocypack::Slice, uint64_t, size_t);
|
||||
|
||||
bool vertexMatchesConditions(arangodb::velocypack::Slice, size_t);
|
||||
bool vertexMatchesConditions(arangodb::velocypack::Slice, uint64_t);
|
||||
|
||||
void allowOptimizedNeighbors();
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ arangodb::traverser::TraverserOptions::TraverserOptions(
|
|||
}
|
||||
_depthLookupInfo.reserve(read.length());
|
||||
for (auto const& depth : VPackObjectIterator(read)) {
|
||||
size_t d = basics::StringUtils::uint64(depth.key.copyString());
|
||||
uint64_t d = basics::StringUtils::uint64(depth.key.copyString());
|
||||
auto it = _depthLookupInfo.emplace(d, std::vector<LookupInfo>());
|
||||
TRI_ASSERT(it.second);
|
||||
VPackSlice list = depth.value;
|
||||
|
@ -318,7 +318,7 @@ arangodb::traverser::TraverserOptions::TraverserOptions(
|
|||
|
||||
_vertexExpressions.reserve(read.length());
|
||||
for (auto const& info : VPackObjectIterator(read)) {
|
||||
size_t d = basics::StringUtils::uint64(info.key.copyString());
|
||||
uint64_t d = basics::StringUtils::uint64(info.key.copyString());
|
||||
#ifdef ARANGODB_ENABLE_MAINAINER_MODE
|
||||
auto it = _vertexExpressions.emplace(
|
||||
d, new aql::Expression(query->ast(), info.value));
|
||||
|
@ -528,7 +528,7 @@ void arangodb::traverser::TraverserOptions::buildEngineInfo(VPackBuilder& result
|
|||
}
|
||||
|
||||
bool arangodb::traverser::TraverserOptions::vertexHasFilter(
|
||||
size_t depth) const {
|
||||
uint64_t depth) const {
|
||||
if (_baseVertexExpression != nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ bool arangodb::traverser::TraverserOptions::vertexHasFilter(
|
|||
|
||||
bool arangodb::traverser::TraverserOptions::evaluateEdgeExpression(
|
||||
arangodb::velocypack::Slice edge, arangodb::velocypack::Slice vertex,
|
||||
size_t depth, size_t cursorId) const {
|
||||
uint64_t depth, size_t cursorId) const {
|
||||
if (_isCoordinator) {
|
||||
// The Coordinator never checks conditions. The DBServer is responsible!
|
||||
return true;
|
||||
|
@ -589,7 +589,7 @@ bool arangodb::traverser::TraverserOptions::evaluateEdgeExpression(
|
|||
}
|
||||
|
||||
bool arangodb::traverser::TraverserOptions::evaluateVertexExpression(
|
||||
arangodb::velocypack::Slice vertex, size_t depth) const {
|
||||
arangodb::velocypack::Slice vertex, uint64_t depth) const {
|
||||
arangodb::aql::Expression* expression = nullptr;
|
||||
|
||||
auto specific = _vertexExpressions.find(depth);
|
||||
|
@ -620,7 +620,7 @@ bool arangodb::traverser::TraverserOptions::evaluateVertexExpression(
|
|||
arangodb::traverser::EdgeCursor*
|
||||
arangodb::traverser::TraverserOptions::nextCursor(ManagedDocumentResult* mmdr,
|
||||
VPackSlice vertex,
|
||||
size_t depth) const {
|
||||
uint64_t depth) const {
|
||||
if (_isCoordinator) {
|
||||
return nextCursorCoordinator(vertex, depth);
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ arangodb::traverser::TraverserOptions::nextCursor(ManagedDocumentResult* mmdr,
|
|||
|
||||
arangodb::traverser::EdgeCursor*
|
||||
arangodb::traverser::TraverserOptions::nextCursorLocal(ManagedDocumentResult* mmdr,
|
||||
VPackSlice vertex, size_t depth, std::vector<LookupInfo>& list) const {
|
||||
VPackSlice vertex, uint64_t depth, std::vector<LookupInfo>& list) const {
|
||||
TRI_ASSERT(mmdr != nullptr);
|
||||
auto allCursor = std::make_unique<SingleServerEdgeCursor>(mmdr, _trx, list.size());
|
||||
auto& opCursors = allCursor->getCursors();
|
||||
|
@ -670,7 +670,7 @@ arangodb::traverser::TraverserOptions::nextCursorLocal(ManagedDocumentResult* mm
|
|||
|
||||
arangodb::traverser::EdgeCursor*
|
||||
arangodb::traverser::TraverserOptions::nextCursorCoordinator(
|
||||
VPackSlice vertex, size_t depth) const {
|
||||
VPackSlice vertex, uint64_t depth) const {
|
||||
TRI_ASSERT(_traverser != nullptr);
|
||||
auto cursor = std::make_unique<ClusterEdgeCursor>(vertex, depth, _traverser);
|
||||
return cursor.release();
|
||||
|
|
|
@ -98,8 +98,8 @@ struct TraverserOptions {
|
|||
arangodb::Transaction* _trx;
|
||||
protected:
|
||||
std::vector<LookupInfo> _baseLookupInfos;
|
||||
std::unordered_map<size_t, std::vector<LookupInfo>> _depthLookupInfo;
|
||||
std::unordered_map<size_t, aql::Expression*> _vertexExpressions;
|
||||
std::unordered_map<uint64_t, std::vector<LookupInfo>> _depthLookupInfo;
|
||||
std::unordered_map<uint64_t, aql::Expression*> _vertexExpressions;
|
||||
aql::Expression* _baseVertexExpression;
|
||||
aql::Variable const* _tmpVar;
|
||||
aql::FixedVarExpressionContext* _ctx;
|
||||
|
@ -151,15 +151,15 @@ struct TraverserOptions {
|
|||
/// for DBServer traverser engines.
|
||||
void buildEngineInfo(arangodb::velocypack::Builder&) const;
|
||||
|
||||
bool vertexHasFilter(size_t) const;
|
||||
bool vertexHasFilter(uint64_t) const;
|
||||
|
||||
bool evaluateEdgeExpression(arangodb::velocypack::Slice,
|
||||
arangodb::velocypack::Slice, size_t,
|
||||
arangodb::velocypack::Slice, uint64_t,
|
||||
size_t) const;
|
||||
|
||||
bool evaluateVertexExpression(arangodb::velocypack::Slice, size_t) const;
|
||||
bool evaluateVertexExpression(arangodb::velocypack::Slice, uint64_t) const;
|
||||
|
||||
EdgeCursor* nextCursor(ManagedDocumentResult*, arangodb::velocypack::Slice, size_t) const;
|
||||
EdgeCursor* nextCursor(ManagedDocumentResult*, arangodb::velocypack::Slice, uint64_t) const;
|
||||
|
||||
void clearVariableValues();
|
||||
|
||||
|
@ -171,10 +171,10 @@ struct TraverserOptions {
|
|||
|
||||
private:
|
||||
EdgeCursor* nextCursorLocal(ManagedDocumentResult*,
|
||||
arangodb::velocypack::Slice, size_t,
|
||||
arangodb::velocypack::Slice, uint64_t,
|
||||
std::vector<LookupInfo>&) const;
|
||||
|
||||
EdgeCursor* nextCursorCoordinator(arangodb::velocypack::Slice, size_t) const;
|
||||
EdgeCursor* nextCursorCoordinator(arangodb::velocypack::Slice, uint64_t) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue