8000 added Ditches for traversal · thurt/arangodb@e62ccf7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e62ccf7

Browse files
committed
added Ditches for traversal
1 parent e58a63f commit e62ccf7

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

arangod/Aql/TraversalBlock.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929
#include "Aql/Ast.h"
3030
#include "Aql/ExecutionEngine.h"
31+
#include "Aql/ExecutionNode.h"
3132
#include "Aql/ExecutionPlan.h"
3233
#include "Aql/Functions.h"
3334
#include "Aql/TraversalBlock.h"
34-
#include "Aql/ExecutionNode.h"
3535
#include "Basics/ScopeGuard.h"
3636
#include "Cluster/ClusterTraverser.h"
3737
#include "V8/v8-globals.h"
@@ -94,6 +94,7 @@ TraversalBlock::TraversalBlock (ExecutionEngine* engine,
9494
}
9595

9696
_resolver = new CollectionNameResolver(_trx->vocbase());
97+
9798
if (triagens::arango::ServerState::instance()->isCoordinator()) {
9899
_traverser.reset(new triagens::arango::traverser::ClusterTraverser(
99100
ep->edgeColls(),
@@ -108,6 +109,11 @@ TraversalBlock::TraversalBlock (ExecutionEngine* engine,
108109
for (auto const& coll : ep->edgeColls()) {
109110
TRI_voc_cid_t cid = _resolver->getCollectionId(coll);
110111
edgeCollections.push_back(_trx->documentCollection(cid));
112+
113+
auto trxCollection = _trx->trxCollection(cid);
114+
if (trxCollection != nullptr) {
115+
_trx->orderDitch(trxCollection);
116+
}
111117
}
112118
_traverser.reset(new triagens::arango::traverser::DepthFirstTraverser(edgeCollections,
113119
opts,
@@ -163,6 +169,7 @@ void TraversalBlock::freeCaches () {
163169
int TraversalBlock::initialize () {
164170
int res = ExecutionBlock::initialize();
165171
auto varInfo = getPlanNode()->getRegisterPlan()->varInfo;
172+
166173
if (usesVertexOutput()) {
167174
auto it = varInfo.find(_vertexVar->id);
168175
TRI_ASSERT(it != varInfo.end());

arangod/V8Server/V8Traverser.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,11 @@ Json* SingleServerTraversalPath::vertexToJson (Transaction* trx,
775775
if (collection == nullptr) {
776776
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "collection is a nullptr");
777777
}
778+
779+
auto trxCollection = trx->trxCollection(v.cid);
780+
if (trxCollection != nullptr) {
781+
trx->orderDitch(trxCollection);
782+
}
778783
}
779784
TRI_doc_mptr_copy_t mptr;
780785
int res = trx->readSingle(collection, &mptr, v.key);
@@ -850,6 +855,10 @@ bool DepthFirstTraverser::vertexMatchesConditions (VertexId const& v, size_t dep
850855
if (collection == nullptr) {
851856
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "collection is a nullptr");
852857
}
858+
auto trxCollection = _trx->trxCollection(v.cid);
859+
if (trxCollection != nullptr) {
860+
_trx->orderDitch(trxCollection);
861+
}
853862
}
854863

855864
int res = _trx->readSingle(collection, &mptr, v.key);
@@ -1057,6 +1066,10 @@ void DepthFirstTraverser::setStartVertex (triagens::arango::traverser::VertexId
10571066
if (collection == nullptr) {
10581067
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "collection is a nullptr");
10591068
}
1069+
auto trxCollection = _trx->trxCollection(v.cid);
1070+
if (trxCollection != nullptr) {
1071+
_trx->orderDitch(trxCollection);
1072+
}
10601073
}
10611074

10621075
int res = _trx->readSingle(collection, &mptr, v.key);

arangod/V8Server/V8Traverser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ namespace triagens {
171171
void addCollectionRestriction (TRI_voc_cid_t cid);
172172
};
173173

174-
175-
176174
struct ShortestPathOptions : BasicOptions {
177175

178176
public:
@@ -250,6 +248,7 @@ namespace triagens {
250248
// -----------------------------------------------------------------------------
251249
// --SECTION-- class DepthFirstTraverser
252250
// -----------------------------------------------------------------------------
251+
253252
class DepthFirstTraverser : public Traverser {
254253

255254
private:

0 commit comments

Comments
 (0)
0