8000 Feature/parallel aql phase one 2 by jsteemann · Pull Request #10408 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/parallel aql phase one 2 #10408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 12, 2019
Prev Previous commit
Next Next commit
revert last change
  • Loading branch information
graetzer committed Nov 12, 2019
commit cd15533c3bfe31eb64e34160ce74be82fbdb55c7
34 changes: 16 additions & 18 deletions arangod/Aql/RestAqlHandler.cpp
< 8000 tr data-hunk="4229535bdeee5b8022f3ee4a3cfac76df7f4003ff6b837c0a78354a62a652ab1" class="show-top-border">
Original file line number Diff line number Diff line change
Expand Up @@ -436,23 +436,22 @@ bool RestAqlHandler::killQuery(std::string const& idString) {
// set, then the root block of the stored query must be a ScatterBlock
// and the shard ID is given as an additional argument to the ScatterBlock's
// special API.
RestStatus RestAqlHandler::useQuery(std::string const& operation,
std::string const& idString,
bool isContinue) {
RestStatus RestAqlHandler::useQuery(std::string const& operation, std::string const& idString) {
bool success = false;
VPackSlice querySlice = this->parseVPackBody(success);
if (!success) {
return RestStatus::DONE;
}

TRI_ASSERT(_query == nullptr);
// the PUT verb
_query = findQuery(idString);
if (!_query) {
return RestStatus::DONE;
}
if (!isContinue) {
_query->sharedState()->setWakeupHandler([self = shared_from_this()] {
if (!_query) { // the PUT verb
TRI_ASSERT(this->state() == RestHandler::HandlerState::EXECUTE);

_query = findQuery(idString);
if (!_query) {
return RestStatus::DONE;
}
std::shared_ptr<SharedQueryState> ss = _query->sharedState();
ss->setWakeupHandler([self = shared_from_this()] {
return self->wakeupHandler();
});
}
Expand Down Expand Up @@ -518,7 +517,7 @@ RestStatus RestAqlHandler::execute() {
generateError(rest::ResponseCode::NOT_FOUND, TRI_ERROR_HTTP_NOT_FOUND,
std::move(msg));
} else {
auto status = useQuery(suffixes[0], suffixes[1], /*isContinue*/false);
auto status = useQuery(suffixes[0], suffixes[1]);
if (status == RestStatus::WAITING) {
return status;
}
Expand Down Expand Up @@ -566,7 +565,8 @@ RestStatus RestAqlHandler::continueExecute() {
if (type == rest::RequestType::PUT) {
// This cannot be changed!
TRI_ASSERT(suffixes.size() == 2);
return useQuery(suffixes[0], suffixes[1], /*isContinue*/true);
TRI_ASSERT(_query != nullptr);
return useQuery(suffixes[0], suffixes[1]);
}
generateError(rest::ResponseCode::SERVER_ERROR, TRI_ERROR_INTERNAL,
"continued non-continuable method for /_api/aql");
Expand All @@ -579,11 +579,9 @@ void RestAqlHandler::shutdownExecute(bool isFinalized) noexcept {
if (_query) {
_query->sharedState()->resetWakeupHandler();
}
}
_query = nullptr;
if (_qId != 0) {
_queryRegistry->close(&_vocbase, _qId);
_qId = 0;
if (_qId != 0) {
_queryRegistry->close(&_vocbase, _qId);
}
}
}

Expand Down
4 changes: 1 addition & 3 deletions arangod/Aql/RestAqlHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class RestAqlHandler : public RestVocbaseBaseHandler {
public:
char const* name() const override final { return "RestAqlHandler"; }
RequestLane lane() const override final { return RequestLane::CLUSTER_AQL; }

RestStatus execute() override;
RestStatus continueExecute() override;
void shutdownExecute(bool isFinalized) noexcept override;
Expand All @@ -76,8 +75,7 @@ class RestAqlHandler : public RestVocbaseBaseHandler {
// "errorMessage" (if applicable) and
// "done" (boolean) [3.4.0 and later] to indicate
// whether or not the cursor is exhausted.
RestStatus useQuery(std::string const& operation, std::string const& idString,
bool isContinue);
RestStatus useQuery(std::string const& operation, std::string const& idString);

private:
// POST method for /_api/aql/setup (internal)
Expand Down
2 changes: 1 addition & 1 deletion arangod/VocBase/Methods/Indexes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ arangodb::Result Indexes::getAll(LogicalCollection const* collection,
auto& feature = collection->vocbase().server().getFeature<ClusterFeature>();
Result rv = selectivityEstimatesOnCoordinator(feature, databaseName, cid, estimates);
if (rv.fail()) {
return Result(rv.errorNumber(), "could not retrieve estimates" + rv.errorMessage());
return Result(rv.errorNumber(), "could not retrieve estimates: '" + rv.errorMessage() + "'");
}

// we will merge in the index estimates later
Expand Down
0