10000 ui: added replicationFactor option during SmartGraph creation. by hkernbach · Pull Request #3267 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

ui: added replicationFactor option during SmartGraph creation. #3267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ui: added replicationFactor option during SmartGraph creation.
  • Loading branch information
hkernbach committed Sep 15, 2017
commit b627189410e6eee48c39b5f30bb5c4e57e3d8839
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devel
-----

* ui: added replicationFactor option during SmartGraph creation.

* make the mmfiles compactor configurable

* leader-follower replication catchup code has been rewritten in C++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
$('#row_general-replicationFactor').show();
$('#smartGraphInfo').hide();
$('#row_new-numberOfShards').hide();
$('#row_new-replicationFactor').hide();
$('#row_new-smartGraphAttribute').hide();
},

Expand All @@ -65,6 +66,7 @@
$('#row_general-replicationFactor').hide();
$('#smartGraphInfo').show();
$('#row_new-numberOfShards').show();
$('#row_new-replicationFactor').show();
$('#row_new-smartGraphAttribute').show();
},

Expand Down Expand Up @@ -654,7 +656,8 @@
newCollectionObject.isSmart = true;
newCollectionObject.options = {
numberOfShards: $('#new-numberOfShards').val(),
smartGraphAttribute: $('#new-smartGraphAttribute').val()
smartGraphAttribute: $('#new-smartGraphAttribute').val(),
replicationFactor: parseInt($('#new-replicationFactor').val())
};
}
} else {
Expand Down Expand Up @@ -776,6 +779,17 @@
);
}

if (graph.get('replicationFactor')) {
tableContent.push(
window.modalView.createReadOnlyEntry(
'replicationFactor',
'Replication factor',
graph.get('replicationFactor'),
'Total number of copies of the data in the cluster.'
)
);
}

buttons.push(
window.modalView.createDeleteButton('Delete', this.deleteGraph.bind(this))
);
Expand Down Expand Up @@ -824,6 +838,23 @@
)
);

tableContent.push(
window.modalView.createTextEntry(
'new-replicationFactor',
'Replication factor',
'',
'Numeric value. Must be at least 1. Total number of copies of the data in the cluster.',
'',
false,
[
{
rule: Joi.string().allow('').optional().regex(/^[0-9]*$/),
msg: 'Must be a number.'
}
]
)
);

tableContent.push(
window.modalView.createTextEntry(
'new-smartGraphAttribute',
Expand Down
4 changes: 3 additions & 1 deletion js/apps/system/_api/gharial/APP/gharial.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ function graphForClient (g) {
orphanCollections: g._orphanCollections(),
isSmart: g.__isSmart || false,
numberOfShards: g.__numberOfShards || 0,
replicationFactor: g.__replicationFactor || 1,
smartGraphAttribute: g.__smartGraphAttribute || '',
_id: g.__id,
_rev: g.__rev
Expand Down Expand Up @@ -227,12 +228,13 @@ router.post('/', function (req, res) {
try {
if (isEnterprise && req.body.isSmart === true) {
const smartGraphAttribute = req.body.options.smartGraphAttribute;
const replicationFactor = req.body.options.replicationFactor;
const numberOfShards = req.body.options.numberOfShards;
g = SmartGraph._create(
req.body.name,
req.body.edgeDefinitions,
req.body.orphanCollections,
{waitForSync, numberOfShards, smartGraphAttribute}
{waitForSync, numberOfShards, smartGraphAttribute, replicationFactor}
);
} else {
if (req.body.options && req.body.options.numberOfShards && cluster.isCluster()) {
Expand Down
0