1
0
Fork 0

adding skipSome method for GatherBlock.

This commit is contained in:
James 2014-09-23 18:06:08 +01:00
parent 838290381b
commit 5362ff3203
2 changed files with 24 additions and 6 deletions

View File

@ -3543,6 +3543,28 @@ AqlItemBlock* GatherBlock::getSome (size_t atLeast, size_t atMost) {
}
size_t GatherBlock::skipSome (size_t atLeast, size_t atMost) {
if (_done) {
return 0;
}
if (isSimple()) {
auto res = _dependencies.at(_atDep)->skipSome(atLeast, atMost);
while (res == 0 && _atDep < _dependencies.size() - 1) {
_atDep++;
res = _dependencies.at(_atDep)->skipSome(atLeast, atMost);
}
if (res == 0) {
_done = true;
}
return res;
//} else { // merge sort the results from the deps
}
return 0; // to keep the compiler happy
}
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"

View File

@ -1515,14 +1515,10 @@ public:
AqlItemBlock* getSome (size_t, size_t);
size_t skipSome (size_t, size_t);
private:
/*int getOrSkipSome (size_t atLeast,
size_t atMost,
bool skipping,
AqlItemBlock*& result,
size_t& skipped);*/
// the block is simple if we do not do merge sort . . .
bool isSimple () {
auto en = static_cast<GatherNode const*>(getPlanNode());