This is an automated email from the ASF dual-hosted git repository. akuznetsov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push: new 83c3703 IGNITE-11361 Web console: Actualized cluster configuration. 83c3703 is described below commit 83c3703e00847eb2f52c05fe575c591af9bdbf0e Author: Vasiliy Sisko <vsi...@gridgain.com> AuthorDate: Fri Apr 5 20:31:15 2019 +0700 IGNITE-11361 Web console: Actualized cluster configuration. --- modules/web-console/backend/app/schemas.js | 14 +- .../cluster-edit-form/templates/communication.pug | 17 +++ .../cluster-edit-form/templates/data-storage.pug | 13 +- .../cluster-edit-form/templates/misc.pug | 167 ++++++++++++++++++--- .../generator/generator/AbstractTransformer.js | 4 +- .../generator/generator/ConfigurationGenerator.js | 51 ++++++- .../generator/defaults/Cluster.service.js | 7 +- .../app/configuration/services/Clusters.ts | 10 +- .../WebConsoleConfigurationSelfTest.java | 21 +++ 9 files changed, 270 insertions(+), 34 deletions(-) diff --git a/modules/web-console/backend/app/schemas.js b/modules/web-console/backend/app/schemas.js index 50b97f3..3e62a3d 100644 --- a/modules/web-console/backend/app/schemas.js +++ b/modules/web-console/backend/app/schemas.js @@ -1085,6 +1085,7 @@ module.exports.factory = function(mongoose) { clientFailureDetectionTimeout: Number, systemWorkerBlockedTimeout: Number, workDirectory: String, + igniteHome: String, lateAffinityAssignment: Boolean, utilityCacheKeepAliveTime: Number, asyncCallbackPoolSize: Number, @@ -1214,7 +1215,18 @@ module.exports.factory = function(mongoose) { walAutoArchiveAfterInactivity: Number }, mvccVacuumThreadCount: Number, - mvccVacuumFrequency: Number + mvccVacuumFrequency: Number, + authenticationEnabled: Boolean, + sqlQueryHistorySize: Number, + lifecycleBeans: [String], + addressResolver: String, + mBeanServer: String, + networkCompressionLevel: Number, + includeProperties: [String], + cacheStoreSessionListenerFactories: [String], + autoActivationEnabled: {type: Boolean, default: true}, + sqlSchemas: [String], + communicationFailureResolver: String }); Cluster.index({name: 1, space: 1}, {unique: true}); diff --git a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug index 0f7ce23..41ef206 100644 --- a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug +++ b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug @@ -56,6 +56,16 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) min: '1', tip: 'Message send retries count' }) + .pc-form-grid-col-30(ng-if='$ctrl.available("2.8.0")') + +form-field__number({ + label: 'Compression level:', + model: `${model}.networkCompressionLevel`, + name: '"networkCompressionLevel"', + placeholder: '1', + min: '0', + max: '9', + tip: 'Compression level of internal network messages' + }) .pc-form-grid-col-30(ng-if='$ctrl.available(["1.0.0", "2.3.0"])') +form-field__number({ label: 'Discovery startup delay:', @@ -65,6 +75,13 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) min: '1', tip: 'This value is used to expire messages from waiting list whenever node discovery discrepancies happen' }) + .pc-form-grid-col-60(ng-if='$ctrl.available("2.5.0")') + +form-field__java-class({ + label: 'Failure resolver:', + model: `${model}.communicationFailureResolver`, + name: '"communicationFailureResolver"', + tip: 'Communication failure resovler' + }) .pc-form-grid-col-60 +form-field__java-class({ label: 'Communication listener:', diff --git a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug index caab4ea..a3ec375 100644 --- a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug +++ b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug @@ -18,7 +18,8 @@ include /app/helpers/jade/mixins include /app/configuration/mixins -var form = 'dataStorageConfiguration' --var model = '$ctrl.clonedCluster.dataStorageConfiguration' +-var clusterModel = '$ctrl.clonedCluster' +-var model = clusterModel + '.dataStorageConfiguration' -var dfltRegionModel = model + '.defaultDataRegionConfiguration' -var dataRegionConfigurations = model + '.dataRegionConfigurations' @@ -501,6 +502,14 @@ panel-collapsible(ng-show='$ctrl.available("2.3.0")' ng-form=form on-open=`ui.lo name: '"DataStorageWalCompactionEnabled"', tip: 'If true, system filters and compresses WAL archive in background' }) + .pc-form-grid-col-60(ng-if='$ctrl.available("2.5.0")') + +form-field__checkbox({ + label: 'Authentication enabled', + model: `${clusterModel}.authenticationEnabled`, + name: '"authenticationEnabled"', + disabled: `!$ctrl.Clusters.persistenceEnabled(${model})`, + tip: 'Enable user authentication for cluster with persistence' + }) .pca-form-column-6 - +preview-xml-java(model, 'clusterDataStorageConfiguration') + +preview-xml-java(clusterModel, 'clusterDataStorageConfiguration') diff --git a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug index 9494e0d..bda42eb 100644 --- a/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug +++ b/modules/web-console/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug @@ -35,7 +35,106 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) If not provided, the method will use work directory under IGNITE_HOME specified by IgniteConfiguration#setIgniteHome(String)\ or IGNITE_HOME environment variable or system property.' }) + .pc-form-grid-col-60 + +form-field__text({ + label: 'Ignite home:', + model: `${model}.igniteHome`, + name: '"igniteHome"', + placeholder: 'Input ignite home directory', + tip: 'Ignite installation folder' + }) + .pc-form-grid-col-60 + mixin life-cycle-beans() + .ignite-form-field + -let items = `${model}.lifecycleBeans`; + + list-editable( + ng-model=items + list-editable-cols=`::[{ + name: 'Lifecycle beans:', + tip: 'Collection of life-cycle beans.\ + These beans will be automatically notified of grid life-cycle events' + }]` + ) + list-editable-item-view {{ $item }} + + list-editable-item-edit + +list-java-class-field('Bean', '$item', '"bean"', items) + +form-field__error({ + error: 'igniteUnique', + message: 'Bin with such class name already configured!' + }) + + list-editable-no-items + list-editable-add-item-button( + add-item=`$editLast((${items} = ${items} || []).push(""))` + label-single='Bean' + label-multiple='Beans' + ) + - var form = '$parent.form' + +life-cycle-beans + - var form = 'misc' + .pc-form-grid-col-60 + +form-field__java-class({ + label: 'Address resolver:', + model: `${model}.addressResolver`, + name: '"discoAddressResolver"', + tip: 'Address resolver for addresses mapping determination' + }) + .pc-form-grid-col-60 + +form-field__java-class({ + label: 'MBean server:', + model: `${model}.mBeanServer`, + name: '"mBeanServer"', + tip: 'MBean server' + }) + .pc-form-grid-col-60 + .ignite-form-field + +list-text-field({ + items: `${model}.includeProperties`, + lbl: 'Include properties', + name: 'includeProperties', + itemName: 'property', + itemsName: 'properties' + })( + list-editable-cols=`::[{ + name: 'Include properties:', + tip: 'System or environment property names to include into node attributes' + }]` + ) + +form-field__error({error: 'igniteUnique', message: 'Such property already exists!'}) + .pc-form-grid-col-60 + mixin store-session-listener-factories() + .ignite-form-field + -let items = `${model}.cacheStoreSessionListenerFactories`; + + list-editable( + ng-model=items + list-editable-cols=`::[{ + name: 'Store session listener factories:', + tip: 'Default store session listener factories for all caches' + }]` + ) + list-editable-item-view {{ $item }} + + list-editable-item-edit + +list-java-class-field('Listener', '$item', '"Listener"', items) + +form-field__error({ + error: 'igniteUnique', + message: 'Listener with such class name already exists!' + }) + + list-editable-no-items + list-editable-add-item-button( + add-item=`$editLast((${items} = ${items} || []).push(""))` + label-single='listener' + label-multiple='listeners' + ) + + - var form = '$parent.form' + +store-session-listener-factories + - var form = 'misc' //- Since ignite 2.0 .pc-form-grid-col-60(ng-if-start='$ctrl.available("2.0.0")') +form-field__text({ @@ -45,15 +144,49 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) placeholder: 'Input consistent ID', tip: 'Consistent globally unique node ID which survives node restarts' }) - .pc-form-grid-col-60 + .pc-form-grid-col-60(ng-if-end) +form-field__java-class({ label: 'Warmup closure:', model: `${model}.warmupClosure`, name: '"warmupClosure"', tip: 'This closure will be executed before actual grid instance start' }) - - .pc-form-grid-col-60 + .pc-form-grid-col-60(ng-if='$ctrl.available("2.1.0")') + +form-field__number({ + label: 'Long query timeout:', + model: `${model}.longQueryWarningTimeout`, + name: '"LongQueryWarningTimeout"', + placeholder: '3000', + min: '0', + tip: 'Timeout in milliseconds after which long query warning will be printed' + }) + .pc-form-grid-col-60(ng-if='$ctrl.available("2.7.0")') + .ignite-form-field + +list-text-field({ + items: `${model}.sqlSchemas`, + lbl: 'SQL schemas', + name: 'sqlSchemas', + itemName: 'schema', + itemsName: 'schemas' + })( + list-editable-cols=`::[{ + name: 'SQL schemas:', + tip: 'SQL schemas to be created on node startup.<br/> + Schemas are created on local node only and are not propagated to other cluster nodes.<br/> + Created schemas cannot be dropped.' + }]` + ) + +form-field__error({error: 'igniteUnique', message: 'Such property already exists!'}) + .pc-form-grid-col-60(ng-if='$ctrl.available("2.8.0")') + +form-field__number({ + label: 'SQL query history size:', + model: `${model}.sqlQueryHistorySize`, + name: '"sqlQueryHistorySize"', + placeholder: '1000', + min: '0', + tip: 'Number of SQL query history elements to keep in memory.' + }) + .pc-form-grid-col-60(ng-if-start='$ctrl.available("2.0.0")') +form-field__checkbox({ label: 'Active on start', model: model + '.activeOnStart', @@ -66,13 +199,19 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) model: model + '.cacheSanityCheckEnabled', name: '"cacheSanityCheckEnabled"', tip: 'If enabled, then Ignite will perform the following checks and throw an exception if check fails<br/>\ - <ul>\ - <li>Cache entry is not externally locked with lock or lockAsync methods when entry is enlisted to transaction</li>\ - <li>Each entry in affinity group - lock transaction has the same affinity key as was specified on affinity transaction start</li>\ - <li>Each entry in partition group - lock transaction belongs to the same partition as was specified on partition transaction start</li>\ - </ul>' + <ul>\ + <li>Cache entry is not externally locked with lock or lockAsync methods when entry is enlisted to transaction</li>\ + <li>Each entry in affinity group - lock transaction has the same affinity key as was specified on affinity transaction start</li>\ + <li>Each entry in partition group - lock transaction belongs to the same partition as was specified on partition transaction start</li>\ + </ul>' + }) + .pc-form-grid-col-60(ng-if='$ctrl.available("2.4.0")') + +form-field__checkbox({ + label: 'Auto activation enabled', + model: model + '.autoActivationEnabled', + name: '"autoActivationEnabled"', + tip: 'Cluster is enabled to activate automatically when all nodes from the BaselineTopology join the cluster' }) - .pc-form-grid-col-60(ng-if='$ctrl.available(["1.0.0", "2.1.0"])') +form-field__checkbox({ label: 'Late affinity assignment', @@ -80,15 +219,5 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) name: '"lateAffinityAssignment"', tip: 'With late affinity assignment mode if primary node was changed for some partition this nodes becomes primary only when rebalancing for all assigned primary partitions is finished' }) - - .pc-form-grid-col-60(ng-if='$ctrl.available("2.1.0")') - +form-field__number({ - label: 'Long query timeout:', - model: `${model}.longQueryWarningTimeout`, - name: '"LongQueryWarningTimeout"', - placeholder: '3000', - min: '0', - tip: 'Timeout in milliseconds after which long query warning will be printed' - }) .pca-form-column-6 +preview-xml-java(model, 'clusterMisc', 'caches') diff --git a/modules/web-console/frontend/app/configuration/generator/generator/AbstractTransformer.js b/modules/web-console/frontend/app/configuration/generator/generator/AbstractTransformer.js index 17ecf7f..ac2d8db 100644 --- a/modules/web-console/frontend/app/configuration/generator/generator/AbstractTransformer.js +++ b/modules/web-console/frontend/app/configuration/generator/generator/AbstractTransformer.js @@ -146,8 +146,8 @@ export default class AbstractTransformer { } // Generate memory configuration group. - static clusterDataStorageConfiguration(dataStorageCfg, available) { - return this.toSection(this.generator.clusterDataStorageConfiguration(dataStorageCfg, available)); + static clusterDataStorageConfiguration(cluster, available) { + return this.toSection(this.generator.clusterDataStorageConfiguration(cluster, available)); } // Generate marshaller group. diff --git a/modules/web-console/frontend/app/configuration/generator/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/configuration/generator/generator/ConfigurationGenerator.js index 3b24f14..587dae6 100644 --- a/modules/web-console/frontend/app/configuration/generator/generator/ConfigurationGenerator.js +++ b/modules/web-console/frontend/app/configuration/generator/generator/ConfigurationGenerator.js @@ -96,7 +96,7 @@ export default class IgniteConfigurationGenerator { // Since ignite 2.3 if (available('2.3.0')) - this.clusterDataStorageConfiguration(cluster.dataStorageConfiguration, available, cfg); + this.clusterDataStorageConfiguration(cluster, available, cfg); this.clusterDeployment(cluster, available, cfg); this.clusterEvents(cluster, available, cfg); @@ -979,6 +979,12 @@ export default class IgniteConfigurationGenerator { .longProperty('networkSendRetryDelay') .intProperty('networkSendRetryCount'); + if (available('2.8.0')) + cfg.intProperty('networkCompressionLevel'); + + if (available('2.5.0')) + cfg.emptyBeanProperty('communicationFailureResolver'); + if (available(['1.0.0', '2.3.0'])) cfg.longProperty('discoveryStartupDelay'); @@ -1511,12 +1517,16 @@ export default class IgniteConfigurationGenerator { } // Generate data storage configuration. - static clusterDataStorageConfiguration(dataStorageCfg, available, cfg = this.igniteConfigurationBean()) { + static clusterDataStorageConfiguration(cluster, available, cfg = this.igniteConfigurationBean(cluster)) { if (!available('2.3.0')) return cfg; const available2_4 = available('2.4.0'); + const available2_7 = available('2.7.0'); + + const dataStorageCfg = cluster.dataStorageConfiguration; + const storageBean = new Bean('org.apache.ignite.configuration.DataStorageConfiguration', 'dataStorageCfg', dataStorageCfg, clusterDflts.dataStorageConfiguration); storageBean.intProperty('pageSize') @@ -1596,25 +1606,50 @@ export default class IgniteConfigurationGenerator { if (factoryBean) storageBean.beanProperty('fileIOFactory', factoryBean); - if (storageBean.isEmpty()) - return cfg; + if (_.get(dataStorageCfg, 'defaultDataRegionConfiguration.persistenceEnabled') + || _.find(_.get(dataStorageCfg, 'dataRegionConfigurations'), (storeCfg) => storeCfg.persistenceEnabled)) + cfg.boolProperty('authenticationEnabled'); - cfg.beanProperty('dataStorageConfiguration', storageBean); + if (storageBean.nonEmpty()) + cfg.beanProperty('dataStorageConfiguration', storageBean); return cfg; } // Generate miscellaneous configuration. static clusterMisc(cluster, available, cfg = this.igniteConfigurationBean(cluster)) { - cfg.stringProperty('workDirectory'); + const available2_0 = available('2.0.0'); - if (available('2.0.0')) { - cfg.stringProperty('consistentId') + cfg.pathProperty('workDirectory') + .pathProperty('igniteHome') + .varArgProperty('lifecycleBeans', 'lifecycleBeans', _.map(cluster.lifecycleBeans, (bean) => new EmptyBean(bean)), 'org.apache.ignite.lifecycle.LifecycleBean') + .emptyBeanProperty('addressResolver') + .emptyBeanProperty('mBeanServer') + .varArgProperty('includeProperties', 'includeProperties', cluster.includeProperties); + + if (cluster.cacheStoreSessionListenerFactories) { + const factories = _.map(cluster.cacheStoreSessionListenerFactories, (factory) => new EmptyBean(factory)); + + cfg.varArgProperty('cacheStoreSessionListenerFactories', 'cacheStoreSessionListenerFactories', factories, 'javax.cache.configuration.Factory'); + } + + if (available2_0) { + cfg + .stringProperty('consistentId') .emptyBeanProperty('warmupClosure') .boolProperty('activeOnStart') .boolProperty('cacheSanityCheckEnabled'); } + if (available('2.7.0')) + cfg.varArgProperty('sqlSchemas', 'sqlSchemas', cluster.sqlSchemas); + + if (available('2.8.0')) + cfg.intProperty('sqlQueryHistorySize'); + + if (available('2.4.0')) + cfg.boolProperty('autoActivationEnabled'); + if (available(['1.0.0', '2.1.0'])) cfg.boolProperty('lateAffinityAssignment'); diff --git a/modules/web-console/frontend/app/configuration/generator/generator/defaults/Cluster.service.js b/modules/web-console/frontend/app/configuration/generator/generator/defaults/Cluster.service.js index e486ee6..fc69e32 100644 --- a/modules/web-console/frontend/app/configuration/generator/generator/defaults/Cluster.service.js +++ b/modules/web-console/frontend/app/configuration/generator/generator/defaults/Cluster.service.js @@ -442,7 +442,12 @@ const DFLT_CLUSTER = { sslEnabled: false, useIgniteSslContextFactory: true, sslClientAuth: false - } + }, + authenticationEnabled: false, + sqlQueryHistorySize: 1000, + allSegmentationResolversPassRequired: true, + networkCompressionLevel: 1, + autoActivationEnabled: true }; export default class IgniteClusterDefaults { diff --git a/modules/web-console/frontend/app/configuration/services/Clusters.ts b/modules/web-console/frontend/app/configuration/services/Clusters.ts index b03a9e0..1e478ed 100644 --- a/modules/web-console/frontend/app/configuration/services/Clusters.ts +++ b/modules/web-console/frontend/app/configuration/services/Clusters.ts @@ -16,6 +16,7 @@ */ import get from 'lodash/get'; +import find from 'lodash/find'; import {from} from 'rxjs'; import ObjectID from 'bson-objectid/objectid'; import {uniqueName} from 'app/utils/uniqueName'; @@ -202,7 +203,8 @@ export default class Clusters { igfss: [], models: [], checkpointSpi: [], - loadBalancingSpi: [] + loadBalancingSpi: [], + autoActivationEnabled: true }; } @@ -339,6 +341,7 @@ export default class Clusters { const maxSize = memoryPolicy.maxSize; const pageSize = cluster.memoryConfiguration.pageSize || this.memoryConfiguration.pageSize.default; const maxPoolSize = Math.floor(maxSize / pageSize / perThreadLimit); + return maxPoolSize; } } @@ -469,6 +472,11 @@ export default class Clusters { } }; + persistenceEnabled(dataStorage) { + return !!(get(dataStorage, 'defaultDataRegionConfiguration.persistenceEnabled') + || find(get(dataStorage, 'dataRegionConfigurations'), (storeCfg) => storeCfg.persistenceEnabled)); + } + swapSpaceSpi = { readStripesNumber: { default: 'availableProcessors', diff --git a/modules/web-console/src/test/java/org/apache/ignite/console/configuration/WebConsoleConfigurationSelfTest.java b/modules/web-console/src/test/java/org/apache/ignite/console/configuration/WebConsoleConfigurationSelfTest.java index a7fbc25..ebfd833 100644 --- a/modules/web-console/src/test/java/org/apache/ignite/console/configuration/WebConsoleConfigurationSelfTest.java +++ b/modules/web-console/src/test/java/org/apache/ignite/console/configuration/WebConsoleConfigurationSelfTest.java @@ -193,6 +193,18 @@ public class WebConsoleConfigurationSelfTest { igniteCfgProps.add("pluginConfigurations"); igniteCfgProps.add("mvccVacuumFrequency"); igniteCfgProps.add("mvccVacuumThreadCount"); + igniteCfgProps.add("authenticationEnabled"); + igniteCfgProps.add("sqlQueryHistorySize"); + igniteCfgProps.add("lifecycleBeans"); + igniteCfgProps.add("addressResolver"); + igniteCfgProps.add("mBeanServer"); + igniteCfgProps.add("networkCompressionLevel"); + igniteCfgProps.add("systemWorkerBlockedTimeout"); + igniteCfgProps.add("includeProperties"); + igniteCfgProps.add("cacheStoreSessionListenerFactories"); + igniteCfgProps.add("sqlSchemas"); + igniteCfgProps.add("igniteInstanceName"); + igniteCfgProps.add("communicationFailureResolver"); Set<String> igniteCfgPropsDep = new HashSet<>(); igniteCfgPropsDep.add("gridName"); @@ -208,6 +220,15 @@ public class WebConsoleConfigurationSelfTest { igniteCfgPropsExcl.add("clientMode"); igniteCfgPropsExcl.add("indexingSpi"); igniteCfgPropsExcl.add("nodeId"); + igniteCfgPropsExcl.add("segmentCheckFrequency"); + igniteCfgPropsExcl.add("allSegmentationResolversPassRequired"); + igniteCfgPropsExcl.add("segmentationPolicy"); + igniteCfgPropsExcl.add("segmentationResolveAttempts"); + igniteCfgPropsExcl.add("waitForSegmentOnStart"); + igniteCfgPropsExcl.add("segmentationResolvers"); + igniteCfgPropsExcl.add("autoActivationEnabled"); + igniteCfgPropsExcl.add("igniteHome"); + igniteCfgPropsExcl.add("platformConfiguration"); metadata.put(IgniteConfiguration.class, new MetadataInfo(igniteCfgProps, igniteCfgPropsDep, igniteCfgPropsExcl));