Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
|
@ -502,7 +502,7 @@ private:
|
|||
uint64_t x = toUInt64(v);
|
||||
reserveSpace(1 + vSize);
|
||||
_start[_pos++] = 0x1c;
|
||||
appendLength(x, 8);
|
||||
appendLength<8>(x);
|
||||
}
|
||||
|
||||
uint8_t* addString(uint64_t strLen) {
|
||||
|
@ -511,7 +511,7 @@ private:
|
|||
// long string
|
||||
_start[_pos++] = 0xbf;
|
||||
// write string length
|
||||
appendLength(strLen, 8);
|
||||
appendLength<8>(strLen);
|
||||
} else {
|
||||
// short string
|
||||
_start[_pos++] = static_cast<uint8_t>(0x40 + strLen);
|
||||
|
@ -727,7 +727,8 @@ private:
|
|||
_index[depth].push_back(_pos - _stack[depth]);
|
||||
}
|
||||
|
||||
void appendLength(ValueLength v, uint64_t n) {
|
||||
template <uint64_t n>
|
||||
void appendLength(ValueLength v) {
|
||||
reserveSpace(n);
|
||||
for (uint64_t i = 0; i < n; ++i) {
|
||||
_start[_pos++] = v & 0xff;
|
||||
|
|
|
@ -346,7 +346,7 @@ Builder& Builder::close() {
|
|||
} else { // offsetSize == 8
|
||||
_start[tos] += 3;
|
||||
if (needNrSubs) {
|
||||
appendLength(index.size(), 8);
|
||||
appendLength<8>(index.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ uint8_t* Builder::set(Value const& item) {
|
|||
reserveSpace(1 + sizeof(double));
|
||||
_start[_pos++] = 0x1b;
|
||||
memcpy(&x, &v, sizeof(double));
|
||||
appendLength(x, 8);
|
||||
appendLength<8>(x);
|
||||
break;
|
||||
}
|
||||
case ValueType::External: {
|
||||
|
@ -607,7 +607,7 @@ uint8_t* Builder::set(Value const& item) {
|
|||
// long string
|
||||
reserveSpace(1 + 8 + size);
|
||||
_start[_pos++] = 0xbf;
|
||||
appendLength(size, 8);
|
||||
appendLength<8>(size);
|
||||
memcpy(_start + _pos, s->c_str(), size);
|
||||
}
|
||||
_pos += size;
|
||||
|
@ -623,7 +623,7 @@ uint8_t* Builder::set(Value const& item) {
|
|||
// long string
|
||||
reserveSpace(1 + 8 + size);
|
||||
_start[_pos++] = 0xbf;
|
||||
appendLength(size, 8);
|
||||
appendLength<8>(size);
|
||||
memcpy(_start + _pos, p, size);
|
||||
}
|
||||
_pos += size;
|
||||
|
@ -721,7 +721,7 @@ uint8_t* Builder::set(ValuePair const& pair) {
|
|||
// long string
|
||||
reserveSpace(1 + 8 + size);
|
||||
_start[_pos++] = 0xbf;
|
||||
appendLength(size, 8);
|
||||
appendLength<8>(size);
|
||||
memcpy(_start + _pos, pair.getStart(), checkOverflow(size));
|
||||
_pos += size;
|
||||
} else {
|
||||
|
|
|
@ -14,7 +14,7 @@ path you will get a result in form of a set with two items:
|
|||
Let's take a look at a simple example to explain how it works.
|
||||
This is the graph that we are going to find a shortest path on:
|
||||
|
||||

|
||||

|
||||
|
||||
Now we use the following parameters for our query:
|
||||
|
||||
|
@ -116,7 +116,7 @@ combination with `LIMIT 1`.
|
|||
!SECTION Examples
|
||||
We will create a simple symmetric traversal demonstration graph:
|
||||
|
||||

|
||||

|
||||
|
||||
@startDocuBlockInline GRAPHSP_01_create_graph
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{GRAPHSP_01_create_graph}
|
||||
|
|
|
@ -25,7 +25,7 @@ set with three items:
|
|||
Let's take a look at a simple example to explain how it works.
|
||||
This is the graph that we are going to traverse:
|
||||
|
||||

|
||||

|
||||
|
||||
We use the following parameters for our query:
|
||||
|
||||
|
@ -34,39 +34,39 @@ We use the following parameters for our query:
|
|||
3. We use a *max* depth of 2.
|
||||
4. We follow only in *OUTBOUND* direction of edges
|
||||
|
||||

|
||||

|
||||
|
||||
Now it walks to one of the direct neighbors of **A**, say **B** (note: ordering
|
||||
is not guaranteed!):
|
||||
|
||||

|
||||

|
||||
|
||||
The query will remember the state (red circle) and will emit the first result
|
||||
**A** → **B** (black box). This will also prevent the traverser to be trapped
|
||||
in cycles. Now again it will visit one of the direct neighbors of **B**, say **E**:
|
||||
|
||||

|
||||

|
||||
|
||||
We have limited the query with a *max* depth of *2*, so it will not pick any
|
||||
neighbor of **E**, as the path from **A** to **E** already requires *2* steps.
|
||||
Instead, we will go back one level to **B** and continue with any other direct
|
||||
neighbor there:
|
||||
|
||||

|
||||

|
||||
|
||||
Again after we produced this result we will step back to **B**.
|
||||
But there is no neighbor of **B** left that we have not yet visited.
|
||||
Hence we go another step back to **A** and continue with any other neighbor there.
|
||||
|
||||

|
||||

|
||||
|
||||
And identical to the iterations before we will visit **H**:
|
||||
|
||||

|
||||

|
||||
|
||||
And **J**:
|
||||
|
||||

|
||||

|
||||
|
||||
After these steps there is no further result left. So all together this query
|
||||
has returned the following paths:
|
||||
|
@ -250,7 +250,7 @@ exist and hence cannot fulfill the condition here.
|
|||
|
||||
We will create a simple symmetric traversal demonstration graph:
|
||||
|
||||

|
||||

|
||||
|
||||
@startDocuBlockInline GRAPHTRAV_01_create_graph
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{GRAPHTRAV_01_create_graph}
|
||||
|
|
After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
@ -155,6 +155,17 @@ book-check-dangling-anchors:
|
|||
fi
|
||||
rm -rf /tmp/anchorlist.txt /tmp/tags
|
||||
|
||||
book-check-images-referenced:
|
||||
exitcode=0; \
|
||||
for image in `find $(NAME) -name \*.png `; do \
|
||||
baseimage=`basename $$image`; \
|
||||
if ! grep -Rq $$baseimage $(NAME); then \
|
||||
echo "$$image is not used!";\
|
||||
exitcode=1;\
|
||||
fi; \
|
||||
done; \
|
||||
exit $${exitcode}
|
||||
|
||||
build-book-symlinks:
|
||||
echo "##### generate backwards compatibility symlinks for $(NAME)"
|
||||
cd books/$(NAME); pwd; \
|
||||
|
@ -203,6 +214,7 @@ build-book:
|
|||
make book-check-restheader-leftovers
|
||||
make book-check-mdpp-leftovers
|
||||
make ppbook-check-directory-link
|
||||
make book-check-images-referenced
|
||||
|
||||
cd ppbooks/$(NAME) && gitbook install
|
||||
cd ppbooks/$(NAME) && gitbook build ./ ./../../books/$(NAME)
|
||||
|
|
|
@ -4,8 +4,12 @@ The *Graphs* tab provides a viewer facility for graph data stored in ArangoDB.
|
|||
It allows browsing ArangoDB graphs stored in the *_graphs* system collection or
|
||||
a graph consisting of an arbitrary vertex and [edge collection](../../Appendix/Glossary.md#edge-collection).
|
||||
|
||||

|
||||
|
||||
Please note that the graph viewer requires SVG support in your browser.
|
||||
Especially Internet Explorer browsers older than version 9 are likely to not
|
||||
support this.
|
||||
|
||||
<!-- Graph Viewer -->
|
||||
|
||||

|
||||
|
|
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 26 KiB |
|
@ -80,6 +80,8 @@ password is empty (see [above](#securing-the-installation)).
|
|||
Next you will be asked which database to use. Every server instance comes with
|
||||
a `_system` database. Select this database to continue.
|
||||
|
||||

|
||||
|
||||
You should then be presented the dashboard with server statistics like this:
|
||||
|
||||

|
||||
|
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 36 B |
|
@ -0,0 +1 @@
|
|||
../../AQL/Graphs/traversal_graph.png
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 36 B |
|
@ -611,6 +611,8 @@ QueryResult Query::execute(QueryRegistry* registry) {
|
|||
|
||||
TRI_ASSERT(_engine != nullptr);
|
||||
auto resultBuilder = std::make_shared<VPackBuilder>(&options);
|
||||
resultBuilder->buffer()->reserve(16 * 1024); // reserve some space in Builder to avoid frequent reallocs
|
||||
|
||||
try {
|
||||
resultBuilder->openArray();
|
||||
// this is the RegisterId our results can be found in
|
||||
|
|
|
@ -353,7 +353,7 @@ anonymousRouter.get('/download/zip', function (req, res) {
|
|||
|
||||
anonymousRouter.get('/docs/standalone/*', module.context.apiDocumentation(
|
||||
(req, res) => {
|
||||
if (req.suffix === 'swagger.json' && !req.arangoUser) {
|
||||
if (req.suffix === 'swagger.json' && !req.arangoUser && internal.authenticationEnabled()) {
|
||||
res.throw('unauthorized');
|
||||
}
|
||||
return {
|
||||
|
@ -365,7 +365,7 @@ anonymousRouter.get('/docs/standalone/*', module.context.apiDocumentation(
|
|||
|
||||
anonymousRouter.get('/docs/*', module.context.apiDocumentation(
|
||||
(req, res) => {
|
||||
if (req.suffix === 'swagger.json' && !req.arangoUser) {
|
||||
if (req.suffix === 'swagger.json' && !req.arangoUser && internal.authenticationEnabled()) {
|
||||
res.throw('unauthorized');
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -753,7 +753,7 @@
|
|||
$('#graphTab').hide();
|
||||
$('#modal-dialog .modal-delete-confirmation').append(
|
||||
'<fieldset><input type="checkbox" id="dropGraphCollections" name="" value="">' +
|
||||
'<label for="mc">also drop collections?</label>' +
|
||||
'<label for="dropGraphCollections">also drop collections?</label>' +
|
||||
'</fieldset>'
|
||||
);
|
||||
}
|
||||
|
|