Skip to content

Commit

Permalink
Merge pull request #359 from andrese/Issue-328
Browse files Browse the repository at this point in the history
Issue 328 (ForceMege vs Optimize)
  • Loading branch information
mobz authored Sep 15, 2017
2 parents af42e97 + 4b3d75d commit bee0850
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 2 deletions.
26 changes: 25 additions & 1 deletion _site/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,28 @@
}.bind(this)
}).open();
},
_forceMergeIndex_handler: function(index) {
var fields = new app.ux.FieldCollection({
fields: [
new ui.TextField({ label: i18n.text("ForceMergeForm.MaxSegments"), name: "max_num_segments", value: "1", require: true }),
new ui.CheckField({ label: i18n.text("ForceMergeForm.ExpungeDeletes"), name: "only_expunge_deletes", value: false }),
new ui.CheckField({ label: i18n.text("ForceMergeForm.FlushAfter"), name: "flush", value: true })
]
});
var dialog = new ui.DialogPanel({
title: i18n.text("ForceMergeForm.ForceMergeIndex", index.name),
body: new ui.PanelForm({ fields: fields }),
onCommit: function( panel, args ) {
if(fields.validate()) {

this.cluster.post(encodeURIComponent( index.name ) + "/_forcemerge?"+jQuery.param(fields.getData()), null, function(r) {
alert(JSON.stringify(r));
});
dialog.close();
}
}.bind(this)
}).open();
},
_testAnalyser_handler: function(index) {
this.cluster.get(encodeURIComponent( index.name ) + "/_analyze?text=" + encodeURIComponent( prompt( i18n.text("IndexCommand.TextToAnalyze") ) ), function(r) {
alert(JSON.stringify(r, true, " "));
Expand Down Expand Up @@ -3251,7 +3273,7 @@
{ text: i18n.text("IndexActionsMenu.NewAlias"), onclick: function() { this._newAliasAction_handler(index); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Refresh"), onclick: function() { this._postIndexAction_handler("_refresh", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Flush"), onclick: function() { this._postIndexAction_handler("_flush", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Optimize"), onclick: function () { this._optimizeIndex_handler(index); }.bind(this) },
{ text: this.cluster.versionAtLeast("5.0.0.") ? i18n.text("IndexActionsMenu.ForceMerge") : i18n.text("IndexActionsMenu.Optimize"), onclick: this.cluster.versionAtLeast("5.0.0.") ? function () { this._forceMergeIndex_handler(index); }.bind(this) : function () { this._optimizeIndex_handler(index); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Snapshot"), disabled: closed, onclick: function() { this._postIndexAction_handler("_gateway/snapshot", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Analyser"), onclick: function() { this._testAnalyser_handler(index); }.bind(this) },
{ text: (index.state === "close") ? i18n.text("IndexActionsMenu.Open") : i18n.text("IndexActionsMenu.Close"), onclick: function() { this._postIndexAction_handler((index.state === "close") ? "_open" : "_close", index, true); }.bind(this) },
Expand Down Expand Up @@ -3751,6 +3773,8 @@
_node_handler: function(data) {
if(data) {
this.prefs.set("app-base_uri", this.cluster.base_uri);
if(data.version && data.version.number)
this.cluster.setVersion(data.version.number);
}
},

Expand Down
5 changes: 5 additions & 0 deletions _site/lang/en_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Refresh",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Test Analyser",
"IndexActionsMenu.Open": "Open",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Only Expunge Deletes",
"OptimizeForm.FlushAfter": "Flush After Optimize",
"OptimizeForm.WaitForMerge": "Wait For Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Maximum # Of Segments",
"ForceMergeForm.ExpungeDeletes": "Only Expunge Deletes",
"ForceMergeForm.FlushAfter": "Flush After ForceMerge",
"Overview.PageTitle" : "Cluster Overview",
"Output.JSON": "JSON",
"Output.Table": "Table",
Expand Down
5 changes: 5 additions & 0 deletions _site/lang/fr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Rafraîchir",
"IndexActionsMenu.Flush": "Flusher",
"IndexActionsMenu.Optimize": "Optimiser...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Dupliquer l'index (Snapshot)",
"IndexActionsMenu.Analyser": "Tester un analyseur",
"IndexActionsMenu.Open": "Ouvrir",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Seulement purger les suppressions",
"OptimizeForm.FlushAfter": "Flusher après l'optimisation",
"OptimizeForm.WaitForMerge": "Attendre la fin de la fusion",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Nombre maximum de segments",
"ForceMergeForm.ExpungeDeletes": "Seulement purger les suppressions",
"ForceMergeForm.FlushAfter": "Flusher après ForceMerge",
"Overview.PageTitle" : "Aperçu du cluster",
// "Output.JSON": "JSON",
"Output.Table": "Tableau",
Expand Down
6 changes: 6 additions & 0 deletions _site/lang/ja_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Refresh",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Analyserテスト",
// "IndexActionsMenu.Open": "Open",
Expand Down Expand Up @@ -88,6 +89,11 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Only Expunge Deletes",
"OptimizeForm.FlushAfter": "Flush After Optimize",
"OptimizeForm.WaitForMerge": "Wait For Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Maximum # Of Segments",
"ForceMergeForm.ExpungeDeletes": "Only Expunge Deletes",
"ForceMergeForm.FlushAfter": "Flush After ForceMerge",
"ForceMergeForm.WaitForMerge": "Wait For Merge",
"Overview.PageTitle" : "クラスタのOverview",
// "Output.JSON": "JSON",
"Output.Table": "表",
Expand Down
5 changes: 5 additions & 0 deletions _site/lang/pt_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Atualizar",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Otimizar...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Snapshot do Gateway",
"IndexActionsMenu.Analyser": "Analizador de teste",
"IndexActionsMenu.Open": "Abrir",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Apenas Expurgar Exclusões",
"OptimizeForm.FlushAfter": "Flush após Otimizar",
"OptimizeForm.WaitForMerge": "Esperar Por Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "# Máximo De Segmentos",
"ForceMergeForm.ExpungeDeletes": "Apenas Expurgar Exclusões",
"ForceMergeForm.FlushAfter": "Flush após ForceMerge",
"Overview.PageTitle": "Visão geral do Cluster",
"Output.JSON": "JSON",
"Output.Table": "Tabela",
Expand Down
6 changes: 6 additions & 0 deletions _site/lang/tr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Yenile",
"IndexActionsMenu.Flush": "Boşalt",
"IndexActionsMenu.Optimize": "Optimize et...",
"IndexActionsMenu.ForceMerge": "ForceMerge et...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot (Kopya Al)",
"IndexActionsMenu.Analyser": "Analizi test et",
"IndexActionsMenu.Open": "Aç",
Expand Down Expand Up @@ -88,6 +89,11 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"OptimizeForm.FlushAfter": "Optimize Ettikten Sonra Boşalt",
"OptimizeForm.WaitForMerge": "Birleştirme İçin Bekle",
"ForceMergeForm.ForceMergeIndex": "{0} ForceMerge Et",
"ForceMergeForm.MaxSegments": "Maksimum Segment Sayısı",
"ForceMergeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"ForceMergeForm.FlushAfter": "ForceMerge Ettikten Sonra Boşalt",
"ForceMergeForm.WaitForMerge": "Birleştirme İçin Bekle",
"Overview.PageTitle" : "Kümeler Genelbakış",
"Output.JSON": "JSON",
"Output.Table": "Tablo",
Expand Down
5 changes: 5 additions & 0 deletions _site/lang/zh_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "刷新",
"IndexActionsMenu.Flush": "Flush刷新",
"IndexActionsMenu.Optimize": "优化...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "网关快照",
"IndexActionsMenu.Analyser": "测试分析器",
"IndexActionsMenu.Open": "开启",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "只删除被标记为删除的",
"OptimizeForm.FlushAfter": "优化后刷新",
"OptimizeForm.WaitForMerge": "等待合并",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "最大索引段数",
"ForceMergeForm.ExpungeDeletes": "只删除被标记为删除的",
"ForceMergeForm.FlushAfter": "ForceMerge后刷新",
"Overview.PageTitle" : "集群概览",
"Output.JSON": "JSON",
"Output.Table": "Table",
Expand Down
5 changes: 5 additions & 0 deletions src/app/lang/en_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Refresh",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Test Analyser",
"IndexActionsMenu.Open": "Open",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Only Expunge Deletes",
"OptimizeForm.FlushAfter": "Flush After Optimize",
"OptimizeForm.WaitForMerge": "Wait For Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Maximum # Of Segments",
"ForceMergeForm.ExpungeDeletes": "Only Expunge Deletes",
"ForceMergeForm.FlushAfter": "Flush After ForceMerge",
"Overview.PageTitle" : "Cluster Overview",
"Output.JSON": "JSON",
"Output.Table": "Table",
Expand Down
5 changes: 5 additions & 0 deletions src/app/lang/fr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Rafraîchir",
"IndexActionsMenu.Flush": "Flusher",
"IndexActionsMenu.Optimize": "Optimiser...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Dupliquer l'index (Snapshot)",
"IndexActionsMenu.Analyser": "Tester un analyseur",
"IndexActionsMenu.Open": "Ouvrir",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Seulement purger les suppressions",
"OptimizeForm.FlushAfter": "Flusher après l'optimisation",
"OptimizeForm.WaitForMerge": "Attendre la fin de la fusion",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Nombre maximum de segments",
"ForceMergeForm.ExpungeDeletes": "Seulement purger les suppressions",
"ForceMergeForm.FlushAfter": "Flusher après ForceMerge",
"Overview.PageTitle" : "Aperçu du cluster",
// "Output.JSON": "JSON",
"Output.Table": "Tableau",
Expand Down
6 changes: 6 additions & 0 deletions src/app/lang/ja_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Refresh",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Optimize...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot",
"IndexActionsMenu.Analyser": "Analyserテスト",
// "IndexActionsMenu.Open": "Open",
Expand Down Expand Up @@ -88,6 +89,11 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Only Expunge Deletes",
"OptimizeForm.FlushAfter": "Flush After Optimize",
"OptimizeForm.WaitForMerge": "Wait For Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "Maximum # Of Segments",
"ForceMergeForm.ExpungeDeletes": "Only Expunge Deletes",
"ForceMergeForm.FlushAfter": "Flush After ForceMerge",
"ForceMergeForm.WaitForMerge": "Wait For Merge",
"Overview.PageTitle" : "クラスタのOverview",
// "Output.JSON": "JSON",
"Output.Table": "表",
Expand Down
5 changes: 5 additions & 0 deletions src/app/lang/pt_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Atualizar",
"IndexActionsMenu.Flush": "Flush",
"IndexActionsMenu.Optimize": "Otimizar...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "Snapshot do Gateway",
"IndexActionsMenu.Analyser": "Analizador de teste",
"IndexActionsMenu.Open": "Abrir",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Apenas Expurgar Exclusões",
"OptimizeForm.FlushAfter": "Flush após Otimizar",
"OptimizeForm.WaitForMerge": "Esperar Por Merge",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "# Máximo De Segmentos",
"ForceMergeForm.ExpungeDeletes": "Apenas Expurgar Exclusões",
"ForceMergeForm.FlushAfter": "Flush após ForceMerge",
"Overview.PageTitle": "Visão geral do Cluster",
"Output.JSON": "JSON",
"Output.Table": "Tabela",
Expand Down
6 changes: 6 additions & 0 deletions src/app/lang/tr_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "Yenile",
"IndexActionsMenu.Flush": "Boşalt",
"IndexActionsMenu.Optimize": "Optimize et...",
"IndexActionsMenu.ForceMerge": "ForceMerge et...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot (Kopya Al)",
"IndexActionsMenu.Analyser": "Analizi test et",
"IndexActionsMenu.Open": "Aç",
Expand Down Expand Up @@ -88,6 +89,11 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"OptimizeForm.FlushAfter": "Optimize Ettikten Sonra Boşalt",
"OptimizeForm.WaitForMerge": "Birleştirme İçin Bekle",
"ForceMergeForm.ForceMergeIndex": "{0} ForceMerge Et",
"ForceMergeForm.MaxSegments": "Maksimum Segment Sayısı",
"ForceMergeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"ForceMergeForm.FlushAfter": "ForceMerge Ettikten Sonra Boşalt",
"ForceMergeForm.WaitForMerge": "Birleştirme İçin Bekle",
"Overview.PageTitle" : "Kümeler Genelbakış",
"Output.JSON": "JSON",
"Output.Table": "Tablo",
Expand Down
5 changes: 5 additions & 0 deletions src/app/lang/zh_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ i18n.setKeys({
"IndexActionsMenu.Refresh": "刷新",
"IndexActionsMenu.Flush": "Flush刷新",
"IndexActionsMenu.Optimize": "优化...",
"IndexActionsMenu.ForceMerge": "ForceMerge...",
"IndexActionsMenu.Snapshot": "网关快照",
"IndexActionsMenu.Analyser": "测试分析器",
"IndexActionsMenu.Open": "开启",
Expand Down Expand Up @@ -88,6 +89,10 @@ i18n.setKeys({
"OptimizeForm.ExpungeDeletes": "只删除被标记为删除的",
"OptimizeForm.FlushAfter": "优化后刷新",
"OptimizeForm.WaitForMerge": "等待合并",
"ForceMergeForm.ForceMergeIndex": "ForceMerge {0}",
"ForceMergeForm.MaxSegments": "最大索引段数",
"ForceMergeForm.ExpungeDeletes": "只删除被标记为删除的",
"ForceMergeForm.FlushAfter": "ForceMerge后刷新",
"Overview.PageTitle" : "集群概览",
"Output.JSON": "JSON",
"Output.Table": "Table",
Expand Down
2 changes: 2 additions & 0 deletions src/app/ui/clusterConnect/clusterConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
_node_handler: function(data) {
if(data) {
this.prefs.set("app-base_uri", this.cluster.base_uri);
if(data.version && data.version.number)
this.cluster.setVersion(data.version.number);
}
},

Expand Down
24 changes: 23 additions & 1 deletion src/app/ui/nodesView/nodesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@
}.bind(this)
}).open();
},
_forceMergeIndex_handler: function(index) {
var fields = new app.ux.FieldCollection({
fields: [
new ui.TextField({ label: i18n.text("ForceMergeForm.MaxSegments"), name: "max_num_segments", value: "1", require: true }),
new ui.CheckField({ label: i18n.text("ForceMergeForm.ExpungeDeletes"), name: "only_expunge_deletes", value: false }),
new ui.CheckField({ label: i18n.text("ForceMergeForm.FlushAfter"), name: "flush", value: true })
]
});
var dialog = new ui.DialogPanel({
title: i18n.text("ForceMergeForm.ForceMergeIndex", index.name),
body: new ui.PanelForm({ fields: fields }),
onCommit: function( panel, args ) {
if(fields.validate()) {

this.cluster.post(encodeURIComponent( index.name ) + "/_forcemerge?"+jQuery.param(fields.getData()), null, function(r) {
alert(JSON.stringify(r));
});
dialog.close();
}
}.bind(this)
}).open();
},
_testAnalyser_handler: function(index) {
this.cluster.get(encodeURIComponent( index.name ) + "/_analyze?text=" + encodeURIComponent( prompt( i18n.text("IndexCommand.TextToAnalyze") ) ), function(r) {
alert(JSON.stringify(r, true, " "));
Expand Down Expand Up @@ -205,7 +227,7 @@
{ text: i18n.text("IndexActionsMenu.NewAlias"), onclick: function() { this._newAliasAction_handler(index); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Refresh"), onclick: function() { this._postIndexAction_handler("_refresh", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Flush"), onclick: function() { this._postIndexAction_handler("_flush", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Optimize"), onclick: function () { this._optimizeIndex_handler(index); }.bind(this) },
{ text: this.cluster.versionAtLeast("5.0.0.") ? i18n.text("IndexActionsMenu.ForceMerge") : i18n.text("IndexActionsMenu.Optimize"), onclick: this.cluster.versionAtLeast("5.0.0.") ? function () { this._forceMergeIndex_handler(index); }.bind(this) : function () { this._optimizeIndex_handler(index); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Snapshot"), disabled: closed, onclick: function() { this._postIndexAction_handler("_gateway/snapshot", index, false); }.bind(this) },
{ text: i18n.text("IndexActionsMenu.Analyser"), onclick: function() { this._testAnalyser_handler(index); }.bind(this) },
{ text: (index.state === "close") ? i18n.text("IndexActionsMenu.Open") : i18n.text("IndexActionsMenu.Close"), onclick: function() { this._postIndexAction_handler((index.state === "close") ? "_open" : "_close", index, true); }.bind(this) },
Expand Down

0 comments on commit bee0850

Please sign in to comment.