ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-9151 Web Console: Fixed logic of removing cluster items: caches, models, igfss.
Date Thu, 02 Aug 2018 10:20:21 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 5fc18e6f1 -> 1cdf7ef99


http://git-wip-us.apache.org/repos/asf/ignite/blob/1cdf7ef9/modules/web-console/frontend/app/services/Clusters.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/Clusters.js b/modules/web-console/frontend/app/services/Clusters.js
index d76f862..c33c145 100644
--- a/modules/web-console/frontend/app/services/Clusters.js
+++ b/modules/web-console/frontend/app/services/Clusters.js
@@ -57,7 +57,9 @@ export default class Clusters {
             messageQueueLimit = this.messageQueueLimit.default,
             ackSendThreshold = this.ackSendThreshold.default
         ) => {
-            if (currentValue === this.unacknowledgedMessagesBufferSize.default) return currentValue;
+            if (currentValue === this.unacknowledgedMessagesBufferSize.default)
+                return currentValue;
+
             const {validRatio} = this.unacknowledgedMessagesBufferSize;
             return Math.max(messageQueueLimit * validRatio, ackSendThreshold * validRatio);
         },
@@ -253,7 +255,9 @@ export default class Clusters {
         maxSize: {
             default: '0.2 * totalMemoryAvailable',
             min: (dataRegion) => {
-                if (!dataRegion) return;
+                if (!dataRegion)
+                    return;
+
                 return dataRegion.initialSize || this.dataRegion.initialSize.default;
             }
         },
@@ -267,11 +271,14 @@ export default class Clusters {
             default: 100,
             min: 11,
             max: (cluster, dataRegion) => {
-                if (!cluster || !dataRegion || !dataRegion.maxSize) return;
+                if (!cluster || !dataRegion || !dataRegion.maxSize)
+                    return;
+
                 const perThreadLimit = 10; // Took from Ignite
                 const maxSize = dataRegion.maxSize;
                 const pageSize = cluster.dataStorageConfiguration.pageSize || this.dataStorageConfiguration.pageSize.default;
                 const maxPoolSize = Math.floor(maxSize / pageSize / perThreadLimit);
+
                 return maxPoolSize;
             }
         },
@@ -293,7 +300,10 @@ export default class Clusters {
 
     addDataRegionConfiguration(cluster) {
         const dataRegionConfigurations = get(cluster, 'dataStorageConfiguration.dataRegionConfigurations');
-        if (!dataRegionConfigurations) return;
+
+        if (!dataRegionConfigurations)
+            return;
+
         return dataRegionConfigurations.push(Object.assign(this.makeBlankDataRegionConfiguration(),
{
             name: uniqueName('New data region', dataRegionConfigurations.concat(cluster.dataStorageConfiguration.defaultDataRegionConfiguration))
         }));
@@ -318,7 +328,10 @@ export default class Clusters {
             defaultMemoryPolicyExists: (name, items = []) => {
                 const def = this.memoryPolicy.name.default;
                 const normalizedName = (name || def);
-                if (normalizedName === def) return true;
+
+                if (normalizedName === def)
+                    return true;
+
                 return items.some((policy) => (policy.name || def) === normalizedName);
             },
             uniqueMemoryPolicyName: (a, items = []) => {
@@ -330,7 +343,9 @@ export default class Clusters {
             default: 100,
             min: 11,
             max: (cluster, memoryPolicy) => {
-                if (!memoryPolicy || !memoryPolicy.maxSize) return;
+                if (!memoryPolicy || !memoryPolicy.maxSize)
+                    return;
+
                 const perThreadLimit = 10; // Took from Ignite
                 const maxSize = memoryPolicy.maxSize;
                 const pageSize = cluster.memoryConfiguration.pageSize || this.memoryConfiguration.pageSize.default;
@@ -406,7 +421,10 @@ export default class Clusters {
 
     addMemoryPolicy(cluster) {
         const memoryPolicies = get(cluster, 'memoryConfiguration.memoryPolicies');
-        if (!memoryPolicies) return;
+
+        if (!memoryPolicies)
+            return;
+
         return memoryPolicies.push(Object.assign(this.makeBlankMemoryPolicy(), {
             // Blank name for default policy if there are not other policies
             name: memoryPolicies.length ? uniqueName('New memory policy', memoryPolicies)
: ''

http://git-wip-us.apache.org/repos/asf/ignite/blob/1cdf7ef9/modules/web-console/frontend/app/services/FormUtils.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/FormUtils.service.js b/modules/web-console/frontend/app/services/FormUtils.service.js
index da6b417..2c81c57 100644
--- a/modules/web-console/frontend/app/services/FormUtils.service.js
+++ b/modules/web-console/frontend/app/services/FormUtils.service.js
@@ -329,12 +329,19 @@ export default ['IgniteFormUtils', ['$window', 'IgniteFocus', '$rootScope',
($wi
     function triggerValidation(form) {
         const fe = (m) => Object.keys(m.$error)[0];
         const em = (e) => (m) => {
-            if (!e) return;
+            if (!e)
+                return;
+
             const walk = (m) => {
-                if (!m.$error[e]) return;
-                if (m.$error[e] === true) return m;
+                if (!m.$error[e])
+                    return;
+
+                if (m.$error[e] === true)
+                    return m;
+
                 return walk(m.$error[e][0]);
             };
+
             return walk(m);
         };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1cdf7ef9/modules/web-console/frontend/app/services/IGFSs.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/IGFSs.js b/modules/web-console/frontend/app/services/IGFSs.js
index 87dfd17..de9e43d 100644
--- a/modules/web-console/frontend/app/services/IGFSs.js
+++ b/modules/web-console/frontend/app/services/IGFSs.js
@@ -64,11 +64,15 @@ export default class IGFSs {
 
     secondaryFileSystemEnabled = {
         requiredWhenIGFSProxyMode: (igfs) => {
-            if (get(igfs, 'defaultMode') === 'PROXY') return get(igfs, 'secondaryFileSystemEnabled')
=== true;
+            if (get(igfs, 'defaultMode') === 'PROXY')
+                return get(igfs, 'secondaryFileSystemEnabled') === true;
+
             return true;
         },
         requiredWhenPathModeProxyMode: (igfs) => {
-            if (get(igfs, 'pathModes', []).some((pm) => pm.mode === 'PROXY')) return get(igfs,
'secondaryFileSystemEnabled') === true;
+            if (get(igfs, 'pathModes', []).some((pm) => pm.mode === 'PROXY'))
+                return get(igfs, 'secondaryFileSystemEnabled') === true;
+
             return true;
         }
     };

http://git-wip-us.apache.org/repos/asf/ignite/blob/1cdf7ef9/modules/web-console/frontend/app/services/Models.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/Models.js b/modules/web-console/frontend/app/services/Models.js
index 3b714c4..4b360be 100644
--- a/modules/web-console/frontend/app/services/Models.js
+++ b/modules/web-console/frontend/app/services/Models.js
@@ -85,14 +85,19 @@ export default class Models {
      * @param {ig.config.model.DomainModel} model
      */
     addIndex(model) {
-        if (!model) return;
-        if (!model.indexes) model.indexes = [];
+        if (!model)
+            return;
+
+        if (!model.indexes)
+            model.indexes = [];
+
         model.indexes.push({
             _id: ObjectID.generate(),
             name: '',
             indexType: 'SORTED',
             fields: []
         });
+
         return model.indexes[model.indexes.length - 1];
     }
 
@@ -142,7 +147,9 @@ export default class Models {
          */
         indexFieldsHaveUniqueNames: ($value = []) => {
             return $value.every((index) => {
-                if (!index.fields) return true;
+                if (!index.fields)
+                    return true;
+
                 const uniqueNames = new Set(index.fields.map((ec) => ec.name));
                 return uniqueNames.size === index.fields.length;
             });
@@ -156,7 +163,9 @@ export default class Models {
      * @returns {ig.config.model.DomainModel}
      */
     removeInvalidFields(model) {
-        if (!model) return model;
+        if (!model)
+            return model;
+
         const fieldNames = new Set((model.fields || []).map((f) => f.name));
         return {
             ...model,

http://git-wip-us.apache.org/repos/asf/ignite/blob/1cdf7ef9/modules/web-console/frontend/app/services/exceptionHandler.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/exceptionHandler.js b/modules/web-console/frontend/app/services/exceptionHandler.js
index 0d9cf3d..82a88e1 100644
--- a/modules/web-console/frontend/app/services/exceptionHandler.js
+++ b/modules/web-console/frontend/app/services/exceptionHandler.js
@@ -19,7 +19,9 @@ import {CancellationError} from 'app/errors/CancellationError';
 
 export function $exceptionHandler($log) {
     return function(exception, cause) {
-        if (exception instanceof CancellationError) return;
+        if (exception instanceof CancellationError)
+            return;
+
         $log.error(exception, cause);
     };
 }


Mime
View raw message