10000 Cleanup old traversal code (#16215) · rnshah9/arangodb@13518f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 13518f3

Browse files
authored
Cleanup old traversal code (arangodb#16215)
1 parent db7f244 commit 13518f3

27 files changed

+197
-4817
lines changed

arangod/Aql/GraphNode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@
3838
#include "Aql/Variable.h"
3939
#include "Basics/tryEmplaceHelper.h"
4040
#include "Cluster/ClusterFeature.h"
41-
#include "Cluster/ClusterTraverser.h"
4241
#include "Cluster/ServerState.h"
4342
#include "Graph/BaseOptions.h"
4443
#include "Graph/Graph.h"
45-
#include "Graph/SingleServerTraverser.h"
4644
#include "Graph/TraverserOptions.h"
4745
#include "Utils/CollectionNameResolver.h"
4846
#include "VocBase/LogicalCollection.h"

arangod/Aql/TraversalExecutor.cpp

Lines changed: 145 additions & 455 deletions
Large diffs are not rendered by default.

arangod/Aql/TraversalExecutor.h

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "Graph/Options/OneSidedEnumeratorOptions.h"
3535
#include "Graph/PathManagement/PathValidatorOptions.h"
3636
#include "Graph/Providers/BaseProviderOptions.h"
37-
#include "Graph/Traverser.h"
3837
#include "Graph/TraverserOptions.h"
3938
#include "Graph/Types/UniquenessLevel.h"
4039
#include "Transaction/Methods.h"
@@ -63,21 +62,17 @@ class TraversalExecutorInfos {
6362
public:
6463
// for the coordinator
6564
TraversalExecutorInfos(
66-
std::unique_ptr<traverser::Traverser>&& traverser,
6765
std::unordered_map<TraversalExecutorInfosHelper::OutputName, RegisterId,
6866
TraversalExecutorInfosHelper::OutputNameHash>
6967
registerMapping,
70-
std::string fixedSource, RegisterId inputRegister,
71-
std::vector<std::pair<Variable const*, RegisterId>>
72-
filterConditionVariables,
73-
Ast* ast, traverser::TraverserOptions::UniquenessLevel vertexUniqueness,
68+
std::string fixedSource, RegisterId inputRegister, Ast* ast,
69+
traverser::TraverserOptions::UniquenessLevel vertexUniqueness,
7470
traverser::TraverserOptions::UniquenessLevel edgeUniqueness,
75-
traverser::TraverserOptions::Order order, bool refactor,
76-
double defaultWeight, std::string weightAttribute,
77-
transaction::Methods* trx, arangodb::aql::QueryContext& query,
71+
traverser::TraverserOptions::Order order, double defaultWeight,
72+
std::string weightAttribute, transaction::Methods* trx,
73+
arangodb::aql::QueryContext& query,
7874
arangodb::graph::PathValidatorOptions&& pathValidatorOptions,
7975
arangodb::graph::OneSidedEnumeratorOptions&& enumeratorOptions,
80-
traverser::TraverserOptions* opts,
8176
graph::ClusterBaseProviderOptions&& clusterBaseProviderOptions,
8277
bool isSmart = false);
8378
// TODO [GraphRefactor]: Tidy-up input parameter "mess" after refactor is
@@ -87,21 +82,17 @@ class TraversalExecutorInfos {
8782

8883
// for non-coordinator (single server or DB-server)
8984
TraversalExecutorInfos(
90-
std::unique_ptr<traverser::Traverser>&& traverser,
9185
std::unordered_map<TraversalExecutorInfosHelper::OutputName, RegisterId,
9286
TraversalExecutorInfosHelper::OutputNameHash>
9387
registerMapping,
94-
std::string fixedSource, RegisterId inputRegister,
95-
std::vector<std::pair<Variable const*, RegisterId>>
96-
filterConditionVariables,
97-
Ast* ast, traverser::TraverserOptions::UniquenessLevel vertexUniqueness,
88+
std::string fixedSource, RegisterId inputRegister, Ast* ast,
89+
traverser::TraverserOptions::UniquenessLevel vertexUniqueness,
9890
traverser::TraverserOptions::UniquenessLevel edgeUniqueness,
99-
traverser::TraverserOptions::Order order, bool refactor,
100-
double defaultWeight, std::string weightAttribute,
101-
transaction::Methods* trx, arangodb::aql::QueryContext& query,
91+
traverser::TraverserOptions::Order order, double defaultWeight,
92+
std::string weightAttribute, transaction::Methods* trx,
93+
arangodb::aql::QueryContext& query,
10294
arangodb::graph::PathValidatorOptions&& pathValidatorOptions,
10395
arangodb::graph::OneSidedEnumeratorOptions&& enumeratorOptions,
104-
traverser::TraverserOptions* opts,
10596
graph::SingleServerBaseProviderOptions&& singleServerBaseProviderOptions,
10697
bool isSmart = false);
10798

@@ -113,7 +104,6 @@ class TraversalExecutorInfos {
113104

114105
[[nodiscard]] auto traversalEnumerator() const
115106
-> arangodb::graph::TraversalEnumerator*;
116-
auto traverser() -> traverser::Traverser*;
117107

118108
bool usesOutputRegister(TraversalExecutorInfosHelper::OutputName type) const;
119109

@@ -138,15 +128,8 @@ class TraversalExecutorInfos {
138128

139129
RegisterId getInputRegister() const;
140130

141-
std::vector<std::pair<Variable const*, RegisterId>> const&
142-
filterConditionVariables() const;
143-
144131
Ast* getAst() const;
145132

146-
std::pair<arangodb::graph::VertexUniquenessLevel,
147-
arangodb::graph::EdgeUniquenessLevel>
148-
convertUniquenessLevels() const;
149-
150133
auto parseTraversalEnumeratorSingleServer(
151134
traverser::TraverserOptions::Order order,
152135
traverser::TraverserOptions::UniquenessLevel uniqueVertices,
@@ -172,8 +155,6 @@ class TraversalExecutorInfos {
172155
traverser::TraverserOptions::UniquenessLevel getUniqueVertices() const;
173156
traverser::TraverserOptions::UniquenessLevel getUniqueEdges() const;
174157
traverser::TraverserOptions::Order getOrder() const;
175-
void setOrder(traverser::TraverserOptions::Order order);
176-
bool isRefactor() const;
177158
transaction::Methods* getTrx();
178159
arangodb::aql::QueryWarnings& getWarnings();
179160

@@ -184,9 +165,6 @@ class TraversalExecutorInfos {
184165
TraversalExecutorInfosHelper::OutputName type) const;
185166

186167
private:
187-
std::unique_ptr<traverser::Traverser>
188-
_traverser; // TODO [GraphRefactor]: Old way, to be removed after
189-
// refactor is done!
190168
std::unique_ptr<arangodb::graph::TraversalEnumerator> _traversalEnumerator =
191169
nullptr;
192170

@@ -196,14 +174,10 @@ class TraversalExecutorInfos {
196174
std::string _fixedSource;
197175
RegisterId _inputRegister;
198176

199-
// TODO [GraphRefactor]: Remove copy of _filterConditionVariables as soon
200-
// as we remove the old non-refactored code.
201-
std::vector<std::pair<Variable const*, RegisterId>> _filterConditionVariables;
202177
Ast* _ast;
203178
traverser::TraverserOptions::UniquenessLevel _uniqueVertices;
204179
traverser::TraverserOptions::UniquenessLevel _uniqueEdges;
205180
traverser::TraverserOptions::Order _order;
206-
bool _refactor;
207181
double _defaultWeight;
208182
std::string _weightAttribute;
209183
transaction::Methods* _trx;
@@ -239,25 +213,18 @@ class TraversalExecutor {
239213

240214
private:
241215
auto doOutput(OutputAqlItemRow& output) -> void;
242-
[[nodiscard]] auto doSkip(AqlCall& call) -> size_t;
243216

244217
[[nodiscard]] bool initTraverser(AqlItemBlockInputRange& input);
245218

246219
[[nodiscard]] auto stats() -> Stats;
247220

248-
// OLD (non refactor)
249-
auto traverser() -> traverser::Traverser*;
250-
251221
// NEW (refactor)
252222
auto traversalEnumerator() -> arangodb::graph::TraversalEnumerator*;
253223

254224
private:
255225
Infos& _infos;
256226
InputAqlItemRow _inputRow;
257227

258-
traverser::Traverser* _traverser; // TODO [GraphRefactor]: Old way, to be
259-
// removed after refactor is done!
260-
261228
/// @brief the refactored finder variant.
262229
arangodb::graph::TraversalEnumerator* _traversalEnumerator;
263230
};

0 commit comments

Comments
 (0)
0