From 239bc802d39a1ceb3c85b30c9e2754ed1c5e252f Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 2 Dec 2015 17:19:17 +0100 Subject: [PATCH 1/4] added POW function to docs --- Documentation/Books/Users/Aql/NumericFunctions.mdpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/Books/Users/Aql/NumericFunctions.mdpp b/Documentation/Books/Users/Aql/NumericFunctions.mdpp index 92497beeee..a31d425a92 100644 --- a/Documentation/Books/Users/Aql/NumericFunctions.mdpp +++ b/Documentation/Books/Users/Aql/NumericFunctions.mdpp @@ -13,4 +13,6 @@ supported: - *SQRT(value)*: Returns the square root of *value* -- *RAND()*: Returns a pseudo-random number between 0 and 1 \ No newline at end of file +- *POW(base, exp)*: Returns the *base* to the exponent *exp* + +- *RAND()*: Returns a pseudo-random number between 0 and 1 From 8b2bce97b4371c91859b19e6d1034e7adb865546 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 2 Dec 2015 18:11:44 +0100 Subject: [PATCH 2/4] updated documentation --- CHANGELOG | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d299dbf212..844152da0a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -50,6 +50,29 @@ v2.8.0 (XXXX-XX-XX) - the initial synchronization now logs its progress so it can be queried using the regular replication status check APIs. + - added `async` attribute for `sync` and `syncCollection` operations called from + the ArangoShell. Setthing this attribute to `true` will make the synchronization + job on the server go into the background, so that the shell does not block. The + status of the started asynchronous synchronization job can be queried from the + ArangoShell like this: + + /* starts initial synchronization */ + var replication = require("org/arangodb/replication"); + var id = replication.sync({ + endpoint: "tcp://master.domain.org:8529", + username: "myuser", + password: "mypasswd", + async: true + }); + + /* now query the id of the returned async job and print the status */ + print(replication.getSyncResult(id)); + + The result of `getSyncResult()` will be `false` while the server-side job + has not completed, and different to `false` if it has completed. When it has + completed, all job result details will be returned by the call to `getSyncResult()`. + + * fixed non-deterministic query results in some cluster queries * fixed issue #1589 From c0729fbc6b99a7a960b571e855d1513af7a8fcae Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 2 Dec 2015 18:20:21 +0100 Subject: [PATCH 3/4] allow calling AQL functions that require collection name arguments with string values --- arangod/Aql/Executor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arangod/Aql/Executor.cpp b/arangod/Aql/Executor.cpp index c628990cce..efa61ff7c1 100644 --- a/arangod/Aql/Executor.cpp +++ b/arangod/Aql/Executor.cpp @@ -203,13 +203,13 @@ std::unordered_map const Executor::FunctionNames{ { "ZIP", Function("ZIP", "AQL_ZIP", "l,l", true, true, false, true, true, &Functions::Zip) }, // geo functions - { "NEAR", Function("NEAR", "AQL_NEAR", "h,n,n|nz,s", true, false, true, false, true, &Functions::Near, NotInCluster) }, - { "WITHIN", Function("WITHIN", "AQL_WITHIN", "h,n,n,n|s", true, false, true, false, true, &Functions::Within, NotInCluster) }, - { "WITHIN_RECTANGLE", Function("WITHIN_RECTANGLE", "AQL_WITHIN_RECTANGLE", "h,d,d,d,d", true, false, true, false, true) }, + { "NEAR", Function("NEAR", "AQL_NEAR", "hs,n,n|nz,s", true, false, true, false, true, &Functions::Near, NotInCluster) }, + { "WITHIN", Function("WITHIN", "AQL_WITHIN", "hs,n,n,n|s", true, false, true, false, true, &Functions::Within, NotInCluster) }, + { "WITHIN_RECTANGLE", Function("WITHIN_RECTANGLE", "AQL_WITHIN_RECTANGLE", "hs,d,d,d,d", true, false, true, false, true) }, { "IS_IN_POLYGON", Function("IS_IN_POLYGON", "AQL_IS_IN_POLYGON", "l,ln|nb", true, true, false, true, true) }, // fulltext functions - { "FULLTEXT", Function("FULLTEXT", "AQL_FULLTEXT", "h,s,s|n", true, false, true, false, true, &Functions::Fulltext, NotInCluster) }, + { "FULLTEXT", Function("FULLTEXT", "AQL_FULLTEXT", "hs,s,s|n", true, false, true, false, true, &Functions::Fulltext, NotInCluster) }, // graph functions { "PATHS", Function("PATHS", "AQL_PATHS", "c,h|s,ba", true, false, true, false, false) }, @@ -217,14 +217,14 @@ std::unordered_map const Executor::FunctionNames{ { "SHORTEST_PATH", Function("SHORTEST_PATH", "AQL_SHORTEST_PATH", "h,h,s,s,s|a", true, false, true, false, false) }, { "GRAPH_SHORTEST_PATH", Function("GRAPH_SHORTEST_PATH", "AQL_GRAPH_SHORTEST_PATH", "s,als,als|a", false, false, true, false, false) }, { "GRAPH_DISTANCE_TO", Function("GRAPH_DISTANCE_TO", "AQL_GRAPH_DISTANCE_TO", "s,als,als|a", false, false, true, false, false) }, - { "TRAVERSAL", Function("TRAVERSAL", "AQL_TRAVERSAL", "h,h,s,s|a", false, false, true, false, false) }, + { "TRAVERSAL", Function("TRAVERSAL", "AQL_TRAVERSAL", "hs,hs,s,s|a", false, false, true, false, false) }, { "GRAPH_TRAVERSAL", Function("GRAPH_TRAVERSAL", "AQL_GRAPH_TRAVERSAL", "s,als,s|a", false, false, true, false, false) }, - { "TRAVERSAL_TREE", Function("TRAVERSAL_TREE", "AQL_TRAVERSAL_TREE", "h,h,s,s,s|a", false, false, true, false, false) }, + { "TRAVERSAL_TREE", Function("TRAVERSAL_TREE", "AQL_TRAVERSAL_TREE", "hs,hs,s,s,s|a", false, false, true, false, false) }, { "GRAPH_TRAVERSAL_TREE", Function("GRAPH_TRAVERSAL_TREE", "AQL_GRAPH_TRAVERSAL_TREE", "s,als,s,s|a", false, false, true, false, false) }, - { "EDGES", Function("EDGES", "AQL_EDGES", "h,s,s|l,o", true, false, true, false, false, &Functions::Edges, NotInCluster) }, + { "EDGES", Function("EDGES", "AQL_EDGES", "hs,s,s|l,o", true, false, true, false, false, &Functions::Edges, NotInCluster) }, { "GRAPH_EDGES", Function("GRAPH_EDGES", "AQL_GRAPH_EDGES", "s,als|a", false, false, true, false, false) }, { "GRAPH_VERTICES", Function("GRAPH_VERTICES", "AQL_GRAPH_VERTICES", "s,als|a", false, false, true, false, false) }, - { "NEIGHBORS", Function("NEIGHBORS", "AQL_NEIGHBORS", "h,h,s,s|l,a", true, false, true, false, false, &Functions::Neighbors, NotInCluster) }, + { "NEIGHBORS", Function("NEIGHBORS", "AQL_NEIGHBORS", "hs,hs,s,s|l,a", true, false, true, false, false, &Functions::Neighbors, NotInCluster) }, { "GRAPH_NEIGHBORS", Function("GRAPH_NEIGHBORS", "AQL_GRAPH_NEIGHBORS", "s,als|a", false, false, true, false, false) }, { "GRAPH_COMMON_NEIGHBORS", Function("GRAPH_COMMON_NEIGHBORS", "AQL_GRAPH_COMMON_NEIGHBORS", "s,als,als|a,a", false, false, true, false, false) }, { "GRAPH_COMMON_PROPERTIES", Function("GRAPH_COMMON_PROPERTIES", "AQL_GRAPH_COMMON_PROPERTIES", "s,als,als|a", false, false, true, false, false) }, From 16e181fe056173e20636838ae7520e78179451dd Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Thu, 3 Dec 2015 09:23:15 +0100 Subject: [PATCH 4/4] Adjust comments to reality for asyncRequest. --- arangod/Cluster/ClusterComm.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arangod/Cluster/ClusterComm.cpp b/arangod/Cluster/ClusterComm.cpp index 3552377914..be0f2e0342 100644 --- a/arangod/Cluster/ClusterComm.cpp +++ b/arangod/Cluster/ClusterComm.cpp @@ -152,14 +152,9 @@ OperationID ClusterComm::getOperationID () { /// either in the callback or via poll. The caller has to call delete on /// the resulting ClusterCommResult*. The library takes ownerships of /// the pointers `headerFields` and `callback` and releases -/// the memory when the operation has been finished. If `freeBody` -/// is `true`, then the library takes ownership of the pointer `body` -/// as well and deletes it at the end. If `freeBody` is `false, it -/// is the caller's responsibility to ensure that the object object -/// to which `body` points is retained until the full asynchronous -/// operation is finished and has been reported back to the caller -/// and that the object is destructed after the operation has finally -/// terminated. +/// the memory when the operation has been finished. We use a shared_ptr +/// for the body string such that it is possible to use the same body +/// in multiple requests. /// /// Arguments: `clientTransactionID` is a string coming from the client /// and describing the transaction the client is doing, `coordTransactionID`