You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sh...@apache.org on 2016/11/07 04:30:22 UTC

[35/50] [abbrv] ignite git commit: IGNITE-3841 Web console added check for eviction policy max mem and max size consistency. Fixes #1136.

IGNITE-3841 Web console added check for eviction policy max mem and max size consistency. Fixes #1136.


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

Branch: refs/heads/ignite-2788
Commit: bfdb5c3b374fd3512481cf16779d227d7f96e569
Parents: 02f48d7
Author: Saikat Maitra <sa...@gmail.com>
Authored: Tue Oct 4 16:40:35 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Oct 4 16:40:35 2016 +0700

----------------------------------------------------------------------
 .../frontend/controllers/caches-controller.js         | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bfdb5c3b/modules/web-console/frontend/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/controllers/caches-controller.js b/modules/web-console/frontend/controllers/caches-controller.js
index 9873051..8c32906 100644
--- a/modules/web-console/frontend/controllers/caches-controller.js
+++ b/modules/web-console/frontend/controllers/caches-controller.js
@@ -292,6 +292,17 @@ export default ['cachesController', [
             return true;
         }
 
+        function checkEvictionPolicy(evictionPlc) {
+            if (evictionPlc && evictionPlc.kind) {
+                const plc = evictionPlc[evictionPlc.kind];
+
+                if (plc.maxMemorySize === 0 && plc.maxSize === 0)
+                    return ErrorPopover.show('evictionPolicymaxMemorySizeInput', 'Either maximum memory size or maximum size should be great than 0!', $scope.ui, 'memory');
+            }
+
+            return true;
+        }
+
         function checkSQLSchemas() {
             const clusters = cacheClusters();
 
@@ -367,6 +378,9 @@ export default ['cachesController', [
             if (item.memoryMode === 'OFFHEAP_TIERED' && item.offHeapMaxMemory === -1)
                 return ErrorPopover.show('offHeapModeInput', 'Invalid value!', $scope.ui, 'memory');
 
+            if (!checkEvictionPolicy(item.evictionPolicy))
+                return false;
+
             if (!checkSQLSchemas())
                 return false;