mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
f31e3c3688
|
@ -31,8 +31,6 @@
|
||||||
#include "Graph/ConstantWeightShortestPathFinder.h"
|
#include "Graph/ConstantWeightShortestPathFinder.h"
|
||||||
#include "Graph/ShortestPathFinder.h"
|
#include "Graph/ShortestPathFinder.h"
|
||||||
#include "Graph/ShortestPathResult.h"
|
#include "Graph/ShortestPathResult.h"
|
||||||
#include "Graph/AttributeWeightShortestPathFinder.h"
|
|
||||||
#include "Graph/ConstantWeightShortestPathFinder.h"
|
|
||||||
#include "Transaction/Methods.h"
|
#include "Transaction/Methods.h"
|
||||||
#include "Utils/OperationCursor.h"
|
#include "Utils/OperationCursor.h"
|
||||||
#include "VocBase/LogicalCollection.h"
|
#include "VocBase/LogicalCollection.h"
|
||||||
|
|
|
@ -348,7 +348,13 @@ function printTraversalDetails (traversals) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node.hasOwnProperty('options')) {
|
if (node.hasOwnProperty('options')) {
|
||||||
var opts = optify(node.options);
|
let opts = optify(node.options);
|
||||||
|
if (opts.length > maxOptionsLen) {
|
||||||
|
maxOptionsLen = opts.length;
|
||||||
|
}
|
||||||
|
} else if (node.hasOwnProperty("traversalFlags")) {
|
||||||
|
// Backwards compatibility for < 3.2
|
||||||
|
let opts = optify(node.traversalFlags);
|
||||||
if (opts.length > maxOptionsLen) {
|
if (opts.length > maxOptionsLen) {
|
||||||
maxOptionsLen = opts.length;
|
maxOptionsLen = opts.length;
|
||||||
}
|
}
|
||||||
|
@ -386,6 +392,8 @@ function printTraversalDetails (traversals) {
|
||||||
|
|
||||||
if (traversals[i].hasOwnProperty('options')) {
|
if (traversals[i].hasOwnProperty('options')) {
|
||||||
line += optify(traversals[i].options, true) + pad(1 + maxOptionsLen - optify(traversals[i].options, false).length) + ' ';
|
line += optify(traversals[i].options, true) + pad(1 + maxOptionsLen - optify(traversals[i].options, false).length) + ' ';
|
||||||
|
} else if (traversals[i].hasOwnProperty('traversalFlags')) {
|
||||||
|
line += optify(traversals[i].traversalFlags, true) + pad(1 + maxOptionsLen - optify(traversals[i].traversalFlags, false).length) + ' ';
|
||||||
} else {
|
} else {
|
||||||
line += pad(1 + maxOptionsLen) + ' ';
|
line += pad(1 + maxOptionsLen) + ' ';
|
||||||
}
|
}
|
||||||
|
@ -856,7 +864,13 @@ function processQuery (query, explain) {
|
||||||
return keyword('FOR') + ' ' + variableName(node.outVariable) + ' ' + keyword('IN') + ' ' + collection(node.collection) + ' ' + annotation('/* ' + (node.reverse ? 'reverse ' : '') + node.index.type + ' index scan */');
|
return keyword('FOR') + ' ' + variableName(node.outVariable) + ' ' + keyword('IN') + ' ' + collection(node.collection) + ' ' + annotation('/* ' + (node.reverse ? 'reverse ' : '') + node.index.type + ' index scan */');
|
||||||
|
|
||||||
case 'TraversalNode':
|
case 'TraversalNode':
|
||||||
node.minMaxDepth = node.options.minDepth + '..' + node.options.maxDepth;
|
if (node.hasOwnProperty("options")) {
|
||||||
|
node.minMaxDepth = node.options.minDepth + '..' + node.options.maxDepth;
|
||||||
|
} else if (node.hasOwnProperty("traversalFlags")) {
|
||||||
|
node.minMaxDepth = node.traversalFlags.minDepth + '..' + node.traversalFlags.maxDepth;
|
||||||
|
} else {
|
||||||
|
node.minMaxDepth = '1..1';
|
||||||
|
}
|
||||||
node.minMaxDepthLen = node.minMaxDepth.length;
|
node.minMaxDepthLen = node.minMaxDepth.length;
|
||||||
|
|
||||||
rc = keyword('FOR ');
|
rc = keyword('FOR ');
|
||||||
|
|
|
@ -15,6 +15,7 @@ function help() {
|
||||||
echo " -g/--gossip-mode Integer (0: Announce first endpoint to all"
|
echo " -g/--gossip-mode Integer (0: Announce first endpoint to all"
|
||||||
echo " 1: Grow list of known endpoints for each"
|
echo " 1: Grow list of known endpoints for each"
|
||||||
echo " 2: Cyclic default: 0)"
|
echo " 2: Cyclic default: 0)"
|
||||||
|
echo " -b/--offset-ports Offsetports (default: 0, i.e. A:5001)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "EXAMPLES:"
|
echo "EXAMPLES:"
|
||||||
echo " scripts/startStandaloneAgency.sh"
|
echo " scripts/startStandaloneAgency.sh"
|
||||||
|
@ -53,12 +54,20 @@ WAIT_FOR_SYNC="true"
|
||||||
USE_MICROTIME="false"
|
USE_MICROTIME="false"
|
||||||
GOSSIP_MODE=0
|
GOSSIP_MODE=0
|
||||||
START_DELAYS=0
|
START_DELAYS=0
|
||||||
|
INTERACTIVE_MODE=""
|
||||||
|
XTERM="xterm"
|
||||||
|
XTERMOPTIONS=""
|
||||||
|
BUILD="build"
|
||||||
|
|
||||||
while [[ ${1} ]]; do
|
while [[ ${1} ]]; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-a|--agency-size)
|
-a|--agency-size)
|
||||||
NRAGENTS=${2}
|
NRAGENTS=${2}
|
||||||
shift;;
|
shift;;
|
||||||
|
-i|--interactive)
|
||||||
|
INTERACTIVE_MODE=${2}
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-p|--pool-size)
|
-p|--pool-size)
|
||||||
POOLSZ=${2}
|
POOLSZ=${2}
|
||||||
shift;;
|
shift;;
|
||||||
|
@ -95,6 +104,10 @@ while [[ ${1} ]]; do
|
||||||
-s|--start-delays)
|
-s|--start-delays)
|
||||||
START_DELAYS=${2}
|
START_DELAYS=${2}
|
||||||
shift;;
|
shift;;
|
||||||
|
-b|--port-offset)
|
||||||
|
PORT_OFFSET=${2}
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
help; exit 1
|
help; exit 1
|
||||||
;;
|
;;
|
||||||
|
@ -148,15 +161,28 @@ if [[ $(( $NRAGENTS % 2 )) == 0 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MINP=0.5
|
|
||||||
MAXP=2.5
|
if [ ! -z "$INTERACTIVE_MODE" ] ; then
|
||||||
|
if [ "$INTERACTIVE_MODE" == "C" ] ; then
|
||||||
|
ARANGOD="${BUILD}/bin/arangod "
|
||||||
|
CO_ARANGOD="$XTERM $XTERMOPTIONS -e ${BUILD}/bin/arangod --console "
|
||||||
|
echo "Starting one coordinator in terminal with --console"
|
||||||
|
elif [ "$INTERACTIVE_MODE" == "R" ] ; then
|
||||||
|
ARANGOD="$XTERM $XTERMOPTIONS -e rr ${BUILD}/bin/arangod --console "
|
||||||
|
CO_ARANGOD=$ARANGOD
|
||||||
|
echo Running cluster in rr with --console.
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ARANGOD="${BUILD}/bin/arangod "
|
||||||
|
CO_ARANGOD=$ARANGOD
|
||||||
|
fi
|
||||||
|
|
||||||
SFRE=2.5
|
SFRE=2.5
|
||||||
COMP=200000
|
COMP=200000
|
||||||
KEEP=500
|
BASE=$(( $PORT_OFFSET + 5000 ))
|
||||||
BASE=5000
|
|
||||||
|
|
||||||
if [ "$GOSSIP_MODE" = "0" ]; then
|
if [ "$GOSSIP_MODE" = "0" ]; then
|
||||||
GOSSIP_PEERS=" --agency.endpoint $TRANSPORT://localhost:$BASE"
|
GOSSIP_PEERS=" --agency.endpoint $TRANSPORT://[::1]:$BASE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf agency
|
rm -rf agency
|
||||||
|
@ -168,13 +194,14 @@ shuffle
|
||||||
|
|
||||||
count=1
|
count=1
|
||||||
|
|
||||||
|
|
||||||
for aid in "${aaid[@]}"; do
|
for aid in "${aaid[@]}"; do
|
||||||
|
|
||||||
port=$(( $BASE + $aid ))
|
port=$(( $BASE + $aid ))
|
||||||
|
|
||||||
if [ "$GOSSIP_MODE" = "2" ]; then
|
if [ "$GOSSIP_MODE" = "2" ]; then
|
||||||
nport=$(( $BASE + $(( $(( $aid + 1 )) % 3 ))))
|
nport=$(( $BASE + $(( $(( $aid + 1 )) % 3 ))))
|
||||||
GOSSIP_PEERS=" --agency.endpoint $TRANSPORT://localhost:$nport"
|
GOSSIP_PEERS=" --agency.endpoint $TRANSPORT://[::1]:$nport"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$GOSSIP_MODE" = "3" ]; then
|
if [ "$GOSSIP_MODE" = "3" ]; then
|
||||||
|
@ -182,21 +209,18 @@ for aid in "${aaid[@]}"; do
|
||||||
for id in "${aaid[@]}"; do
|
for id in "${aaid[@]}"; do
|
||||||
if [ ! "$id" = "$aid" ]; then
|
if [ ! "$id" = "$aid" ]; then
|
||||||
nport=$(( $BASE + $(( $id )) ))
|
nport=$(( $BASE + $(( $id )) ))
|
||||||
GOSSIP_PEERS+=" --agency.endpoint $TRANSPORT://localhost:$nport"
|
GOSSIP_PEERS+=" --agency.endpoint $TRANSPORT://[::1]:$nport"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf " starting agent %s " "$aid"
|
printf " starting agent %s " "$aid"
|
||||||
build/bin/arangod \
|
$ARANGOD \
|
||||||
-c none \
|
-c none \
|
||||||
--agency.activate true \
|
--agency.activate true \
|
||||||
$GOSSIP_PEERS \
|
$GOSSIP_PEERS \
|
||||||
--agency.my-address $TRANSPORT://localhost:$port \
|
--agency.my-address $TRANSPORT://[::1]:$port \
|
||||||
--agency.compaction-step-size $COMP \
|
--agency.compaction-step-size $COMP \
|
||||||
--agency.compaction-keep-size $KEEP \
|
|
||||||
--agency.election-timeout-min $MINP \
|
|
||||||
--agency.election-timeout-max $MAXP \
|
|
||||||
--agency.pool-size $POOLSZ \
|
--agency.pool-size $POOLSZ \
|
||||||
--agency.size $NRAGENTS \
|
--agency.size $NRAGENTS \
|
||||||
--agency.supervision true \
|
--agency.supervision true \
|
||||||
|
@ -211,14 +235,14 @@ for aid in "${aaid[@]}"; do
|
||||||
$LOG_LEVEL \
|
$LOG_LEVEL \
|
||||||
--log.use-microtime $USE_MICROTIME \
|
--log.use-microtime $USE_MICROTIME \
|
||||||
--server.authentication false \
|
--server.authentication false \
|
||||||
--server.endpoint $TRANSPORT://0.0.0.0:$port \
|
--server.endpoint $TRANSPORT://[::]:$port \
|
||||||
--server.statistics false \
|
--server.statistics false \
|
||||||
$SSLKEYFILE \
|
$SSLKEYFILE \
|
||||||
> agency/$port.stdout 2>&1 &
|
| tee cluster/$PORT.stdout 2>&1 &
|
||||||
PIDS+=$!
|
PIDS+=$!
|
||||||
PIDS+=" "
|
PIDS+=" "
|
||||||
if [ "$GOSSIP_MODE" == "1" ]; then
|
if [ "$GOSSIP_MODE" == "1" ]; then
|
||||||
GOSSIP_PEERS+=" --agency.endpoint $TRANSPORT://localhost:$port"
|
GOSSIP_PEERS+=" --agency.endpoint $TRANSPORT://[::1]:$port"
|
||||||
fi
|
fi
|
||||||
if [ $count -lt $POOLSZ ]; then
|
if [ $count -lt $POOLSZ ]; then
|
||||||
if isuint $START_DELAYS; then
|
if isuint $START_DELAYS; then
|
||||||
|
@ -237,6 +261,6 @@ done
|
||||||
|
|
||||||
echo " done. Your agents are ready at port $BASE onward."
|
echo " done. Your agents are ready at port $BASE onward."
|
||||||
#echo "Process ids: $PIDS"
|
#echo "Process ids: $PIDS"
|
||||||
echo "Try ${CURL}localhost:5000/_api/agency/config."
|
echo "Try ${CURL}[::1]:5000/_api/agency/config."
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue