8000 ui: added replicationFactor option during SmartGraph creation. (#3267) · MohammedDeveloper/arangodb@3390462 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3390462

Browse files
hkernbachfceller
authored andcommitted
ui: added replicationFactor option during SmartGraph creation. (arangodb#3267)
1 parent 435383e commit 3390462

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
devel
22
-----
33

4+
* ui: added replicationFactor option during SmartGraph creation.
5+
46
* make the mmfiles compactor configurable
57

68
* leader-follower replication catchup code has been rewritten in C++

js/apps/system/_admin/aardvark/APP/frontend/js/views/graphManagementView.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
$('#row_general-replicationFactor').show();
5858
$('#smartGraphInfo').hide();
5959
$('#row_new-numberOfShards').hide();
60+
$('#row_new-replicationFactor').hide();
6061
$('#row_new-smartGraphAttribute').hide();
6162
},
6263

@@ -65,6 +66,7 @@
6566
$('#row_general-replicationFactor').hide();
6667
$('#smartGraphInfo').show();
6768
$('#row_new-numberOfShards').show();
69+
$('#row_new-replicationFactor').show();
6870
$('#row_new-smartGraphAttribute').show();
6971
},
7072

@@ -654,7 +656,8 @@
654656
newCollectionObject.isSmart = true;
655657
newCollectionObject.options = {
656658
numberOfShards: $('#new-numberOfShards').val(),
657-
smartGraphAttribute: $('#new-smartGraphAttribute').val()
659+
smartGraphAttribute: $('#new-smartGraphAttribute').val(),
660+
replicationFactor: parseInt($('#new-replicationFactor').val())
658661
};
659662
}
660663
} else {
@@ -776,6 +779,17 @@
776779
);
777780
}
778781

782+
if (graph.get('replicationFactor')) {
783+
tableContent.push(
784+
window.modalView.createReadOnlyEntry(
785+
'replicationFactor',
786+
'Replication factor',
787+
graph.get('replicationFactor'),
788+
'Total number of copies of the data in the cluster.'
789+
)
790+
);
791+
}
792+
779793
buttons.push(
780794
window.modalView.createDeleteButton('Delete', this.deleteGraph.bind(this))
781795
);
@@ -824,6 +838,23 @@
824838
)
825839
);
826840

841+
tableContent.push(
842+
window.modalView.createTextEntry(
843+
'new-replicationFactor',
844+
'Replication factor',
845+
'',
846+
'Numeric value. Must be at least 1. Total number of copies of the data in the cluster.',
847+
'',
848+
false,
849+
[
850+
{
851+
rule: Joi.string().allow('').optional().regex(/^[0-9]*$/),
852+
msg: 'Must be a number.'
853+
}
854+
]
855+
)
856+
);
857+
827858
tableContent.push(
828859
window.modalView.createTextEntry(
829860
'new-smartGraphAttribute',

js/apps/system/_api/gharial/APP/gharial.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ function graphForClient (g) {
174174
orphanCollections: g._orphanCollections(),
175175
isSmart: g.__isSmart || false,
176176
numberOfShards: g.__numberOfShards || 0,
177+
replicationFactor: g.__replicationFactor || 1,
177178
smartGraphAttribute: g.__smartGraphAttribute || '',
178179
_id: g.__id,
179180
_rev: g.__rev
@@ -227,12 +228,13 @@ router.post('/', function (req, res) {
227228
try {
228229
if (isEnterprise && req.body.isSmart === true) {
229230
const smartGraphAttribute = req.body.options.smartGraphAttribute;
231+
const replicationFactor = req.body.options.replicationFactor;
230232
const numberOfShards = req.body.options.numberOfShards;
231233
g = SmartGraph._create(
232234
req.body.name,
233235
req.body.edgeDefinitions,
234236
req.body.orphanCollections,
235-
{waitForSync, numberOfShards, smartGraphAttribute}
237+
{waitForSync, numberOfShards, smartGraphAttribute, replicationFactor}
236238
);
237239
} else {
238240
if (req.body.options && req.body.options.numberOfShards && cluster.isCluster()) {

0 commit comments

Comments
 (0)
0