mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
d7d6ce65db
|
@ -3638,6 +3638,36 @@ bool ScatterBlock::hasMore () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief remainingForShard: remaining for shard, sum of the number of row left
|
||||||
|
/// in the buffer and _dependencies[0]->remaining()
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int64_t ScatterBlock::remainingForShard (std::string const& shardId) {
|
||||||
|
|
||||||
|
size_t clientId = getClientId(shardId);
|
||||||
|
|
||||||
|
if (_doneForClient.at(clientId)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t sum = _dependencies[0]->remaining();
|
||||||
|
if (sum == -1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::pair<size_t,size_t> pos = _posForClient.at(clientId);
|
||||||
|
|
||||||
|
if (pos.first <= _buffer.size()) {
|
||||||
|
sum += _buffer.at(pos.first)->size() - pos.second;
|
||||||
|
for (auto i = pos.first + 1; i < _buffer.size(); i++) {
|
||||||
|
sum += _buffer.at(i)->size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief hasMoreForShard: any more for shard <shardId>?
|
/// @brief hasMoreForShard: any more for shard <shardId>?
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1574,7 +1574,7 @@ namespace triagens {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int64_t remaining () {
|
int64_t remaining () {
|
||||||
return _dependencies[0]->remaining();
|
TRI_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1606,6 +1606,12 @@ namespace triagens {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool hasMoreForShard (std::string const& shardId);
|
bool hasMoreForShard (std::string const& shardId);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief remainingForShard: remaining for shard <shardId>?
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int64_t remainingForShard (std::string const& shardId);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief getOrSkipSomeForShard
|
/// @brief getOrSkipSomeForShard
|
||||||
|
|
|
@ -1998,6 +1998,7 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool before (ExecutionNode* en) {
|
bool before (ExecutionNode* en) {
|
||||||
|
std::cout << "before!\n";
|
||||||
switch (en->getType()) {
|
switch (en->getType()) {
|
||||||
case EN::REMOVE:{
|
case EN::REMOVE:{
|
||||||
TRI_ASSERT(_remove == false);
|
TRI_ASSERT(_remove == false);
|
||||||
|
@ -2013,10 +2014,10 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
_variable = varsToRemove[0]; // the variable we'll remove
|
_variable = varsToRemove[0]; // the variable we'll remove
|
||||||
|
|
||||||
auto _enumColl = static_cast<EnumerateCollectionNode*>(_plan->getVarSetBy(_variable->id));
|
auto _enumColl = static_cast<EnumerateCollectionNode*>(_plan->getVarSetBy(_variable->id));
|
||||||
|
|
||||||
if (_enumColl == nullptr
|
if (_enumColl == nullptr
|
||||||
|| _enumColl->getType() != triagens::aql::ExecutionNode::ENUMERATE_COLLECTION
|
|| _enumColl->getType() != triagens::aql::ExecutionNode::ENUMERATE_COLLECTION ) {
|
||||||
|| _enumColl->collection()->cid() != rn->collection()->cid() ) {
|
// || _enumColl->collection()->cid() != rn->collection()->cid() ) {
|
||||||
// remove variable was not introduced by an enumerate collection or
|
// remove variable was not introduced by an enumerate collection or
|
||||||
// it was but the collections differ
|
// it was but the collections differ
|
||||||
break; // abort . . .
|
break; // abort . . .
|
||||||
|
@ -2057,6 +2058,10 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
_toUnlink.insert(en);
|
_toUnlink.insert(en);
|
||||||
return false; // continue . . .
|
return false; // continue . . .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EN::CALCULATION: {//Check this is the calculation node of one of the filter nodes!
|
||||||
|
|
||||||
|
}
|
||||||
case EN::ENUMERATE_COLLECTION: {
|
case EN::ENUMERATE_COLLECTION: {
|
||||||
// check that we are enumerating the variable we are to remove
|
// check that we are enumerating the variable we are to remove
|
||||||
if (en->id() != _enumColl->id()) {
|
if (en->id() != _enumColl->id()) {
|
||||||
|
@ -2067,7 +2072,6 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
|
||||||
}
|
}
|
||||||
|
|
||||||
case EN::SINGLETON:
|
case EN::SINGLETON:
|
||||||
case EN::CALCULATION:
|
|
||||||
case EN::ENUMERATE_LIST:
|
case EN::ENUMERATE_LIST:
|
||||||
case EN::SUBQUERY:
|
case EN::SUBQUERY:
|
||||||
case EN::AGGREGATE:
|
case EN::AGGREGATE:
|
||||||
|
|
Loading…
Reference in New Issue