From 5c7d0580435df3c3bffb3d8e2aa6e698145cf3a8 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 26 Sep 2014 13:34:08 +0200 Subject: [PATCH] Add stubs for RemoteBlock. --- arangod/Aql/ExecutionBlock.cpp | 76 ++++++++++++++++++++++++++++++++++ arangod/Aql/ExecutionNode.h | 9 +++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/arangod/Aql/ExecutionBlock.cpp b/arangod/Aql/ExecutionBlock.cpp index 0b170bb74a..66b4df11cd 100644 --- a/arangod/Aql/ExecutionBlock.cpp +++ b/arangod/Aql/ExecutionBlock.cpp @@ -3929,6 +3929,82 @@ size_t ScatterBlock::skipSomeForShard (size_t atLeast, size_t atMost, std::strin return skipped; } +// ----------------------------------------------------------------------------- +// --SECTION-- class RemoteBlock +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief initialize +//////////////////////////////////////////////////////////////////////////////// + +int RemoteBlock::initialize () { + int res = ExecutionBlock::initialize(); + + if (res != TRI_ERROR_NO_ERROR) { + return res; + } + + return TRI_ERROR_NO_ERROR; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief initializeCursor, could be called multiple times +//////////////////////////////////////////////////////////////////////////////// + +int RemoteBlock::initializeCursor (AqlItemBlock* items, size_t pos) { + return TRI_ERROR_NO_ERROR; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief shutdown, will be called exactly once for the whole query +//////////////////////////////////////////////////////////////////////////////// + +int RemoteBlock::shutdown () { + return TRI_ERROR_NO_ERROR; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief getSome +//////////////////////////////////////////////////////////////////////////////// + +AqlItemBlock* RemoteBlock::getSome (size_t atLeast, + size_t atMost) { + + return nullptr; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief skipSome +//////////////////////////////////////////////////////////////////////////////// + +size_t RemoteBlock::skipSome (size_t atLeast, size_t atMost) { + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief hasMore +//////////////////////////////////////////////////////////////////////////////// + +bool RemoteBlock::hasMore () { + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief count +//////////////////////////////////////////////////////////////////////////////// + +int64_t RemoteBlock::count () const { + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief remaining +//////////////////////////////////////////////////////////////////////////////// + +int64_t RemoteBlock::remaining () { + return 0; +} + // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)" diff --git a/arangod/Aql/ExecutionNode.h b/arangod/Aql/ExecutionNode.h index 505dd5b5a7..9592489c85 100644 --- a/arangod/Aql/ExecutionNode.h +++ b/arangod/Aql/ExecutionNode.h @@ -2575,11 +2575,16 @@ namespace triagens { } //////////////////////////////////////////////////////////////////////////////// -/// @brief the cost of a remote node is 1 +/// @brief the cost of a remote node is that of its dependency //////////////////////////////////////////////////////////////////////////////// double estimateCost () { - return _dependencies[0]->estimateCost(); + if (_dependencies.size() == 1) { + return _dependencies[0]->estimateCost(); + } + else { + return 1; + } } };