From fe25b3a1d19eaa3038d1fb11015bb9556d70fb9c Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 7 Feb 2014 16:08:28 +0100 Subject: [PATCH] Start documentation for sharding. --- Documentation/Makefile.files | 4 ++ Documentation/RefManual/RefManual.md | 1 + Documentation/UserManual/Sharding.md | 3 ++ js/server/modules/org/arangodb/cluster.js | 5 +++ .../org/arangodb/cluster/kickstarter.js | 2 +- .../modules/org/arangodb/cluster/planner.js | 44 ++++++++++++++++++- 6 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Documentation/Makefile.files b/Documentation/Makefile.files index 36dc0e7cf0..202b231c4c 100644 --- a/Documentation/Makefile.files +++ b/Documentation/Makefile.files @@ -181,6 +181,9 @@ DOXYGEN = \ Doxygen/js/server/modules/org/arangodb/foxx/template_middleware.c \ Doxygen/js/server/modules/org/arangodb/graph.c \ Doxygen/js/server/modules/org/arangodb/simple-query.c \ + Doxygen/js/server/modules/org/arangodb/cluster.c \ + Doxygen/js/server/modules/org/arangodb/cluster/planner.c \ + Doxygen/js/server/modules/org/arangodb/cluster/kickstarter.c \ Doxygen/js/server/server.c ## ----------------------------------------------------------------------------- @@ -202,6 +205,7 @@ doxygen-create-directories: @test -d Doxygen/js/common/modules/org/arangodb/graph || mkdir -p Doxygen/js/common/modules/org/arangodb/graph @test -d Doxygen/js/server/modules/org/arangodb/foxx || mkdir -p Doxygen/js/server/modules/org/arangodb/foxx @test -d Doxygen/js/server/modules/org/arangodb/graph || mkdir -p Doxygen/js/server/modules/org/arangodb/graph + @test -d Doxygen/js/server/modules/org/arangodb/cluster || mkdir -p Doxygen/js/server/modules/org/arangodb/cluster @test -d Doxygen/js/client || mkdir -p Doxygen/js/client @test -d Doxygen/man/man1 || mkdir -p Doxygen/man/man1 @test -d Doxygen/man/man8 || mkdir -p Doxygen/man/man8 diff --git a/Documentation/RefManual/RefManual.md b/Documentation/RefManual/RefManual.md index db6c6ac063..2e5f51a41c 100644 --- a/Documentation/RefManual/RefManual.md +++ b/Documentation/RefManual/RefManual.md @@ -8,6 +8,7 @@ ArangoDB's Reference Manual (@VERSION) {#RefManual} @CHAPTER_REF{JSModuleFs} @CHAPTER_REF{JSModuleGraph} @CHAPTER_REF{JSModuleActions} +@CHAPTER_REF{JSModuleCluster} @CHAPTER_REF{jsUnity} @CHAPTER_REF{UserManualActions} @CHAPTER_REF{RefManualReplication} diff --git a/Documentation/UserManual/Sharding.md b/Documentation/UserManual/Sharding.md index 56e89cee29..8e51ece509 100644 --- a/Documentation/UserManual/Sharding.md +++ b/Documentation/UserManual/Sharding.md @@ -147,4 +147,7 @@ currently using. We will probably see a speedup in a later release. The basic CRUD operations already have a relatively good performance, the simple queries are in need of further optimisations as well. +See @ref JSModuleCluster "the corresponding chapter of the reference manual" +for detailed information about the `Planner` and `Kickstarter` classes. + @NAVIGATE_Sharding diff --git a/js/server/modules/org/arangodb/cluster.js b/js/server/modules/org/arangodb/cluster.js index 735951b8ae..edfc644314 100644 --- a/js/server/modules/org/arangodb/cluster.js +++ b/js/server/modules/org/arangodb/cluster.js @@ -32,6 +32,8 @@ var console = require("console"); var arangodb = require("org/arangodb"); var ArangoCollection = arangodb.ArangoCollection; var ArangoError = arangodb.ArangoError; +var Planner = require("org/arangodb/cluster/planner").Planner; +var Kickstarter = require("org/arangodb/cluster/kickstarter").Kickstarter; //////////////////////////////////////////////////////////////////////////////// /// @brief get values from Plan or Current by a prefix @@ -829,6 +831,9 @@ exports.status = status; exports.isCoordinatorRequest = isCoordinatorRequest; exports.handlePlanChange = handlePlanChange; +exports.Planner = Planner; +exports.Kickstarter = Kickstarter; + // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE // ----------------------------------------------------------------------------- diff --git a/js/server/modules/org/arangodb/cluster/kickstarter.js b/js/server/modules/org/arangodb/cluster/kickstarter.js index 71c8be46b4..60bdad6e7c 100644 --- a/js/server/modules/org/arangodb/cluster/kickstarter.js +++ b/js/server/modules/org/arangodb/cluster/kickstarter.js @@ -4,7 +4,7 @@ //////////////////////////////////////////////////////////////////////////////// /// @brief Cluster kickstarting functionality using dispatchers /// -/// @file js/server/modules/org/arangodb/cluster/kickstarter.js +/// @file /// /// DISCLAIMER /// diff --git a/js/server/modules/org/arangodb/cluster/planner.js b/js/server/modules/org/arangodb/cluster/planner.js index e153530085..da135016f3 100644 --- a/js/server/modules/org/arangodb/cluster/planner.js +++ b/js/server/modules/org/arangodb/cluster/planner.js @@ -4,7 +4,7 @@ //////////////////////////////////////////////////////////////////////////////// /// @brief Cluster planning functionality /// -/// @file js/server/modules/org/arangodb/cluster/planner.js +/// @file /// /// DISCLAIMER /// @@ -238,6 +238,48 @@ function fillConfigWithDefaults (config, defaultConfig) { } // Our Planner class: +//////////////////////////////////////////////////////////////////////////////// +/// @fn JSF_Cluster_Planner_Constructor +/// @brief the cluster planner constructor +/// +/// @FUN{new Planner(@FA{userConfig})} +/// +/// This constructor builds a cluster planner object. The one and only +/// argument is an object that can have the following properties: +/// +/// - `numberOfAgents`: the number of agents in the agency, +/// usually there is no reason to deviate from the default of 3 +/// - `numberOfDBservers`: the number of DBservers in the +/// cluster. +/// - `numberOfCoordinators`: the number of coordinators in the cluster. +/// +/// All these values have default values. Here is the current set of +/// default values: +/// +/// { +/// "agencyPrefix" : "meier", +/// "numberOfAgents" : 3, +/// "numberOfDBservers" : 2, +/// "startSecondaries" : false, +/// "numberOfCoordinators" : 1, +/// "DBserverIDs" : ["Pavel", "Perry", "Pancho", "Paul", +/// "Pierre", "Pit", "Pia", "Pablo" ], +/// "coordinatorIDs" : ["Claus", "Chantalle", "Claire", +/// "Claudia", "Claas", "Clemens", "Chris" ], +/// "dataPath" : "", +/// "logPath" : "", +/// "arangodPath" : "bin/arangod", +/// "agentPath" : "bin/etcd", +/// "agentExtPorts" : [4001], +/// "agentIntPorts" : [7001], +/// "DBserverPorts" : [8629], +/// "coordinatorPorts" : [8530], +/// "dispatchers" : {"me":{"id":"me", +/// "endpoint":"tcp://localhost:", +/// "avoidPorts": {}}} +/// }; +/// +//////////////////////////////////////////////////////////////////////////////// function Planner (userConfig) { "use strict";