mirror of https://gitee.com/bigwinds/arangodb
refactor execution node type enum to be less error prone
This commit is contained in:
parent
2733bf9e1c
commit
ddd8ef6667
|
@ -162,6 +162,11 @@ bool ConditionFinder::before(ExecutionNode* en) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -295,6 +295,10 @@ ExecutionNode* ExecutionNode::fromVPackFactory(
|
||||||
case SCATTER_IRESEARCH_VIEW:
|
case SCATTER_IRESEARCH_VIEW:
|
||||||
return new iresearch::IResearchViewScatterNode(*plan, slice);
|
return new iresearch::IResearchViewScatterNode(*plan, slice);
|
||||||
#endif
|
#endif
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -1143,6 +1147,11 @@ void ExecutionNode::RegisterPlan::after(ExecutionNode* en) {
|
||||||
// these node type does not produce any new registers
|
// these node type does not produce any new registers
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
en->_depth = depth;
|
en->_depth = depth;
|
||||||
|
|
|
@ -131,18 +131,12 @@ class ExecutionNode {
|
||||||
INDEX = 23,
|
INDEX = 23,
|
||||||
SHORTEST_PATH = 24,
|
SHORTEST_PATH = 24,
|
||||||
#ifdef USE_IRESEARCH
|
#ifdef USE_IRESEARCH
|
||||||
ENUMERATE_IRESEARCH_VIEW = 25,
|
ENUMERATE_IRESEARCH_VIEW,
|
||||||
SCATTER_IRESEARCH_VIEW = 26
|
SCATTER_IRESEARCH_VIEW,
|
||||||
#endif
|
#endif
|
||||||
// adjust MaxNodeTypeValue below when new ExecutionNode types are added!
|
MAX_NODE_TYPE_VALUE
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_IRESEARCH
|
|
||||||
static constexpr size_t MaxNodeTypeValue = SCATTER_IRESEARCH_VIEW;
|
|
||||||
#else
|
|
||||||
static constexpr size_t MaxNodeTypeValue = SHORTEST_PATH;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ExecutionNode() = delete;
|
ExecutionNode() = delete;
|
||||||
ExecutionNode(ExecutionNode const&) = delete;
|
ExecutionNode(ExecutionNode const&) = delete;
|
||||||
ExecutionNode& operator=(ExecutionNode const&) = delete;
|
ExecutionNode& operator=(ExecutionNode const&) = delete;
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace {
|
||||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
/// @brief validate the counters of the plan
|
/// @brief validate the counters of the plan
|
||||||
struct NodeCounter final : public WalkerWorker<ExecutionNode> {
|
struct NodeCounter final : public WalkerWorker<ExecutionNode> {
|
||||||
std::array<uint32_t, ExecutionNode::MaxNodeTypeValue + 1> counts;
|
std::array<uint32_t, ExecutionNode::MAX_NODE_TYPE_VALUE> counts;
|
||||||
|
|
||||||
NodeCounter() : counts{} {}
|
NodeCounter() : counts{} {}
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ class ExecutionPlan {
|
||||||
std::unordered_set<ExecutionNode const*> _excludeFromScatterGather;
|
std::unordered_set<ExecutionNode const*> _excludeFromScatterGather;
|
||||||
|
|
||||||
/// @brief number of nodes used in the plan, by type
|
/// @brief number of nodes used in the plan, by type
|
||||||
std::array<uint32_t, ExecutionNode::MaxNodeTypeValue + 1> _typeCounts;
|
std::array<uint32_t, ExecutionNode::MAX_NODE_TYPE_VALUE> _typeCounts;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2328,6 +2328,11 @@ struct SortToIndexNode final : public WalkerWorker<ExecutionNode> {
|
||||||
case EN::ENUMERATE_COLLECTION:
|
case EN::ENUMERATE_COLLECTION:
|
||||||
return handleEnumerateCollectionNode(
|
return handleEnumerateCollectionNode(
|
||||||
static_cast<EnumerateCollectionNode*>(en));
|
static_cast<EnumerateCollectionNode*>(en));
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3657,6 +3662,11 @@ void arangodb::aql::distributeFilternCalcToClusterRule(
|
||||||
// ready to rumble!
|
// ready to rumble!
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stopSearching) {
|
if (stopSearching) {
|
||||||
|
@ -3728,6 +3738,11 @@ void arangodb::aql::distributeSortToClusterRule(
|
||||||
case EN::ENUMERATE_IRESEARCH_VIEW:
|
case EN::ENUMERATE_IRESEARCH_VIEW:
|
||||||
case EN::SCATTER_IRESEARCH_VIEW:
|
case EN::SCATTER_IRESEARCH_VIEW:
|
||||||
#endif
|
#endif
|
||||||
|
case EN::MAX_NODE_TYPE_VALUE: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
|
|
||||||
// For all these, we do not want to pull a SortNode further down
|
// For all these, we do not want to pull a SortNode further down
|
||||||
// out to the DBservers, note that potential FilterNodes and
|
// out to the DBservers, note that potential FilterNodes and
|
||||||
// CalculationNodes that can be moved to the DBservers have
|
// CalculationNodes that can be moved to the DBservers have
|
||||||
|
@ -4245,6 +4260,11 @@ class RemoveToEnumCollFinder final : public WalkerWorker<ExecutionNode> {
|
||||||
case EN::SHORTEST_PATH: {
|
case EN::SHORTEST_PATH: {
|
||||||
// if we meet any of the above, then we abort . . .
|
// if we meet any of the above, then we abort . . .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_toUnlink.clear();
|
_toUnlink.clear();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -713,6 +713,11 @@ bool TraversalConditionFinder::before(ExecutionNode* en) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
// should not reach this point
|
||||||
|
TRI_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue