1
0
Fork 0

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

This commit is contained in:
gschwab 2014-04-04 16:39:44 +02:00
commit 9a1872597a
17 changed files with 2881 additions and 2326 deletions

View File

@ -71,12 +71,6 @@ v2.0.2 (XXXX-XX-XX)
* during cluster startup, do not log (somewhat expected) connection errors with
log level error, but with log level info
* fixed a memory barrier / cpu synchronisation problem with libev, affecting
Windows with Visual Studio 2013 (probably earlier versions are affected, too)
The issue is described in detail here:
http://lists.schmorp.de/pipermail/libev/2014q1/002318.html
* fixed dashboard modals
* fixed connection check for cluster planning front end: firefox does
@ -363,7 +357,28 @@ v2.0.0-rc1 (2014-02-28)
* added collection status "loading"
v1.4.13 (XXXX-XX-XX)
v1.4.14 (XXXX-XX-XX)
--------------------
* fixed race conditions during shape / attribute insertion
A race condition could have led to spurios `cannot find attribute #xx` or
`cannot find shape #xx` (where xx is a number) warning messages being logged
by the server. This happened when a new attribute was inserted and at the same
time was queried by another thread.
Also fixed a race condition that may have occurred when a thread tried to
access the shapes / attributes hash tables while they were resized. In this
cases, the shape / attribute may have been hashed to a wrong slot.
* fixed a memory barrier / cpu synchronisation problem with libev, affecting
Windows with Visual Studio 2013 (probably earlier versions are affected, too)
The issue is described in detail here:
http://lists.schmorp.de/pipermail/libev/2014q1/002318.html
v1.4.13 (2014-03-14)
--------------------
* added diagnostic output for Foxx application upload

View File

@ -129,17 +129,17 @@ BOOST_AUTO_TEST_CASE (tst_insert_key_unique) {
void* r = 0;
ELEMENT(e1, (char*) "test1", 1, 2, 3)
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1, false));
BOOST_CHECK_EQUAL((size_t) 1, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e1, TRI_LookupByKeyAssociativeSynced(&a1, "test1"));
ELEMENT(e2, (char*) "test2", 2, 3, 4)
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2, false));
BOOST_CHECK_EQUAL((size_t) 2, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e2, TRI_LookupByKeyAssociativeSynced(&a1, "test2"));
ELEMENT(e3, (char*) "test3", 99, 3, 5)
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3, false));
BOOST_CHECK_EQUAL((size_t) 3, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e3, TRI_LookupByKeyAssociativeSynced(&a1, "test3"));
@ -156,27 +156,27 @@ BOOST_AUTO_TEST_CASE (tst_insert_key_nonunique) {
void* r = 0;
ELEMENT(e1, (char*) "test1", 1, 2, 3)
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1, false));
BOOST_CHECK_EQUAL((size_t) 1, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e1, TRI_LookupByKeyAssociativeSynced(&a1, "test1"));
ELEMENT(e2, (char*) "test1", 2, 3, 4)
BOOST_CHECK_EQUAL(&e1, TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2));
BOOST_CHECK_EQUAL(&e1, TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2, false));
BOOST_CHECK_EQUAL((size_t) 1, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e1, TRI_LookupByKeyAssociativeSynced(&a1, "test1"));
ELEMENT(e3, (char*) "test2", 99, 3, 5)
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3, false));
BOOST_CHECK_EQUAL((size_t) 2, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e3, TRI_LookupByKeyAssociativeSynced(&a1, "test2"));
ELEMENT(e4, (char*) "test1", 99, 3, 5)
BOOST_CHECK_EQUAL(&e1, TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4));
BOOST_CHECK_EQUAL(&e1, TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4, false));
BOOST_CHECK_EQUAL((size_t) 2, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e1, TRI_LookupByKeyAssociativeSynced(&a1, "test1"));
ELEMENT(e5, (char*) "test2", -99, 33, 15)
BOOST_CHECK_EQUAL(&e3, TRI_InsertKeyAssociativeSynced(&a1, e5.key, &e5));
BOOST_CHECK_EQUAL(&e3, TRI_InsertKeyAssociativeSynced(&a1, e5.key, &e5, false));
BOOST_CHECK_EQUAL((size_t) 2, TRI_GetLengthAssociativeSynced(&a1));
BOOST_CHECK_EQUAL(&e3, TRI_LookupByKeyAssociativeSynced(&a1, "test2"));
@ -193,16 +193,16 @@ BOOST_AUTO_TEST_CASE (tst_lookup_key) {
void* r = 0;
ELEMENT(e1, (char*) "test1", 1, 2, 3)
TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1);
TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1, false);
ELEMENT(e2, (char*) "test2", 2, 3, 4)
TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2);
TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2, false);
ELEMENT(e3, (char*) "test3", 3, 4, 5)
TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3);
TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3, false);
ELEMENT(e4, (char*) "test4", 4, 5, 6)
TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4);
TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4, false);
data_container_t* r1 = (data_container_t*) TRI_LookupByKeyAssociativeSynced(&a1, "test1");
BOOST_CHECK_EQUAL(&e1, r1);
@ -250,16 +250,16 @@ BOOST_AUTO_TEST_CASE (tst_remove_key) {
void* r = 0;
ELEMENT(e1, (char*) "test1", 1, 2, 3)
TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1);
TRI_InsertKeyAssociativeSynced(&a1, e1.key, &e1, false);
ELEMENT(e2, (char*) "test2", 2, 3, 4)
TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2);
TRI_InsertKeyAssociativeSynced(&a1, e2.key, &e2, false);
ELEMENT(e3, (char*) "test3", 3, 4, 5)
TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3);
TRI_InsertKeyAssociativeSynced(&a1, e3.key, &e3, false);
ELEMENT(e4, (char*) "test4", 4, 5, 6)
TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4);
TRI_InsertKeyAssociativeSynced(&a1, e4.key, &e4, false);
data_container_t* r1 = (data_container_t*) TRI_RemoveKeyAssociativeSynced(&a1, "test1");
BOOST_CHECK_EQUAL(&e1, r1);
@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE (tst_mass_insert) {
e->b = i + 1;
e->c = i + 2;
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e->key, e));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e->key, e, false));
BOOST_CHECK_EQUAL(i, TRI_GetLengthAssociativeSynced(&a1));
data_container_t* s = (data_container_t*) TRI_LookupByKeyAssociativeSynced(&a1, key);
@ -402,7 +402,7 @@ BOOST_AUTO_TEST_CASE (tst_mass_insert_remove) {
e->b = i + 1;
e->c = i + 2;
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e->key, e));
BOOST_CHECK_EQUAL(r, TRI_InsertKeyAssociativeSynced(&a1, e->key, e, false));
BOOST_CHECK_EQUAL(i, TRI_GetLengthAssociativeSynced(&a1));
data_container_t* s = (data_container_t*) TRI_LookupByKeyAssociativeSynced(&a1, key);

View File

@ -464,11 +464,11 @@ static TRI_shape_aid_t FindOrCreateAttributeByName (TRI_shaper_t* shaper,
dfi->_sizeAttributes += (int64_t) TRI_DF_ALIGN_BLOCK(totalSize);
}
// enter into the dictionaries
f = TRI_InsertKeyAssociativeSynced(&s->_attributeNames, name, result);
f = TRI_InsertKeyAssociativeSynced(&s->_attributeIds, &aid, result, false);
assert(f == NULL);
f = TRI_InsertKeyAssociativeSynced(&s->_attributeIds, &aid, result);
// enter into the dictionaries
f = TRI_InsertKeyAssociativeSynced(&s->_attributeNames, name, result, false);
assert(f == NULL);
// ...........................................................................
@ -748,11 +748,11 @@ static TRI_shape_t const* FindShape (TRI_shaper_t* shaper,
// enter into the dictionaries
l = (TRI_shape_t*) (((char*) result) + sizeof(TRI_df_shape_marker_t));
f = TRI_InsertElementAssociativeSynced(&s->_shapeDictionary, l);
f = TRI_InsertKeyAssociativeSynced(&s->_shapeIds, &l->_sid, l, false);
assert(f == NULL);
f = TRI_InsertKeyAssociativeSynced(&s->_shapeIds, &l->_sid, l);
f = TRI_InsertElementAssociativeSynced(&s->_shapeDictionary, l, false);
assert(f == NULL);
TRI_UnlockMutex(&s->_shapeLock);
@ -1299,20 +1299,14 @@ int TRI_MoveMarkerVocShaper (TRI_shaper_t* s,
TRI_LockMutex(&shaper->_shapeLock);
// remove the old marker
f = TRI_RemoveKeyAssociativeSynced(&shaper->_shapeIds, &l->_sid);
// and re-insert the marker with the new pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_shapeIds, &l->_sid, l, true);
assert(f != NULL);
// re-insert the marker with the new pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_shapeIds, &l->_sid, l);
assert(f == NULL);
// same for the shape dictionary
f = TRI_RemoveElementAssociativeSynced(&shaper->_shapeDictionary, l);
// delete and re-insert
f = TRI_InsertElementAssociativeSynced(&shaper->_shapeDictionary, l, true);
assert(f != NULL);
// re-insert
f = TRI_InsertElementAssociativeSynced(&shaper->_shapeDictionary, l);
assert(f == NULL);
TRI_UnlockMutex(&shaper->_shapeLock);
}
@ -1325,20 +1319,14 @@ int TRI_MoveMarkerVocShaper (TRI_shaper_t* s,
// remove attribute by name (p points to new location of name, but names
// are identical in old and new marker)
f = TRI_RemoveKeyAssociativeSynced(&shaper->_attributeNames, p);
// and re-insert same attribute with adjusted pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeNames, p, m, true);
assert(f != NULL);
// now re-insert same attribute with adjusted pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeNames, p, m);
assert(f == NULL);
// same for attribute ids
f = TRI_RemoveKeyAssociativeSynced(&shaper->_attributeIds, &m->_aid);
// delete and re-insert same attribute with adjusted pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeIds, &m->_aid, m, true);
assert(f != NULL);
// now re-insert same attribute with adjusted pointer
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeIds, &m->_aid, m);
assert(f == NULL);
TRI_UnlockMutex(&shaper->_attributeLock);
}
@ -1359,10 +1347,10 @@ int TRI_InsertShapeVocShaper (TRI_shaper_t* s,
LOG_TRACE("found shape %lu", (unsigned long) l->_sid);
f = TRI_InsertElementAssociativeSynced(&shaper->_shapeDictionary, l);
f = TRI_InsertElementAssociativeSynced(&shaper->_shapeDictionary, l, false);
assert(f == NULL);
f = TRI_InsertKeyAssociativeSynced(&shaper->_shapeIds, &l->_sid, l);
f = TRI_InsertKeyAssociativeSynced(&shaper->_shapeIds, &l->_sid, l, false);
assert(f == NULL);
if (shaper->_nextSid <= l->_sid) {
@ -1385,7 +1373,7 @@ int TRI_InsertAttributeVocShaper (TRI_shaper_t* s,
LOG_TRACE("found attribute '%s', aid: %lu", p, (unsigned long) m->_aid);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeNames, p, m);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeNames, p, m, false);
if (f != NULL) {
char const* name = shaper->_collection->base.base._info._name;
@ -1397,7 +1385,7 @@ int TRI_InsertAttributeVocShaper (TRI_shaper_t* s,
#endif
}
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeIds, &m->_aid, m);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributeIds, &m->_aid, m, false);
if (f != NULL) {
char const* name = shaper->_collection->base.base._info._name;

View File

@ -1,61 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterCollectionView = Backbone.View.extend({
el: '#clusterCollections',
template: templateEngine.createTemplate("clusterCollectionView.ejs"),
events: {
"click .collection": "loadCollection"
},
initialize: function() {
this.shardsView = new window.ClusterShardsView({
collection: new window.ClusterShards()
});
var rerender = function() {
this.render(this.db, this.server);
};
this.collection.bind("add", rerender.bind(this));
this.collection.bind("change", rerender.bind(this));
this.collection.bind("remove", rerender.bind(this));
},
loadCollection: function(e) {
var id = e.currentTarget.id;
this.shardsView.render(
this.db,
id,
this.server
);
},
unrender: function() {
$(this.el).html("");
this.shardsView.unrender();
},
stopUpdating: function() {
this.collection.stopUpdating();
this.shardsView.stopUpdating();
},
render: function(db, server) {
this.db = db;
this.server = server;
this.collection.startUpdating();
$(this.el).html(this.template.render({
collections: this.collection.getList(this.db)
}));
this.shardsView.unrender();
return this;
}
});
}());

View File

@ -1,26 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterCoordinatorView = Backbone.View.extend({
el: '#clusterServers',
template: templateEngine.createTemplate("clusterCoordinatorView.ejs"),
unrender: function() {
$(this.el).html("");
},
render: function() {
$(this.el).html(this.template.render({
coordinators: this.collection.getList()
}));
return this;
}
});
}());

View File

@ -1,36 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterDashboardView = Backbone.View.extend({
el: '#content',
template: templateEngine.createTemplate("clusterDashboardView.ejs"),
initialize: function() {
this.dbservers = new window.ClusterServers();
this.coordinators = new window.ClusterCoordinators();
},
render: function(){
$(this.el).html(this.template.render({}));
if (!this.overView) {
this.overView = new window.ClusterOverviewView({
dbservers: this.dbservers,
coordinators: this.coordinators
});
}
this.overView.render();
return this;
},
stopUpdating: function() {
this.overView.stopUpdating();
}
});
}());

View File

@ -1,56 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterDatabaseView = Backbone.View.extend({
el: '#clusterDatabases',
template: templateEngine.createTemplate("clusterDatabaseView.ejs"),
events: {
"click .database": "loadDatabase"
},
initialize: function() {
this.colView = new window.ClusterCollectionView({
collection: new window.ClusterCollections()
});
var rerender = function() {
this.render(this.server);
};
this.collection.bind("add", rerender.bind(this));
this.collection.bind("change", rerender.bind(this));
this.collection.bind("remove", rerender.bind(this));
},
loadDatabase: function(e) {
var id = e.currentTarget.id;
this.colView.render(id, this.server);
},
unrender: function() {
$(this.el).html("");
this.colView.unrender();
},
stopUpdating: function() {
this.collection.stopUpdating();
this.colView.stopUpdating();
},
render: function(server) {
this.server = server;
this.collection.startUpdating();
$(this.el).html(this.template.render({
databases: this.collection.getList()
}));
this.colView.unrender();
return this;
}
});
}());

View File

@ -1,84 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global Backbone, templateEngine, window, $ */
(function() {
"use strict";
window.ClusterOverviewView = Backbone.View.extend({
el: '#clusterOverview',
template: templateEngine.createTemplate("clusterOverviewView.ejs"),
events: {
"click #dbserver": "loadDBServers",
"click #coordinator": "loadCoordinators"
},
initialize: function() {
this.isMinified = false;
this.dbservers = this.options.dbservers;
this.coordinators = this.options.coordinators;
this.serverView = new window.ClusterServerView({
collection: this.dbservers
});
this.coordinatorView = new window.ClusterCoordinatorView({
collection: this.coordinators
});
var rerender = function() {
this.render(this.isMinified);
if (this.selectedSub === "server") {
this.serverView.render(this.serverView.isMinified);
}
if (this.selectedSub === "coordinators") {
this.coordinatorView.render();
}
};
this.selectedSub = null;
this.dbservers.bind("add", rerender.bind(this));
this.dbservers.bind("change", rerender.bind(this));
this.dbservers.bind("remove", rerender.bind(this));
this.coordinators.bind("add", rerender.bind(this));
this.coordinators.bind("change", rerender.bind(this));
this.coordinators.bind("remove", rerender.bind(this));
},
loadDBServers: function() {
this.selectedSub = "server";
this.coordinatorView.unrender();
this.serverView.render();
this.render(true);
},
loadCoordinators: function() {
this.selectedSub = "coordinators";
this.serverView.unrender();
this.coordinatorView.render();
this.render(true);
},
stopUpdating: function() {
this.dbservers.stopUpdating();
this.coordinators.stopUpdating();
this.serverView.stopUpdating();
},
render: function(minify){
this.dbservers.startUpdating();
this.coordinators.startUpdating();
this.isMinified = !!minify;
if (!minify) {
this.selectedSub = null;
}
$(this.el).html(this.template.render({
minify: minify,
dbservers: this.dbservers.getOverview(),
coordinators: this.coordinators.getOverview()
}));
$(this.el).toggleClass("clusterColumnMax", !minify);
return this;
}
});
}());

View File

@ -1,53 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterServerView = Backbone.View.extend({
el: '#clusterServers',
template: templateEngine.createTemplate("clusterServerView.ejs"),
events: {
"click .server": "loadServer"
},
initialize: function() {
this.dbView = new window.ClusterDatabaseView({
collection: new window.ClusterDatabases()
});
this.isMinified = false;
},
loadServer: function(e) {
var id = e.currentTarget.id;
this.dbView.render(id);
this.render(true);
},
stopUpdating: function() {
this.dbView.stopUpdating();
},
unrender: function() {
$(this.el).html("");
this.dbView.unrender();
},
render: function(minify){
this.isMinified = !!minify;
if(!minify) {
this.dbView.unrender();
}
$(this.el).html(this.template.render({
minify: minify,
servers: this.collection.getList()
}));
return this;
}
});
}());

View File

@ -1,46 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global Backbone, templateEngine, $, window */
(function() {
"use strict";
window.ClusterShardsView = Backbone.View.extend({
el: '#clusterShards',
template: templateEngine.createTemplate("clusterShardsView.ejs"),
initialize: function() {
var rerender = function() {
if ($(this.el).html().trim() !== "") {
this.render(this.db, this.col, this.server);
}
};
this.collection.bind("add", rerender.bind(this));
this.collection.bind("change", rerender.bind(this));
this.collection.bind("remove", rerender.bind(this));
},
unrender: function() {
$(this.el).html("");
},
stopUpdating: function() {
this.collection.stopUpdating();
},
render: function(db, col, server) {
this.db = db;
this.col = col;
this.server = server;
this.collection.startUpdating();
$(this.el).html(this.template.render({
shards: this.collection.getList(db, col, server)
}));
return this;
}
});
}());

View File

@ -498,24 +498,11 @@
drawTable: function() {
var self = this;
/*
if (this.addDocumentSwitch === true) {
$(self.table).dataTable().fnAddData(
[
'<a id="plusIconDoc" style="padding-left: 30px">Add document</a>',
'',
'<img src="img/plus_icon.png" id="documentAddBtn"></img>'
]
);
}*/
if (window.arangoDocumentsStore.models.length === 0) {
if (window.arangoDocumentsStore.models.length === 0) {
$('.dataTables_empty').text('No documents');
}
else {
$.each(window.arangoDocumentsStore.models, function(key, value) {
var tempObj = {};
$.each(value.attributes.content, function(k, v) {
if (! (k === '_id' || k === '_rev' || k === '_key')) {
@ -679,7 +666,7 @@
});
return fields;
},
createIndex: function (e) {
createIndex: function () {
//e.preventDefault();
var self = this;
var collection = this.collectionName;

View File

@ -164,13 +164,6 @@
"frontend/js/views/dbSelectionView.js",
"frontend/js/views/editListEntryView.js",
"frontend/js/views/loginView.js",
"frontend/js/views/clusterDashboardView.js",
"frontend/js/views/clusterOverviewView.js",
"frontend/js/views/clusterServerView.js",
"frontend/js/views/clusterCoordinatorView.js",
"frontend/js/views/clusterDatabaseView.js",
"frontend/js/views/clusterCollectionView.js",
"frontend/js/views/clusterShardsView.js",
"frontend/js/views/userManagementView.js",
"frontend/js/views/userProfileView.js",
"frontend/js/views/userBarView.js",

View File

@ -287,7 +287,7 @@
expect(opt.processData).toEqual(false);
expect(opt.data).toEqual(JSON.stringify(
{
name: "heinz", waitForSync: true, isSystem: true,
name: "heinz", waitForSync: true, journalSize :2, isSystem: true,
type: 3, numberOfShards: 3, shardKeys: ["a", "b", "c"]
}
));
@ -310,7 +310,7 @@
expect(opt.processData).toEqual(false);
expect(opt.data).toEqual(JSON.stringify(
{
name: "heinz", waitForSync: true, isSystem: true,
name: "heinz", waitForSync: true, journalSize: 2, isSystem: true,
type: 3, numberOfShards: 3, shardKeys: ["a", "b", "c"]
}
));

File diff suppressed because it is too large Load Diff

View File

@ -48,7 +48,7 @@
/// @brief initial number of elements in the array
////////////////////////////////////////////////////////////////////////////////
#define INITIAL_SIZE (10)
#define INITIAL_SIZE (11)
////////////////////////////////////////////////////////////////////////////////
/// @}
@ -1269,17 +1269,6 @@ int TRI_InitAssociativeSynced (TRI_associative_synced_t* array,
array->_nrAlloc = INITIAL_SIZE;
#ifdef TRI_INTERNAL_STATS
array->_nrFinds = 0;
array->_nrAdds = 0;
array->_nrRems = 0;
array->_nrResizes = 0;
array->_nrProbesF = 0;
array->_nrProbesA = 0;
array->_nrProbesD = 0;
array->_nrProbesR = 0;
#endif
TRI_InitReadWriteLock(&array->_lock);
return TRI_ERROR_NO_ERROR;
@ -1332,21 +1321,13 @@ void const* TRI_LookupByKeyAssociativeSynced (TRI_associative_synced_t* array,
// compute the hash
hash = array->hashKey(array, key);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrFinds++;
#endif
// search the table
TRI_ReadLockReadWriteLock(&array->_lock);
i = hash % array->_nrAlloc;
while (array->_table[i] != NULL && ! array->isEqualKeyElement(array, key, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesF++;
#endif
}
result = array->_table[i];
@ -1369,21 +1350,13 @@ void const* TRI_LookupByElementAssociativeSynced (TRI_associative_synced_t* arra
// compute the hash
hash = array->hashElement(array, element);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrFinds++;
#endif
// search the table
TRI_ReadLockReadWriteLock(&array->_lock);
i = hash % array->_nrAlloc;
while (array->_table[i] != NULL && ! array->isEqualElementElement(array, element, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesF++;
#endif
}
result = array->_table[i];
@ -1399,40 +1372,38 @@ void const* TRI_LookupByElementAssociativeSynced (TRI_associative_synced_t* arra
////////////////////////////////////////////////////////////////////////////////
void* TRI_InsertElementAssociativeSynced (TRI_associative_synced_t* array,
void* element) {
void* element,
bool overwrite) {
uint64_t hash;
uint64_t i;
void* old;
// compute the hash
hash = array->hashElement(array, element);
TRI_WriteLockReadWriteLock(&array->_lock);
// check for out-of-memory
if (array->_nrAlloc == array->_nrUsed) {
if (array->_nrAlloc == array->_nrUsed && ! overwrite) {
TRI_WriteUnlockReadWriteLock(&array->_lock);
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
return NULL;
}
// compute the hash
hash = array->hashElement(array, element);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrAdds++;
#endif
// search the table
TRI_WriteLockReadWriteLock(&array->_lock);
while (array->_table[i] != NULL && ! array->isEqualElementElement(array, element, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesA++;
#endif
}
old = array->_table[i];
// if we found an element, return
if (old != NULL) {
if (overwrite) {
array->_table[i] = element;
}
TRI_WriteUnlockReadWriteLock(&array->_lock);
return old;
}
@ -1456,40 +1427,38 @@ void* TRI_InsertElementAssociativeSynced (TRI_associative_synced_t* array,
void* TRI_InsertKeyAssociativeSynced (TRI_associative_synced_t* array,
void const* key,
void* element) {
void* element,
bool overwrite) {
uint64_t hash;
uint64_t i;
void* old;
// check for out-of-memory
if (array->_nrAlloc == array->_nrUsed) {
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
return NULL;
}
// compute the hash
hash = array->hashKey(array, key);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrAdds++;
#endif
// search the table
TRI_WriteLockReadWriteLock(&array->_lock);
// check for out-of-memory
if (array->_nrAlloc == array->_nrUsed && ! overwrite) {
TRI_WriteUnlockReadWriteLock(&array->_lock);
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
return NULL;
}
i = hash % array->_nrAlloc;
while (array->_table[i] != NULL && ! array->isEqualKeyElement(array, key, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesA++;
#endif
}
old = array->_table[i];
// if we found an element, return
if (old != NULL) {
if (overwrite) {
array->_table[i] = element;
}
TRI_WriteUnlockReadWriteLock(&array->_lock);
return old;
}
@ -1519,21 +1488,13 @@ void* TRI_RemoveElementAssociativeSynced (TRI_associative_synced_t* array,
void* old;
hash = array->hashElement(array, element);
TRI_WriteLockReadWriteLock(&array->_lock);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrRems++;
#endif
// search the table
TRI_WriteLockReadWriteLock(&array->_lock);
while (array->_table[i] != NULL && ! array->isEqualElementElement(array, element, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesD++;
#endif
}
// if we did not find such an item return 0
@ -1579,21 +1540,13 @@ void* TRI_RemoveKeyAssociativeSynced (TRI_associative_synced_t* array,
void* old;
hash = array->hashKey(array, key);
TRI_WriteLockReadWriteLock(&array->_lock);
i = hash % array->_nrAlloc;
#ifdef TRI_INTERNAL_STATS
// update statistics
array->_nrRems++;
#endif
// search the table
TRI_WriteLockReadWriteLock(&array->_lock);
while (array->_table[i] != NULL && ! array->isEqualKeyElement(array, key, array->_table[i])) {
i = TRI_IncModU64(i, array->_nrAlloc);
#ifdef TRI_INTERNAL_STATS
array->_nrProbesD++;
#endif
}
// if we did not find such an item return false

View File

@ -419,18 +419,6 @@ typedef struct TRI_associative_synced_s {
TRI_read_write_lock_t _lock;
#ifdef TRI_INTERNAL_STATS
uint64_t _nrFinds; // statistics: number of lookup calls
uint64_t _nrAdds; // statistics: number of insert calls
uint64_t _nrRems; // statistics: number of remove calls
uint64_t _nrResizes; // statistics: number of resizes
uint64_t _nrProbesF; // statistics: number of misses while looking up
uint64_t _nrProbesA; // statistics: number of misses while inserting
uint64_t _nrProbesD; // statistics: number of misses while removing
uint64_t _nrProbesR; // statistics: number of misses while adding
#endif
TRI_memory_zone_t* _memoryZone;
}
TRI_associative_synced_t;
@ -494,31 +482,39 @@ void const* TRI_LookupByKeyAssociativeSynced (TRI_associative_synced_t*, void co
/// @brief lookups an element given an element
////////////////////////////////////////////////////////////////////////////////
void const* TRI_LookupByElementAssociativeSynced (TRI_associative_synced_t*, void const* element);
void const* TRI_LookupByElementAssociativeSynced (TRI_associative_synced_t*,
void const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief adds an element to the array
////////////////////////////////////////////////////////////////////////////////
void* TRI_InsertElementAssociativeSynced (TRI_associative_synced_t*, void* element);
void* TRI_InsertElementAssociativeSynced (TRI_associative_synced_t*,
void*,
bool);
////////////////////////////////////////////////////////////////////////////////
/// @brief adds an key/element to the array
////////////////////////////////////////////////////////////////////////////////
void* TRI_InsertKeyAssociativeSynced (TRI_associative_synced_t*, void const* key, void* element);
void* TRI_InsertKeyAssociativeSynced (TRI_associative_synced_t*,
void const*,
void*,
bool);
////////////////////////////////////////////////////////////////////////////////
/// @brief removes an element from the array
////////////////////////////////////////////////////////////////////////////////
void* TRI_RemoveElementAssociativeSynced (TRI_associative_synced_t*, void const* element);
void* TRI_RemoveElementAssociativeSynced (TRI_associative_synced_t*,
void const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief removes an key/element to the array
////////////////////////////////////////////////////////////////////////////////
void* TRI_RemoveKeyAssociativeSynced (TRI_associative_synced_t*, void const* key);
void* TRI_RemoveKeyAssociativeSynced (TRI_associative_synced_t*,
void const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief get the number of elements from the array

View File

@ -285,10 +285,10 @@ static TRI_shape_path_t const* FindShapePathByName (TRI_shaper_t* shaper,
TRI_Free(shaper->_memoryZone, aids);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributePathsByName, name, result);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributePathsByName, name, result, false);
assert(f == NULL);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributePathsByPid, &result->_pid, result);
f = TRI_InsertKeyAssociativeSynced(&shaper->_attributePathsByPid, &result->_pid, result, false);
assert(f == NULL);
// return pid