1
0
Fork 0

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

This commit is contained in:
Kaveh Vahedipour 2016-10-24 15:04:16 +02:00
commit cc12a75be9
12 changed files with 111 additions and 71 deletions

View File

@ -23,7 +23,7 @@ cp server.key server.key.org
openssl rsa -in server.key.org -out server.key openssl rsa -in server.key.org -out server.key
# sign the csr with the key, creates certificate PEM file "server.crt" # sign the csr with the key, creates certificate PEM file "server.crt"
openssl x509 -req -days 365 -in server.csr -signkey server.key -out openssl x509 -req -days 365 -in server.csr -signkey server.key -out \
server.crt server.crt
# combine certificate and key into single PEM file "server.pem" # combine certificate and key into single PEM file "server.pem"

View File

@ -9,40 +9,50 @@ EXAMPLES=1
LINT=1 LINT=1
while [ "$#" -gt 1 ]; do while [ "$#" -gt 1 ]; do
if [ "$1" == "--no-lint" ]; then case "$1" in
--no-lint)
LINT=0 LINT=0
shift shift
fi ;;
if [ "$1" == "--no-build" ]; then --no-build)
BUILD=0 BUILD=0
shift shift
fi ;;
if [ "$1" == "--recycle-build" ]; then --recycle-build)
BUILD=2 BUILD=2
shift shift
fi ;;
if [ "$1" == "--no-swagger" ]; then --no-swagger)
SWAGGER=0 SWAGGER=0
shift shift
fi ;;
if [ "$1" == "--no-examples" ]; then --no-examples)
EXAMPLES=0 EXAMPLES=0
shift shift
fi ;;
if [ "$1" == "--no-commit" ]; then --no-commit)
TAG=0 TAG=0
shift shift
fi ;;
if [ "$1" == "--no-book" ]; then --no-book)
BOOK=0 BOOK=0
shift shift
;;
*)
if test -n "${VERSION}"; then
echo "we already have a version ${VERSION} aborting because of $1"
exit 1
fi fi
VERSION="$1"
shift
;;
esac
done done
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
@ -50,7 +60,6 @@ if [ "$#" -ne 1 ]; then
exit 1 exit 1
fi fi
VERSION="$1"
if echo ${VERSION} | grep -q -- '-'; then if echo ${VERSION} | grep -q -- '-'; then
echo "${VERSION} mustn't contain minuses! " echo "${VERSION} mustn't contain minuses! "

View File

@ -892,7 +892,7 @@ VPackSlice AstNode::computeValue() const {
/// @brief compute the value for a constant value node /// @brief compute the value for a constant value node
/// the value is owned by the node and must not be freed by the caller /// the value is owned by the node and must not be freed by the caller
VPackSlice AstNode::computeValue(Transaction* trx) const { VPackSlice AstNode::computeValue(arangodb::Transaction* trx) const {
TRI_ASSERT(isConstant()); TRI_ASSERT(isConstant());
if (computedValue == nullptr) { if (computedValue == nullptr) {

View File

@ -29,12 +29,12 @@
using namespace arangodb::aql; using namespace arangodb::aql;
CollectionScanner::CollectionScanner(arangodb::Transaction* trx, CollectionScanner::CollectionScanner(arangodb::Transaction* trx,
ManagedDocumentResult* mmdr, arangodb::ManagedDocumentResult* mmdr,
std::string const& collection, std::string const& collection,
bool readRandom) bool readRandom)
: _cursor(trx->indexScan(collection, : _cursor(trx->indexScan(collection,
(readRandom ? Transaction::CursorType::ANY (readRandom ? arangodb::Transaction::CursorType::ANY
: Transaction::CursorType::ALL), : arangodb::Transaction::CursorType::ALL),
Transaction::IndexHandle(), VPackSlice(), mmdr, 0, Transaction::IndexHandle(), VPackSlice(), mmdr, 0,
UINT64_MAX, 1000, false)) { UINT64_MAX, 1000, false)) {
TRI_ASSERT(_cursor->successful()); TRI_ASSERT(_cursor->successful());
@ -42,7 +42,7 @@ CollectionScanner::CollectionScanner(arangodb::Transaction* trx,
CollectionScanner::~CollectionScanner() {} CollectionScanner::~CollectionScanner() {}
void CollectionScanner::scan(std::vector<IndexLookupResult>& result, size_t batchSize) { void CollectionScanner::scan(std::vector<arangodb::IndexLookupResult>& result, size_t batchSize) {
result.clear(); result.clear();
if (!_cursor->hasMore()) { if (!_cursor->hasMore()) {

View File

@ -29,7 +29,7 @@
namespace arangodb { namespace arangodb {
class ManagedDocumentResult; class ManagedDocumentResult;
class OperationCursor; struct OperationCursor;
class Transaction; class Transaction;
namespace aql { namespace aql {

View File

@ -261,12 +261,14 @@ bool Ditches::contains(Ditch::DitchType type) {
void Ditches::freeDitch(Ditch* ditch) { void Ditches::freeDitch(Ditch* ditch) {
TRI_ASSERT(ditch != nullptr); TRI_ASSERT(ditch != nullptr);
bool const isDocumentDitch = (ditch->type() == Ditch::TRI_DITCH_DOCUMENT);
{ {
MUTEX_LOCKER(mutexLocker, _lock); MUTEX_LOCKER(mutexLocker, _lock);
unlink(ditch); unlink(ditch);
if (ditch->type() == Ditch::TRI_DITCH_DOCUMENT) { if (isDocumentDitch) {
// decrease counter // decrease counter
--_numDocumentDitches; --_numDocumentDitches;
} }
@ -415,17 +417,16 @@ void Ditches::link(Ditch* ditch) {
// empty list // empty list
if (_end == nullptr) { if (_end == nullptr) {
_begin = ditch; _begin = ditch;
_end = ditch;
} }
// add to the end // add to the end
else { else {
ditch->_prev = _end; ditch->_prev = _end;
_end->_next = ditch; _end->_next = ditch;
_end = ditch;
} }
_end = ditch;
if (isDocumentDitch) { if (isDocumentDitch) {
// increase counter // increase counter
++_numDocumentDitches; ++_numDocumentDitches;

View File

@ -62,7 +62,7 @@ EdgeCollectionInfo::EdgeCollectionInfo(arangodb::Transaction* trx,
std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getEdges( std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getEdges(
std::string const& vertexId, std::string const& vertexId,
ManagedDocumentResult* mmdr) { arangodb::ManagedDocumentResult* mmdr) {
_searchBuilder.clear(); _searchBuilder.clear();
EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder); EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder);
return _trx->indexScan(_collectionName, return _trx->indexScan(_collectionName,
@ -72,7 +72,7 @@ std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getEdges(
std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getEdges( std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getEdges(
VPackSlice const& vertexId, VPackSlice const& vertexId,
ManagedDocumentResult* mmdr) { arangodb::ManagedDocumentResult* mmdr) {
_searchBuilder.clear(); _searchBuilder.clear();
EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder); EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder);
return _trx->indexScan(_collectionName, return _trx->indexScan(_collectionName,
@ -102,7 +102,7 @@ int EdgeCollectionInfo::getEdgesCoordinator(VPackSlice const& vertexId,
std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getReverseEdges( std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getReverseEdges(
std::string const& vertexId, std::string const& vertexId,
ManagedDocumentResult* mmdr) { arangodb::ManagedDocumentResult* mmdr) {
_searchBuilder.clear(); _searchBuilder.clear();
EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder); EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder);
return _trx->indexScan(_collectionName, return _trx->indexScan(_collectionName,
@ -112,7 +112,7 @@ std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getReverseEdges(
std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getReverseEdges( std::unique_ptr<arangodb::OperationCursor> EdgeCollectionInfo::getReverseEdges(
VPackSlice const& vertexId, VPackSlice const& vertexId,
ManagedDocumentResult* mmdr) { arangodb::ManagedDocumentResult* mmdr) {
_searchBuilder.clear(); _searchBuilder.clear();
EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder); EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder);
return _trx->indexScan(_collectionName, return _trx->indexScan(_collectionName,

View File

@ -332,7 +332,7 @@ void Traverser::UniqueVertexGetter::reset(VPackSlice startVertex) {
} }
Traverser::Traverser(arangodb::traverser::TraverserOptions* opts, arangodb::Transaction* trx, Traverser::Traverser(arangodb::traverser::TraverserOptions* opts, arangodb::Transaction* trx,
ManagedDocumentResult* mmdr) arangodb::ManagedDocumentResult* mmdr)
: _trx(trx), : _trx(trx),
_mmdr(mmdr), _mmdr(mmdr),
_startIdBuilder(trx), _startIdBuilder(trx),

View File

@ -19,11 +19,7 @@
"frontend/js/lib/bootstrap-min.js", "frontend/js/lib/bootstrap-min.js",
"frontend/js/lib/d3.min.js", "frontend/js/lib/d3.min.js",
"frontend/js/lib/nv.d3.min.js", "frontend/js/lib/nv.d3.min.js",
"frontend/js/lib/dygraph-combined.min.js", "frontend/js/lib/dygraph-combined.min.js"
"frontend/js/lib/jquery-2.1.0.min.js",
"frontend/js/lib/underscore-min.js",
"frontend/js/lib/backbone-min.js",
"frontend/js/lib/bootstrap-min.js"
], ],
css: [ css: [
"frontend/css/swagger/hightlight.default.css", "frontend/css/swagger/hightlight.default.css",

View File

@ -510,6 +510,7 @@ authRouter.get('/graph/:name', function (req, res) {
} }
} }
} }
edgeObj.sortColor = edgeObj.color;
edgesObj[edge._id] = edgeObj; edgesObj[edge._id] = edgeObj;
}); });
@ -548,6 +549,7 @@ authRouter.get('/graph/:name', function (req, res) {
label: nodeLabel, label: nodeLabel,
size: nodeSize || 3, size: nodeSize || 3,
color: config.nodeColor || '#2ecc71', color: config.nodeColor || '#2ecc71',
sortColor: undefined,
x: Math.random(), x: Math.random(),
y: Math.random() y: Math.random()
}; };
@ -572,6 +574,7 @@ authRouter.get('/graph/:name', function (req, res) {
} }
} }
nodeObj.sortColor = nodeObj.color;
nodesObj[node._id] = nodeObj; nodesObj[node._id] = nodeObj;
} }
}); });

View File

@ -350,7 +350,11 @@
if (value === 'true') { if (value === 'true') {
window.App.graphViewer.switchNodeColorByCollection(true); window.App.graphViewer.switchNodeColorByCollection(true);
} else { } else {
if ($('#g_nodeColorAttribute').is(':disabled')) {
window.App.graphViewer.switchNodeColorByCollection(false); window.App.graphViewer.switchNodeColorByCollection(false);
} else {
window.App.graphViewer.switchNodeColorByCollection(false, true);
}
} }
return; return;
// EDGES COLORING // EDGES COLORING
@ -359,7 +363,11 @@
if (value === 'true') { if (value === 'true') {
window.App.graphViewer.switchEdgeColorByCollection(true); window.App.graphViewer.switchEdgeColorByCollection(true);
} else { } else {
if ($('#g_nodeColorAttribute').is(':disabled')) {
window.App.graphViewer.switchEdgeColorByCollection(false); window.App.graphViewer.switchEdgeColorByCollection(false);
} else {
window.App.graphViewer.switchEdgeColorByCollection(false, true);
}
} }
return; return;
} }

View File

@ -259,9 +259,11 @@
this.killCurrentGraph(); this.killCurrentGraph();
// TODO add WebGL features // TODO add WebGL features
this.renderGraph(this.graphData.modified, null, false, layout, 'canvas'); this.renderGraph(this.graphData.modified, null, false, layout, 'canvas');
if ($('#g_nodeColorByCollection').val() === 'true') { if ($('#g_nodeColorByCollection').val() === 'true') {
this.switchNodeColorByCollection(true); this.switchNodeColorByCollection(true);
} else {
if ($('#g_nodeColor').is(':disabled')) {
this.updateColors(true, true, null, null, true);
} else { } else {
if (this.ncolor) { if (this.ncolor) {
this.updateColors(true, true, this.ncolor, this.ecolor); this.updateColors(true, true, this.ncolor, this.ecolor);
@ -269,9 +271,13 @@
this.updateColors(true, true, '#2ecc71', '#2ecc71'); this.updateColors(true, true, '#2ecc71', '#2ecc71');
} }
} }
}
if ($('#g_edgeColorByCollection').val() === 'true') { if ($('#g_edgeColorByCollection').val() === 'true') {
this.switchEdgeColorByCollection(true); this.switchEdgeColorByCollection(true);
} else {
if ($('#g_edgeColor').is(':disabled')) {
this.updateColors(true, true, null, null, true);
} else { } else {
if (this.ecolor) { if (this.ecolor) {
this.updateColors(true, true, this.ncolor, this.ecolor); this.updateColors(true, true, this.ncolor, this.ecolor);
@ -279,6 +285,7 @@
this.updateColors(true, true, '#2ecc71', '#2ecc71'); this.updateColors(true, true, '#2ecc71', '#2ecc71');
} }
} }
}
}, },
buildCollectionColors: function () { buildCollectionColors: function () {
@ -315,7 +322,7 @@
} }
}, },
switchNodeColorByCollection: function (boolean) { switchNodeColorByCollection: function (boolean, origin) {
var self = this; var self = this;
self.buildCollectionColors(); self.buildCollectionColors();
if (boolean) { if (boolean) {
@ -324,6 +331,9 @@
}); });
self.currentGraph.refresh(); self.currentGraph.refresh();
} else {
if (origin) {
this.updateColors(true, null, null, null, origin);
} else { } else {
if (this.ncolor) { if (this.ncolor) {
this.updateColors(true, null, this.ncolor, this.ecolor); this.updateColors(true, null, this.ncolor, this.ecolor);
@ -331,9 +341,10 @@
this.updateColors(true, null, '#2ecc71', '#2ecc71'); this.updateColors(true, null, '#2ecc71', '#2ecc71');
} }
} }
}
}, },
switchEdgeColorByCollection: function (boolean) { switchEdgeColorByCollection: function (boolean, origin) {
var self = this; var self = this;
self.buildCollectionColors(); self.buildCollectionColors();
@ -343,6 +354,9 @@
}); });
self.currentGraph.refresh(); self.currentGraph.refresh();
} else {
if (origin) {
this.updateColors(true, null, null, null, origin);
} else { } else {
if (this.ecolor) { if (this.ecolor) {
this.updateColors(null, true, this.ncolor, this.ecolor); this.updateColors(null, true, this.ncolor, this.ecolor);
@ -350,6 +364,7 @@
this.updateColors(null, true, '#2ecc71', '#2ecc71'); this.updateColors(null, true, '#2ecc71', '#2ecc71');
} }
} }
}
}, },
buildCollectionSizes: function () { buildCollectionSizes: function () {
@ -1084,7 +1099,7 @@
} }
}, },
updateColors: function (nodes, edges, ncolor, ecolor) { updateColors: function (nodes, edges, ncolor, ecolor, origin) {
var combinedName = frontendConfig.db + '_' + this.name; var combinedName = frontendConfig.db + '_' + this.name;
var self = this; var self = this;
@ -1101,7 +1116,11 @@
self.graphConfig = data.toJSON().graphs[combinedName]; self.graphConfig = data.toJSON().graphs[combinedName];
try { try {
self.currentGraph.graph.nodes().forEach(function (n) { self.currentGraph.graph.nodes().forEach(function (n) {
if (origin) {
n.color = n.sortColor;
} else {
n.color = ncolor; n.color = ncolor;
}
}); });
} catch (e) { } catch (e) {
self.graphNotInitialized = true; self.graphNotInitialized = true;
@ -1112,7 +1131,11 @@
if (edges === true) { if (edges === true) {
try { try {
self.currentGraph.graph.edges().forEach(function (e) { self.currentGraph.graph.edges().forEach(function (e) {
if (origin) {
e.color = e.sortColor;
} else {
e.color = ecolor; e.color = ecolor;
}
}); });
} catch (ignore) { } catch (ignore) {
self.graphNotInitialized = true; self.graphNotInitialized = true;