mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'sharding' of ssh://github.com/triAGENS/ArangoDB into sharding
This commit is contained in:
commit
a060bccbc4
File diff suppressed because it is too large
Load Diff
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
routes: {
|
routes: {
|
||||||
"planTest" : "planTest",
|
"planTest" : "planTest",
|
||||||
|
"planSymmetric" : "planSymmetric",
|
||||||
|
"planAsymmetric" : "planAsymmetric",
|
||||||
"planScenarioSelector" : "planScenarioSelector"
|
"planScenarioSelector" : "planScenarioSelector"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,6 +20,20 @@
|
||||||
this.planTestView.render();
|
this.planTestView.render();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
planSymmetric: function() {
|
||||||
|
if (!this.planSymmetricView) {
|
||||||
|
this.planSymmetricView = new window.PlanSymmetricView();
|
||||||
|
}
|
||||||
|
this.planTestView.render();
|
||||||
|
},
|
||||||
|
|
||||||
|
planAsymmetric: function() {
|
||||||
|
if (!this.planAsymmetricView) {
|
||||||
|
this.planAsymmetricView = new window.PlanAsymmetricView();
|
||||||
|
}
|
||||||
|
this.planAsymmetricView.render();
|
||||||
|
},
|
||||||
|
|
||||||
planScenarioSelector: function() {
|
planScenarioSelector: function() {
|
||||||
if (!this.PlanScenarioSelector) {
|
if (!this.PlanScenarioSelector) {
|
||||||
this.PlanScenarioSelector = new window.PlanScenarioSelectorView();
|
this.PlanScenarioSelector = new window.PlanScenarioSelectorView();
|
||||||
|
@ -25,8 +41,6 @@
|
||||||
this.PlanScenarioSelector.render();
|
this.PlanScenarioSelector.render();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
/*
|
/*
|
||||||
this.footerView = new window.FooterView();
|
this.footerView = new window.FooterView();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||||
/*global window, $, Backbone, document, arangoCollection,arangoHelper,dashboardView,arangoDatabase*/
|
/*global window, $, Backbone, plannerTemplateEngine */
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
@ -13,8 +13,9 @@
|
||||||
simpleNavigationCheck;
|
simpleNavigationCheck;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
r = new window.plannerRouter();
|
r = new window.PlannerRouter();
|
||||||
simpleNavigationCheck = function(url, viewName, initObject, funcList, shouldNotRender) {
|
simpleNavigationCheck = function(url, viewName,
|
||||||
|
initObject, funcList, shouldNotRender) {
|
||||||
var route,
|
var route,
|
||||||
view = {},
|
view = {},
|
||||||
checkFuncExec = function() {
|
checkFuncExec = function() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true, browser: true*/
|
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true, browser: true*/
|
||||||
/*global describe, beforeEach, afterEach, it, spyOn, expect*/
|
/*global describe, beforeEach, afterEach, it, spyOn, expect*/
|
||||||
/*global runs, waitsFor, jasmine*/
|
/*global runs, waitsFor, jasmine*/
|
||||||
/*global $, arangoCollection*/
|
/*global $*/
|
||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true, browser: true*/
|
||||||
|
/*global describe, beforeEach, afterEach, it, spyOn, expect*/
|
||||||
|
/*global runs, waitsFor, jasmine*/
|
||||||
|
/*global $, arangoCollection*/
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
describe("Plan Test View", function() {
|
||||||
|
|
||||||
|
var myView, ip, port, coords, dbs;
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
$('body').append('<div id="content" class="removeMe"></div>');
|
||||||
|
|
||||||
|
ip = "192.168.0.1";
|
||||||
|
port = 8529;
|
||||||
|
coords = 4;
|
||||||
|
dbs = 5;
|
||||||
|
|
||||||
|
|
||||||
|
myView = new window.PlanTestView();
|
||||||
|
myView.render();
|
||||||
|
|
||||||
|
$("#host").val(ip);
|
||||||
|
$("#port").val(port);
|
||||||
|
$("#coordinators").val(coords);
|
||||||
|
$("#dbs").val(dbs);
|
||||||
|
spyOn($, "ajax");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function() {
|
||||||
|
$('.removeMe').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should start a cluster", function() {
|
||||||
|
$("#startPlan").click();
|
||||||
|
expect($.ajax).toHaveBeenCalledWith("cluster/plan", {
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
dispatcher: ip + ":" + port,
|
||||||
|
numberCoordinators: coords,
|
||||||
|
numberDBServers: dbs,
|
||||||
|
type: "testSetup"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not start a cluster if dispatcher port is missing", function() {
|
||||||
|
$("#host").val("");
|
||||||
|
$("#startPlan").click();
|
||||||
|
expect($.ajax).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not start a cluster if dispatcher host is missing", function() {
|
||||||
|
$("#port").val("");
|
||||||
|
$("#startPlan").click();
|
||||||
|
expect($.ajax).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not start a cluster if coordinator number is missing", function() {
|
||||||
|
$("#coordinators").val("");
|
||||||
|
$("#startPlan").click();
|
||||||
|
expect($.ajax).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not start a cluster if db number is missing", function() {
|
||||||
|
$("#dbs").val("");
|
||||||
|
$("#startPlan").click();
|
||||||
|
expect($.ajax).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}());
|
|
@ -380,16 +380,6 @@ function handleDatabaseChanges (plan, current) {
|
||||||
cleanupCurrentDatabases();
|
cleanupCurrentDatabases();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief create an index in a shard
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
function createIndex (shard, index) {
|
|
||||||
var collection = arangodb.db._collection(shard);
|
|
||||||
|
|
||||||
return collection.ensureIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief create collections if they exist in the plan but not locally
|
/// @brief create collections if they exist in the plan but not locally
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -544,7 +534,7 @@ function createLocalCollections (plannedCollections) {
|
||||||
shard,
|
shard,
|
||||||
JSON.stringify(index));
|
JSON.stringify(index));
|
||||||
|
|
||||||
createIndex(shard, index);
|
arangodb.db._collection(shard).ensureIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue