1
0
Fork 0

fixed some cluster internal communication

This commit is contained in:
Jan Steemann 2014-10-01 14:06:00 +02:00
parent 6da35ba709
commit 49237ef55a
3 changed files with 24 additions and 15 deletions

View File

@ -464,6 +464,9 @@ std::cout << "REGISTERING QUERY ON COORDINATOR WITH ID: " << id << "\n";
// inject the current shard id into the collection
collection->setCurrentShard(shardId);
plan.findVarUsage();
plan.staticAnalysis();
// create a JSON representation of the plan
triagens::basics::Json result(triagens::basics::Json::Array);
triagens::basics::Json jsonNodesList(plan.root()->toJson(TRI_UNKNOWN_MEM_ZONE, true));
@ -500,7 +503,7 @@ std::cout << "REGISTERING QUERY ON COORDINATOR WITH ID: " << id << "\n";
delete res;
}
}
// fix collection
collection->resetCurrentShard();

View File

@ -211,19 +211,23 @@ ExecutionNode::ExecutionNode (ExecutionPlan* plan,
_estimatedCostSet(false),
_varUsageValid(false),
_plan(plan),
_depth(JsonHelper::checkAndGetNumericValue<size_t>(json.json(), "depth"))
{
_depth(JsonHelper::checkAndGetNumericValue<size_t>(json.json(), "depth")) {
auto jsonVarInfoList = json.get("varInfoList");
if (!jsonVarInfoList.isList()) {
if (! jsonVarInfoList.isList()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, "varInfoList needs to be a json list");
}
TRI_ASSERT(_varOverview.get() == nullptr);
_varOverview.reset(new VarOverview());
size_t len = jsonVarInfoList.size();
_varOverview->varInfo.reserve(len);
for (size_t i = 0; i < len; i++) {
auto jsonVarInfo = jsonVarInfoList.at(i);
if (jsonVarInfo.isArray()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, "one varInfoList needs to be an object");
if (! jsonVarInfo.isArray()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, "one varInfoList item needs to be an object");
}
VariableId variableId = JsonHelper::checkAndGetNumericValue<size_t> (jsonVarInfo.json(), "VariableId");
RegisterId registerId = JsonHelper::checkAndGetNumericValue<size_t> (jsonVarInfo.json(), "RegisterId");
@ -232,7 +236,7 @@ ExecutionNode::ExecutionNode (ExecutionPlan* plan,
}
auto jsonNrRegsList = json.get("nrRegs");
if (!jsonNrRegsList.isList()) {
if (! jsonNrRegsList.isList()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, "nrRegs needs to be a json list");
}
@ -244,7 +248,7 @@ ExecutionNode::ExecutionNode (ExecutionPlan* plan,
}
auto jsonRegsToClearList = json.get("regsToClear");
if (!jsonRegsToClearList.isList()) {
if (! jsonRegsToClearList.isList()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, "regsToClear needs to be a json list");
}

View File

@ -428,10 +428,14 @@ void RestAqlHandler::useQuery (std::string const& operation,
TRI_ASSERT(query->engine() != nullptr);
Json queryJson(TRI_UNKNOWN_MEM_ZONE, parseJsonBody());
if (queryJson.isEmpty()) {
_queryRegistry->close(_vocbase, qId);
return;
Json queryJson;
if (operation != "shutdown") {
// /shutdown does not require a body
queryJson = Json(TRI_UNKNOWN_MEM_ZONE, parseJsonBody());
if (queryJson.isEmpty()) {
_queryRegistry->close(_vocbase, qId);
return;
}
}
Json answerBody(Json::Array, 2);
@ -702,8 +706,6 @@ bool RestAqlHandler::findQuery (std::string const& idString,
QueryId& qId,
Query*& query) {
qId = StringUtils::uint64(idString);
std::cout << "LOOKING FOR QUERY: " << idString << ", VOCBASE: " << _vocbase->_name << "\n";
std::cout << "IDSTRING: " << idString << ", QID: " << qId << "\n";
query = nullptr;