1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Kaveh Vahedipour 2016-06-22 13:15:44 +02:00
commit 4f6f22928b
21 changed files with 43 additions and 22 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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:
![traversal graph](../../Manual/Graphs/traversal_graph.png)
![traversal graph](traversal_graph.png)
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:
![traversal graph](../../Manual/Graphs/traversal_graph.png)
![traversal graph](traversal_graph.png)
@startDocuBlockInline GRAPHSP_01_create_graph
@EXAMPLE_ARANGOSH_OUTPUT{GRAPHSP_01_create_graph}

View File

@ -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:
![traversal graph](../../Manual/Graphs/traversal_graph.png)
![traversal graph](traversal_graph.png)
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
![traversal graph step 1](../../Manual/Graphs/traversal_graph1.png)
![traversal graph step 1](traversal_graph1.png)
Now it walks to one of the direct neighbors of **A**, say **B** (note: ordering
is not guaranteed!):
![traversal graph step 2](../../Manual/Graphs/traversal_graph2.png)
![traversal graph step 2](traversal_graph2.png)
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**:
![traversal graph step 3](../../Manual/Graphs/traversal_graph3.png)
![traversal graph step 3](traversal_graph3.png)
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:
![traversal graph step 4](../../Manual/Graphs/traversal_graph4.png)
![traversal graph step 4](traversal_graph4.png)
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.
![traversal graph step 5](../../Manual/Graphs/traversal_graph5.png)
![traversal graph step 5](traversal_graph5.png)
And identical to the iterations before we will visit **H**:
![traversal graph step 6](../../Manual/Graphs/traversal_graph6.png)
![traversal graph step 6](traversal_graph6.png)
And **J**:
![traversal graph step 7](../../Manual/Graphs/traversal_graph7.png)
![traversal graph step 7](traversal_graph7.png)
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:
![traversal graph](../../Manual/Graphs/traversal_graph.png)
![traversal graph](traversal_graph.png)
@startDocuBlockInline GRAPHTRAV_01_create_graph
@EXAMPLE_ARANGOSH_OUTPUT{GRAPHTRAV_01_create_graph}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -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)

View File

@ -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).
![manage graphs](images/graphsView.png)
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 -->
![display graphs](images/graphViewer.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -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.
![select database](../Administration/WebInterface/images/selectDBView.png)
You should then be presented the dashboard with server statistics like this:
![Aardvark Dashboard Request Statistics](../Administration/WebInterface/images/dashboardView.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 36 B

View File

@ -0,0 +1 @@
../../AQL/Graphs/traversal_graph.png

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 36 B

View File

@ -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

View File

@ -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 {

View File

@ -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>'
);
}