From cfb9b8a37abbde45c51182e9f28fb86c4672d5e9 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 28 Oct 2014 10:59:27 +0100 Subject: [PATCH] Add removeAlwaysOnClusterRules helper. --- js/server/modules/org/arangodb/aql-helper.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/server/modules/org/arangodb/aql-helper.js b/js/server/modules/org/arangodb/aql-helper.js index 0c23f1a539..3a98e4d844 100644 --- a/js/server/modules/org/arangodb/aql-helper.js +++ b/js/server/modules/org/arangodb/aql-helper.js @@ -546,6 +546,18 @@ function getQueryMultiplePlansAndExecutions (query, bindVars, testObject, debug) return {'plans': plans, 'results': results}; } +function removeAlwaysOnClusterRules (rules) { + var pos; + var copy = []; + for (pos = 0; pos < rules.length; pos++) { + if (rules[pos] !== "scatter-in-cluster" && + rules[pos] !== "distribute-in-cluster") { + copy.push(rules[pos]); + } + } + return copy; +} + // ----------------------------------------------------------------------------- // --SECTION-- module exports // ----------------------------------------------------------------------------- @@ -567,6 +579,8 @@ exports.getCompactPlan = getCompactPlan; exports.findExecutionNodes = findExecutionNodes; exports.findReferencedNodes = findReferencedNodes; exports.getQueryMultiplePlansAndExecutions = getQueryMultiplePlansAndExecutions; +exports.removeAlwaysOnClusterRules = removeAlwaysOnClusterRules; + // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE // -----------------------------------------------------------------------------