1
0
Fork 0

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

This commit is contained in:
Jan Steemann 2014-01-21 11:10:52 +01:00
commit 74c76ce41e
1 changed files with 7 additions and 7 deletions

View File

@ -312,8 +312,8 @@ function handleDatabaseChanges (plan, current) {
function createLocalCollections (plannedCollections) {
var ourselves = ArangoServerState.id();
var createCollectionAgency = function (database, payload) {
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + ourselves,
var createCollectionAgency = function (database, shard, payload) {
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + shard,
payload);
};
@ -377,7 +377,7 @@ function createLocalCollections (plannedCollections) {
writeLocked({ part: "Current" },
createCollectionAgency,
[ database, payload ]);
[ database, shard, payload ]);
}
else {
// collection exists, now compare collection properties
@ -411,7 +411,7 @@ function createLocalCollections (plannedCollections) {
writeLocked({ part: "Current" },
createCollectionAgency,
[ database, payload ]);
[ database, shard, payload ]);
}
}
}
@ -438,9 +438,9 @@ function createLocalCollections (plannedCollections) {
function dropLocalCollections (plannedCollections) {
var ourselves = ArangoServerState.id();
var dropCollectionAgency = function (database, id) {
var dropCollectionAgency = function (database, shardID, id) {
try {
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + ourselves);
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + shardID);
}
catch (err) {
// ignore errors
@ -487,7 +487,7 @@ function dropLocalCollections (plannedCollections) {
writeLocked({ part: "Current" },
dropCollectionAgency,
[ database, collections[collection].planId ]);
[ database, collection, collections[collection].planId ]);
}
}
}