1
0
Fork 0

Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel

This commit is contained in:
Max Neunhoeffer 2015-12-16 10:29:50 +01:00
commit c376200978
6 changed files with 54 additions and 31 deletions

View File

@ -11,19 +11,19 @@ AQL supports the following functions to operate on array values:
are added as they are. The function will recurse into sub-arrays up to a depth of
*depth*. *depth* has a default value of 1.
*Examples*
*Examples*
FLATTEN([ 1, 2, [ 3, 4 ], 5, [ 6, 7 ], [ 8, [ 9, 10 ] ])
will produce:
will produce:
[ 1, 2, 3, 4, 5, 6, 7, 8, [ 9, 10 ] ]
To fully flatten the array, use a *depth* of 2:
To fully flatten the array, use a *depth* of 2:
FLATTEN([ 1, 2, [ 3, 4 ], 5, [ 6, 7 ], [ 8, [ 9, 10 ] ], 2)
This will produce:
This will produce:
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
@ -99,27 +99,27 @@ AQL supports the following functions to operate on array values:
If *start* is negative, it can be used to indicate positions from the end of the
array.
*Examples*
*Examples*
SLICE([ 1, 2, 3, 4, 5 ], 0, 1)
will return *[ 1 ]*
will return *[ 1 ]*
SLICE([ 1, 2, 3, 4, 5 ], 1, 2)
will return *[ 2, 3 ]*
will return *[ 2, 3 ]*
SLICE([ 1, 2, 3, 4, 5 ], 3)
will return *[ 4, 5 ]*
will return *[ 4, 5 ]*
SLICE([ 1, 2, 3, 4, 5 ], 1, -1)
will return *[ 2, 3, 4 ]*
will return *[ 2, 3, 4 ]*
SLICE([ 1, 2, 3, 4, 5 ], 0, -2)
will return *[ 1, 2, 3 ]*
will return *[ 1, 2, 3 ]*
- *UNIQUE(array)*: Returns all unique elements in *array*. To determine
uniqueness, the function will use the comparison order.
@ -132,18 +132,18 @@ AQL supports the following functions to operate on array values:
Note: No duplicates will be removed. In order to remove duplicates, please use either
*UNION_DISTINCT* function or apply the *UNIQUE* on the result of *union*.
*Examples*
*Examples*
RETURN UNION(
[ 1, 2, 3 ],
[ 1, 2 ]
)
will produce:
will produce:
[ [ 1, 2, 3, 1, 2 ] ]
with duplicate removal:
with duplicate removal:
RETURN UNIQUE(
UNION(
@ -152,7 +152,7 @@ AQL supports the following functions to operate on array values:
)
)
will produce:
will produce:
[ [ 1, 2, 3 ] ]

View File

@ -4,10 +4,12 @@ This is an introduction to ArangoDB's interface for indexes in general.
There are special sections for
- [index basics](../IndexHandling/IndexBasics.md)
- [Which Index to use when](../IndexHandling/WhichIndex.md)
- [How ArangoDB uses indexes](../IndexHandling/HowArangoDBUsesIndexes.md)
- [working with indexes](../IndexHandling/WorkingWithIndexes.md)
- [hash indexes](../IndexHandling/Hash.md)
- [skiplists](../IndexHandling/Skiplist.md)
- [fulltext indexes](../IndexHandling/Fulltext.md)
- [geo-spatial indexes](../IndexHandling/Geo.md)
- [cap constraints](../IndexHandling/Cap.md)
- [hash indexes](../IndexHandling/Hash.md)
- [skiplists](../IndexHandling/Skiplist.md)
- [fulltext indexes](../IndexHandling/Fulltext.md)
- [geo-spatial indexes](../IndexHandling/Geo.md)
- [cap constraints](../IndexHandling/Cap.md)

View File

@ -72,7 +72,7 @@ namespace triagens {
CollectionInfo ();
CollectionInfo (struct TRI_json_t*);
explicit CollectionInfo (struct TRI_json_t*);
CollectionInfo (CollectionInfo const&);

View File

@ -181,7 +181,14 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
if (_traverser->_vertices.find(toId) == _traverser->_vertices.end()) {
verticesToFetch.emplace(toId);
}
_traverser->_edges.emplace(edgeId, edge.copy().steal());
std::unique_ptr<TRI_json_t> copy(edge.copy().steal());
if (copy != nullptr) {
if (_traverser->_edges.emplace(edgeId, copy.get()).second) {
// if insertion was successful, hand over the ownership
copy.release();
}
// else we have a duplicate and we need to free the copy again
}
}
std::vector<TraverserExpression*> expVertices;

View File

@ -518,6 +518,20 @@ function readImportantLogLines(logPath) {
}
function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) {
/*
* We assume the system has core files in /var/tmp/, and we have a gdb.
* you can do this at runtime doing:
*
* echo 1 > /proc/sys/kernel/core_uses_pid
* echo /var/tmp/core-%e-%p-%t > /proc/sys/kernel/core_pattern
*
* or at system startup by altering /etc/sysctl.d/corepattern.conf :
* # We want core files to be located in a central location
* # and know the PID plus the process name for later use.
* kernel.core_uses_pid = 1
* kernel.core_pattern = /var/tmp/core-%e-%p-%t
*/
var command;
command = '(';
command += "printf 'bt full\\n thread apply all bt\\n';";

View File

@ -167,10 +167,10 @@
/// @brief files
////////////////////////////////////////////////////////////////////////////////
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_CHDIR chdir
#define TRI_CLOSE close
@ -326,10 +326,10 @@
/// @brief files
////////////////////////////////////////////////////////////////////////////////
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_CHDIR chdir
#define TRI_CLOSE close
@ -501,10 +501,10 @@
/// @brief files
////////////////////////////////////////////////////////////////////////////////
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_DIR_SEPARATOR_CHAR '/'
#define TRI_DIR_SEPARATOR_STR "/"
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_O_CLOEXEC O_CLOEXEC
#define TRI_CHDIR chdir
#define TRI_CLOSE close
@ -734,7 +734,7 @@ typedef unsigned char bool;
#define S_IRGRP _S_IREAD
#define S_IWGRP _S_IWRITE
#define TRI_O_CLOEXEC
#define TRI_O_CLOEXEC 0
#define O_RDONLY _O_RDONLY
#define TRI_CHDIR _chdir