You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/08/18 10:15:24 UTC

[1/2] incubator-ignite git commit: IGNITE-843: Fixed special cases of linking clusters an caches.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 e828e466c -> dc2cee3d7


IGNITE-843: Fixed special cases of linking clusters an caches.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a3d2f826
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a3d2f826
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a3d2f826

Branch: refs/heads/ignite-843
Commit: a3d2f826f650ad59cdbf0acbccb1ce7283e3797e
Parents: e828e46
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Aug 18 15:15:04 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Aug 18 15:15:04 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    | 39 +++++++++++---------
 .../main/js/controllers/clusters-controller.js  | 33 ++++++++++-------
 .../src/main/js/routes/caches.js                | 11 +++++-
 3 files changed, 52 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3d2f826/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index 6cd0727..604a39e 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -220,8 +220,7 @@ controlCenterModule.controller('cachesController', [
                                     });
                                 }
 
-                                $scope.selectedItem = cache;
-                                $scope.backupItem = restoredItem;
+                                $scope.selectItem(cache, restoredItem);
                             }
                             else
                                 sessionStorage.removeItem('cacheBackupItem');
@@ -241,13 +240,22 @@ controlCenterModule.controller('cachesController', [
                     $common.showError(errMsg);
                 });
 
-            $scope.selectItem = function (item) {
+            $scope.selectItem = function (item, backup) {
                 $table.tableReset();
 
                 $scope.selectedItem = item;
-                $scope.backupItem = angular.copy(item);
 
-                sessionStorage.cacheSelectedItem = angular.toJson(item);
+                if (backup)
+                    $scope.backupItem = backup;
+                else if (item)
+                    $scope.backupItem = angular.copy(item);
+                else
+                    $scope.backupItem = undefined;
+
+                if (item)
+                    sessionStorage.cacheSelectedItem = angular.toJson(item);
+                else
+                    sessionStorage.removeItem(cacheSelectedItem);
             };
 
             // Add new cache.
@@ -255,19 +263,18 @@ controlCenterModule.controller('cachesController', [
                 $table.tableReset();
                 $common.ensureActivePanel($scope.panels, 'general-data');
 
-                $scope.selectedItem = undefined;
-
-                $scope.backupItem = {
+                var newItem = {
+                    space: $scope.spaces[0]._id,
                     mode: 'PARTITIONED',
                     atomicityMode: 'ATOMIC',
                     readFromBackup: true,
-                    copyOnRead: true
+                    copyOnRead: true,
+                    clusters: [],
+                    queryMetadata: [],
+                    spaceMetadata: []
                 };
 
-                $scope.backupItem.space = $scope.spaces[0]._id;
-                $scope.backupItem.clusters = [];
-                $scope.backupItem.queryMetadata = [];
-                $scope.backupItem.spaceMetadata = [];
+                $scope.selectItem(undefined, newItem);
             };
 
             // Check cache logical consistency.
@@ -370,10 +377,8 @@ controlCenterModule.controller('cachesController', [
 
                                     if (caches.length > 0)
                                         $scope.selectItem(caches[0]);
-                                    else {
-                                        $scope.selectedItem = undefined;
-                                        $scope.backupItem = undefined;
-                                    }
+                                    else
+                                        $scope.selectItem(undefined, undefined);
                                 }
                             })
                             .error(function (errMsg) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3d2f826/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index ef4bff5..9b47cd3 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -194,8 +194,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$http', '$commo
                                 });
                             }
 
-                            $scope.selectedItem = cluster;
-                            $scope.backupItem = restoredItem;
+                            $scope.selectItem(cluster, restoredItem);
                         }
                         else
                             sessionStorage.removeItem('clusterBackupItem');
@@ -215,13 +214,23 @@ controlCenterModule.controller('clustersController', ['$scope', '$http', '$commo
                 $common.showError(errMsg);
             });
 
-        $scope.selectItem = function (item) {
+        $scope.selectItem = function (item, backup) {
             $table.tableReset();
 
             $scope.selectedItem = item;
-            $scope.backupItem = angular.copy(item);
 
-            sessionStorage.clusterSelectedItem = angular.toJson(item);
+            if (backup)
+                $scope.backupItem = backup;
+            else if (item)
+                $scope.backupItem = angular.copy(item);
+            else
+                $scope.backupItem = undefined;
+
+
+            if (item)
+                sessionStorage.clusterSelectedItem = angular.toJson(item);
+            else
+                sessionStorage.removeItem('clusterSelectedItem');
         };
 
         // Add new cluster.
@@ -229,11 +238,11 @@ controlCenterModule.controller('clustersController', ['$scope', '$http', '$commo
             $table.tableReset();
             $common.ensureActivePanel($scope.panels, "general-data");
 
-            $scope.selectedItem = undefined;
+            var newItem = angular.copy($scope.template);
+            newItem.caches = [];
+            newItem.space = $scope.spaces[0]._id;
 
-            $scope.backupItem = angular.copy($scope.template);
-            $scope.backupItem.caches = [];
-            $scope.backupItem.space = $scope.spaces[0]._id;
+            $scope.selectItem(undefined, newItem);
         };
 
         $scope.indexOfCache = function (cacheId) {
@@ -370,10 +379,8 @@ controlCenterModule.controller('clustersController', ['$scope', '$http', '$commo
 
                                 if (clusters.length > 0)
                                     $scope.selectItem(clusters[0]);
-                                else {
-                                    $scope.selectedItem = undefined;
-                                    $scope.backupItem = undefined;
-                                }
+                                else
+                                    $scope.selectItem(undefined, undefined);
                             }
                         })
                         .error(function (errMsg) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3d2f826/modules/control-center-web/src/main/js/routes/caches.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/caches.js b/modules/control-center-web/src/main/js/routes/caches.js
index a1fea66..9f3e255 100644
--- a/modules/control-center-web/src/main/js/routes/caches.js
+++ b/modules/control-center-web/src/main/js/routes/caches.js
@@ -59,14 +59,23 @@ router.post('/list', function (req, res) {
                             // Get all caches for spaces.
                             db.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err, caches) {
                                 if (_processed(err, res)) {
-                                    // Remove deleted metadata.
+
                                     _.forEach(caches, function (cache) {
+                                        // Remove deleted clusters.
+                                        cache.clusters = _.filter(cache.clusters, function (clusterId) {
+                                            return _.findIndex(clusters, function (cluster) {
+                                                    return cluster._id.equals(clusterId);
+                                                }) >= 0;
+                                        });
+
+                                        // Remove deleted metadata.
                                         cache.queryMetadata = _.filter(cache.queryMetadata, function (metaId) {
                                             return _.findIndex(metadatas, function (meta) {
                                                     return meta._id.equals(metaId);
                                                 }) >= 0;
                                         });
 
+                                        // Remove deleted metadata.
                                         cache.storeMetadata = _.filter(cache.storeMetadata, function (metaId) {
                                             return _.findIndex(metadatas, function (meta) {
                                                     return meta._id.equals(metaId);


[2/2] incubator-ignite git commit: IGNITE-843: Move write behind to sub group of Store group.

Posted by ak...@apache.org.
IGNITE-843: Move write behind to sub group of Store group.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dc2cee3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dc2cee3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dc2cee3d

Branch: refs/heads/ignite-843
Commit: dc2cee3d7141e2b3843b39db4bad11a6cf73cee2
Parents: a3d2f82
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Aug 18 15:15:40 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Aug 18 15:15:40 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/models/caches.json  | 119 ++++++++++---------
 .../src/main/js/views/includes/controls.jade    |  20 +++-
 2 files changed, 75 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc2cee3d/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index c0bff96..b34dcea 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -599,6 +599,66 @@
           "tip": [
             "Flag indicating whether write-through caching should be used."
           ]
+        },
+        {
+          "label": "Write behind",
+          "type": "panel-details",
+          "tip": [
+            "Cache write behind settings.",
+            "Write-behind is a special mode when updates to cache accumulated and then asynchronously flushed to persistent store as a bulk operation."
+          ],
+          "details": [
+            {
+              "label": "Enabled",
+              "type": "check",
+              "model": "writeBehindEnabled",
+              "tip": [
+                "Flag indicating whether Ignite should use write-behind behaviour for the cache store."
+              ]
+            },
+            {
+              "label": "Batch size",
+              "type": "number",
+              "model": "writeBehindBatchSize",
+              "disabled": "!backupItem.writeBehindEnabled",
+              "placeholder": 512,
+              "tip": [
+                "Maximum batch size for write-behind cache store operations.",
+                "Store operations (get or remove) are combined in a batch of this size to be passed to cache store."
+              ]
+            },
+            {
+              "label": "Flush size",
+              "type": "number",
+              "model": "writeBehindFlushSize",
+              "disabled": "!backupItem.writeBehindEnabled",
+              "placeholder": 10240,
+              "tip": [
+                "Maximum size of the write-behind cache.<br>",
+                "If cache size exceeds this value, all cached items are flushed to the cache store and write cache is cleared."
+              ]
+            },
+            {
+              "label": "Flush frequency",
+              "type": "number",
+              "model": "writeBehindFlushFrequency",
+              "disabled": "!backupItem.writeBehindEnabled",
+              "placeholder": 5000,
+              "tip": [
+                "Frequency with which write-behind cache is flushed to the cache store in milliseconds."
+              ]
+            },
+            {
+              "label": "Flush threads count",
+              "type": "number",
+              "model": "writeBehindFlushThreadCount",
+              "disabled": "!backupItem.writeBehindEnabled",
+              "placeholder": 1,
+              "tip": [
+                "Number of threads that will perform cache flushing."
+              ]
+            }
+          ]
         }
       ]
     }
@@ -915,65 +975,6 @@
           ]
         }
       ]
-    },
-    {
-      "label": "Write behind",
-      "tip": [
-        "Cache write behind settings.",
-        "Write-behind is a special mode when updates to cache accumulated and then asynchronously flushed to persistent store as a bulk operation."
-      ],
-      "fields": [
-        {
-          "label": "Enabled",
-          "type": "check",
-          "model": "writeBehindEnabled",
-          "tip": [
-            "Flag indicating whether Ignite should use write-behind behaviour for the cache store."
-          ]
-        },
-        {
-          "label": "Batch size",
-          "type": "number",
-          "model": "writeBehindBatchSize",
-          "hide": "!backupItem.writeBehindEnabled",
-          "placeholder": 512,
-          "tip": [
-            "Maximum batch size for write-behind cache store operations.",
-            "Store operations (get or remove) are combined in a batch of this size to be passed to cache store."
-          ]
-        },
-        {
-          "label": "Flush size",
-          "type": "number",
-          "model": "writeBehindFlushSize",
-          "hide": "!backupItem.writeBehindEnabled",
-          "placeholder": 10240,
-          "tip": [
-            "Maximum size of the write-behind cache.<br>",
-            "If cache size exceeds this value, all cached items are flushed to the cache store and write cache is cleared."
-          ]
-        },
-        {
-          "label": "Flush frequency",
-          "type": "number",
-          "model": "writeBehindFlushFrequency",
-          "hide": "!backupItem.writeBehindEnabled",
-          "placeholder": 5000,
-          "tip": [
-            "Frequency with which write-behind cache is flushed to the cache store in milliseconds."
-          ]
-        },
-        {
-          "label": "Flush threads count",
-          "type": "number",
-          "model": "writeBehindFlushThreadCount",
-          "hide": "!backupItem.writeBehindEnabled",
-          "placeholder": 1,
-          "tip": [
-            "Number of threads that will perform cache flushing."
-          ]
-        }
-      ]
     }
   ]
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc2cee3d/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index 0a47b90..4308eea 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -113,6 +113,7 @@ mixin details-row
 
     - var detailMdl = 'getModel(backupItem, detail)[detail.model]';
     - var detailCommon = {'ng-model': detailMdl, 'ng-required': 'detail.required'};
+    - var detailDisabled = '{{detail.disable}}'
 
     - var customValidators = {'ng-attr-ipaddress': '{{detail.ipaddress}}'}
 
@@ -135,7 +136,7 @@ mixin details-row
             .col-sm-8
                 +tipField('detail.tip')
                 .input-tip
-                    input.form-control(name='{{detail.model}}' type='number' placeholder='{{::detail.placeholder}}' min='{{detail.min ? detail.min : 0}}' max='{{detail.max ? detail.max : Number.MAX_VALUE}}')&attributes(detailCommon)
+                    input.form-control(name='{{detail.model}}' type='number' ng-disabled=detailDisabled placeholder='{{::detail.placeholder}}' min='{{detail.min ? detail.min : 0}}' max='{{detail.max ? detail.max : Number.MAX_VALUE}}')&attributes(detailCommon)
                     +ico-exclamation('{{detail.model}}', 'min', 'Value is less than allowable minimum.')
                     +ico-exclamation('{{detail.model}}', 'max', 'Value is more than allowable maximum.')
                     +ico-exclamation('{{detail.model}}', 'number', 'Invalid value. Only numbers allowed.')
@@ -253,13 +254,14 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
     - var fieldCommon = {'ng-model': fieldMdl, 'ng-required': 'field.required || required(field)'};
     - var fieldRequiredClass = '{true: "required"}[field.required || required(field)]'
     - var fieldHide = '{{field.hide}}'
+    - var fieldDisabled = '{{field.disabled}}'
 
     div(ng-switch='field.type')
         div(ng-switch-when='label')
             label {{::field.label}}
         div.checkbox(ng-switch-when='check' ng-hide=fieldHide)
             label(id = '{{::field.id}}')
-                input(type='checkbox')&attributes(fieldCommon)
+                input(type='checkbox' ng-disabled=fieldDisabled)&attributes(fieldCommon)
                 | {{::field.label}}
                 +tipLabel('field.tip')
         div(ng-switch-when='text' ng-hide=fieldHide)
@@ -285,7 +287,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
             div(class=fieldClasses)
                 +tipField('field.tip')
                 .input-tip
-                    input.form-control(name='{{field.model}}' type='number' placeholder='{{::field.placeholder}}' ng-focus='tableReset()' min='{{field.min ? field.min : 0}}' max='{{field.max ? field.max : Number.MAX_VALUE}}')&attributes(fieldCommon)
+                    input.form-control(name='{{field.model}}' type='number' ng-disabled=fieldDisabled placeholder='{{::field.placeholder}}' ng-focus='tableReset()' min='{{field.min ? field.min : 0}}' max='{{field.max ? field.max : Number.MAX_VALUE}}')&attributes(fieldCommon)
                     +ico-exclamation('{{field.model}}', 'min', 'Value is less than allowable minimum.')
                     +ico-exclamation('{{field.model}}', 'max', 'Value is more than allowable maximum.')
                     +ico-exclamation('{{field.model}}', 'number', 'Invalid value. Only numbers allowed.')
@@ -294,7 +296,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
             div(class=fieldClasses)
                 +tipField('field.tip')
                 .input-tip
-                    button.form-control(bs-select data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}' tabindex='0')&attributes(fieldCommon)
+                    button.form-control(bs-select ng-disabled=fieldDisabled data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}' tabindex='0')&attributes(fieldCommon)
         div(ng-switch-when='dropdown-multiple' ng-hide=fieldHide)
             label(class=lblClasses ng-class=fieldRequiredClass) {{::field.label}}:
             div(class=fieldClasses)
@@ -309,11 +311,19 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
             div(class=fieldClasses id='{{::field.id}}')
                 +tipField('field.tip')
                 .input-tip
-                    button.form-control(bs-select data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}' tabindex='0')&attributes(fieldCommon)
+                    button.form-control(bs-select ng-disabled=fieldDisabled data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}' tabindex='0')&attributes(fieldCommon)
             a.customize(ng-show='#{fieldMdl} && field.settings' ng-click='#{expanded} = !#{expanded}') {{#{expanded} ? "Hide settings" : "Show settings"}}
             .col-sm-7.panel-details(ng-show='(#{expanded} || !field.settings) && #{fieldMdl}')
                 .details-row(ng-repeat='detail in field.details[#{fieldMdl}].fields')
                     +details-row
+        .section(ng-switch-when='panel-details' ng-hide=fieldHide)&attributes(fieldCommon)
+            .col-sm-7.group
+                .group-legend
+                    label {{::field.label}}:
+                    +group-tip('field.tip')
+                .group-content
+                    .details-row(ng-repeat='detail in field.details')
+                        +details-row
         .group-section(ng-switch-when='table-simple' ng-hide=fieldHide)&attributes(fieldCommon)
             .col-sm-7.group
                 .group-legend