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
# 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
# combine certificate and key into single PEM file "server.pem"

View File

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

View File

@ -29,12 +29,12 @@
using namespace arangodb::aql;
CollectionScanner::CollectionScanner(arangodb::Transaction* trx,
ManagedDocumentResult* mmdr,
arangodb::ManagedDocumentResult* mmdr,
std::string const& collection,
bool readRandom)
: _cursor(trx->indexScan(collection,
(readRandom ? Transaction::CursorType::ANY
: Transaction::CursorType::ALL),
(readRandom ? arangodb::Transaction::CursorType::ANY
: arangodb::Transaction::CursorType::ALL),
Transaction::IndexHandle(), VPackSlice(), mmdr, 0,
UINT64_MAX, 1000, false)) {
TRI_ASSERT(_cursor->successful());
@ -42,7 +42,7 @@ CollectionScanner::CollectionScanner(arangodb::Transaction* trx,
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();
if (!_cursor->hasMore()) {

View File

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

View File

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

View File

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

View File

@ -19,11 +19,7 @@
"frontend/js/lib/bootstrap-min.js",
"frontend/js/lib/d3.min.js",
"frontend/js/lib/nv.d3.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"
"frontend/js/lib/dygraph-combined.min.js"
],
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;
});
@ -548,6 +549,7 @@ authRouter.get('/graph/:name', function (req, res) {
label: nodeLabel,
size: nodeSize || 3,
color: config.nodeColor || '#2ecc71',
sortColor: undefined,
x: Math.random(),
y: Math.random()
};
@ -572,6 +574,7 @@ authRouter.get('/graph/:name', function (req, res) {
}
}
nodeObj.sortColor = nodeObj.color;
nodesObj[node._id] = nodeObj;
}
});

View File

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

View File

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