IGNITE-7996 Merge with master.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e333f306 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e333f306 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e333f306 Branch: refs/heads/master Commit: e333f306d0f32d4c02057fff4238081f25775cf1 Parents: d1be9b8 d02e87b Author: Alexey Kuznetsov <akuznet...@apache.org> Authored: Thu Apr 12 11:07:02 2018 +0700 Committer: Alexey Kuznetsov <akuznet...@apache.org> Committed: Thu Apr 12 11:10:27 2018 +0700 ---------------------------------------------------------------------- modules/web-console/frontend/app/app.js | 2 - .../components/cache-edit-form/template.tpl.pug | 22 +- .../cache-edit-form/templates/affinity.pug | 86 +++++ .../cache-edit-form/templates/concurrency.pug | 64 ++++ .../cache-edit-form/templates/general.pug | 113 +++++++ .../cache-edit-form/templates/memory.pug | 158 ++++++++++ .../templates/near-cache-client.pug | 50 +++ .../templates/near-cache-server.pug | 51 +++ .../cache-edit-form/templates/node-filter.pug | 53 ++++ .../cache-edit-form/templates/query.pug | 114 +++++++ .../cache-edit-form/templates/rebalance.pug | 66 ++++ .../cache-edit-form/templates/statistics.pug | 34 ++ .../cache-edit-form/templates/store.pug | 310 +++++++++++++++++++ .../cluster-edit-form/template.tpl.pug | 62 ++-- .../cluster-edit-form/templates/atomic.pug | 75 +++++ .../cluster-edit-form/templates/attributes.pug | 40 +++ .../cluster-edit-form/templates/binary.pug | 80 +++++ .../templates/cache-key-cfg.pug | 63 ++++ .../cluster-edit-form/templates/checkpoint.pug | 82 +++++ .../templates/checkpoint/fs.pug | 36 +++ .../templates/checkpoint/jdbc.pug | 47 +++ .../templates/checkpoint/s3.pug | 204 ++++++++++++ .../templates/client-connector.pug | 76 +++++ .../cluster-edit-form/templates/collision.pug | 58 ++++ .../templates/collision/custom.pug | 23 ++ .../templates/collision/fifo-queue.pug | 26 ++ .../templates/collision/job-stealing.pug | 51 +++ .../templates/collision/priority-queue.pug | 41 +++ .../templates/communication.pug | 134 ++++++++ .../cluster-edit-form/templates/connector.pug | 100 ++++++ .../templates/data-storage.pug | 301 ++++++++++++++++++ .../cluster-edit-form/templates/deployment.pug | 192 ++++++++++++ .../cluster-edit-form/templates/discovery.pug | 97 ++++++ .../cluster-edit-form/templates/events.pug | 66 ++++ .../cluster-edit-form/templates/failover.pug | 89 ++++++ .../cluster-edit-form/templates/general.pug | 89 ++++++ .../templates/general/discovery/cloud.pug | 78 +++++ .../templates/general/discovery/google.pug | 38 +++ .../templates/general/discovery/jdbc.pug | 35 +++ .../templates/general/discovery/kubernetes.pug | 38 +++ .../templates/general/discovery/multicast.pug | 63 ++++ .../templates/general/discovery/s3.pug | 38 +++ .../templates/general/discovery/shared.pug | 24 ++ .../templates/general/discovery/vm.pug | 55 ++++ .../templates/general/discovery/zookeeper.pug | 84 +++++ .../retrypolicy/bounded-exponential-backoff.pug | 26 ++ .../discovery/zookeeper/retrypolicy/custom.pug | 25 ++ .../retrypolicy/exponential-backoff.pug | 26 ++ .../discovery/zookeeper/retrypolicy/forever.pug | 23 ++ .../discovery/zookeeper/retrypolicy/n-times.pug | 24 ++ .../zookeeper/retrypolicy/one-time.pug | 23 ++ .../zookeeper/retrypolicy/until-elapsed.pug | 24 ++ .../cluster-edit-form/templates/hadoop.pug | 87 ++++++ .../cluster-edit-form/templates/igfs.pug | 34 ++ .../templates/load-balancing.pug | 115 +++++++ .../cluster-edit-form/templates/logger.pug | 60 ++++ .../templates/logger/custom.pug | 24 ++ .../templates/logger/log4j.pug | 49 +++ .../templates/logger/log4j2.pug | 38 +++ .../cluster-edit-form/templates/marshaller.pug | 75 +++++ .../cluster-edit-form/templates/memory.pug | 195 ++++++++++++ .../cluster-edit-form/templates/metrics.pug | 46 +++ .../cluster-edit-form/templates/misc.pug | 58 ++++ .../cluster-edit-form/templates/odbc.pug | 70 +++++ .../cluster-edit-form/templates/persistence.pug | 82 +++++ .../cluster-edit-form/templates/service.pug | 89 ++++++ .../templates/sql-connector.pug | 58 ++++ .../cluster-edit-form/templates/ssl.pug | 89 ++++++ .../cluster-edit-form/templates/swap.pug | 74 +++++ .../cluster-edit-form/templates/thread.pug | 144 +++++++++ .../cluster-edit-form/templates/time.pug | 44 +++ .../templates/transactions.pug | 65 ++++ .../components/igfs-edit-form/template.tpl.pug | 12 +- .../igfs-edit-form/templates/dual.pug | 42 +++ .../igfs-edit-form/templates/fragmentizer.pug | 37 +++ .../igfs-edit-form/templates/general.pug | 72 +++++ .../components/igfs-edit-form/templates/ipc.pug | 55 ++++ .../igfs-edit-form/templates/misc.pug | 110 +++++++ .../igfs-edit-form/templates/secondary.pug | 55 ++++ .../components/model-edit-form/template.tpl.pug | 6 +- .../model-edit-form/templates/general.pug | 57 ++++ .../model-edit-form/templates/query.pug | 255 +++++++++++++++ .../model-edit-form/templates/store.pug | 123 ++++++++ .../page-configure-basic/template.pug | 18 +- .../components/preview-panel/directive.js | 246 +++++++++++++++ .../components/preview-panel/index.js | 23 ++ .../app/components/page-configure/index.js | 25 +- .../services/ConfigurationResource.js | 49 +++ .../page-configure/services/SummaryZipper.js | 44 +++ .../page-configure/services/summary.worker.js | 147 +++++++++ .../app/components/page-configure/states.js | 270 ++++++++++++++++ .../app/modules/states/configuration.state.js | 297 ------------------ .../configuration/Configuration.resource.js | 42 --- .../states/configuration/caches/affinity.pug | 86 ----- .../states/configuration/caches/concurrency.pug | 64 ---- .../states/configuration/caches/general.pug | 113 ------- .../states/configuration/caches/memory.pug | 158 ---------- .../configuration/caches/near-cache-client.pug | 50 --- .../configuration/caches/near-cache-server.pug | 51 --- .../states/configuration/caches/node-filter.pug | 53 ---- .../states/configuration/caches/query.pug | 114 ------- .../states/configuration/caches/rebalance.pug | 66 ---- .../states/configuration/caches/statistics.pug | 34 -- .../states/configuration/caches/store.pug | 310 ------------------- .../states/configuration/clusters/atomic.pug | 75 ----- .../configuration/clusters/attributes.pug | 40 --- .../states/configuration/clusters/binary.pug | 80 ----- .../configuration/clusters/cache-key-cfg.pug | 63 ---- .../configuration/clusters/checkpoint.pug | 82 ----- .../configuration/clusters/checkpoint/fs.pug | 36 --- .../configuration/clusters/checkpoint/jdbc.pug | 47 --- .../configuration/clusters/checkpoint/s3.pug | 204 ------------ .../configuration/clusters/client-connector.pug | 76 ----- .../states/configuration/clusters/collision.pug | 58 ---- .../configuration/clusters/collision/custom.pug | 23 -- .../clusters/collision/fifo-queue.pug | 26 -- .../clusters/collision/job-stealing.pug | 51 --- .../clusters/collision/priority-queue.pug | 41 --- .../configuration/clusters/communication.pug | 134 -------- .../states/configuration/clusters/connector.pug | 100 ------ .../configuration/clusters/data-storage.pug | 301 ------------------ .../configuration/clusters/deployment.pug | 192 ------------ .../states/configuration/clusters/discovery.pug | 97 ------ .../states/configuration/clusters/events.pug | 66 ---- .../states/configuration/clusters/failover.pug | 89 ------ .../states/configuration/clusters/general.pug | 89 ------ .../clusters/general/discovery/cloud.pug | 78 ----- .../clusters/general/discovery/google.pug | 38 --- .../clusters/general/discovery/jdbc.pug | 35 --- .../clusters/general/discovery/kubernetes.pug | 38 --- .../clusters/general/discovery/multicast.pug | 63 ---- .../clusters/general/discovery/s3.pug | 38 --- .../clusters/general/discovery/shared.pug | 24 -- .../clusters/general/discovery/vm.pug | 55 ---- .../clusters/general/discovery/zookeeper.pug | 84 ----- .../retrypolicy/bounded-exponential-backoff.pug | 26 -- .../discovery/zookeeper/retrypolicy/custom.pug | 25 -- .../retrypolicy/exponential-backoff.pug | 26 -- .../discovery/zookeeper/retrypolicy/forever.pug | 23 -- .../discovery/zookeeper/retrypolicy/n-times.pug | 24 -- .../zookeeper/retrypolicy/one-time.pug | 23 -- .../zookeeper/retrypolicy/until-elapsed.pug | 24 -- .../states/configuration/clusters/hadoop.pug | 87 ------ .../states/configuration/clusters/igfs.pug | 34 -- .../configuration/clusters/load-balancing.pug | 115 ------- .../states/configuration/clusters/logger.pug | 60 ---- .../configuration/clusters/logger/custom.pug | 24 -- .../configuration/clusters/logger/log4j.pug | 49 --- .../configuration/clusters/logger/log4j2.pug | 38 --- .../configuration/clusters/marshaller.pug | 75 ----- .../states/configuration/clusters/memory.pug | 195 ------------ .../states/configuration/clusters/metrics.pug | 46 --- .../states/configuration/clusters/misc.pug | 58 ---- .../states/configuration/clusters/odbc.pug | 70 ----- .../configuration/clusters/persistence.pug | 82 ----- .../states/configuration/clusters/service.pug | 89 ------ .../configuration/clusters/sql-connector.pug | 58 ---- .../states/configuration/clusters/ssl.pug | 89 ------ .../states/configuration/clusters/swap.pug | 74 ----- .../states/configuration/clusters/thread.pug | 144 --------- .../states/configuration/clusters/time.pug | 44 --- .../configuration/clusters/transactions.pug | 65 ---- .../states/configuration/domains/general.pug | 57 ---- .../states/configuration/domains/query.pug | 255 --------------- .../states/configuration/domains/store.pug | 123 -------- .../modules/states/configuration/igfs/dual.pug | 42 --- .../states/configuration/igfs/fragmentizer.pug | 37 --- .../states/configuration/igfs/general.pug | 72 ----- .../modules/states/configuration/igfs/ipc.pug | 55 ---- .../modules/states/configuration/igfs/misc.pug | 110 ------- .../states/configuration/igfs/secondary.pug | 55 ---- .../configuration/preview-panel.directive.js | 239 -------------- .../summary/summary-zipper.service.js | 39 --- .../configuration/summary/summary.worker.js | 147 --------- 174 files changed, 6858 insertions(+), 6822 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e333f306/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug ---------------------------------------------------------------------- diff --cc modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug index 0000000,bd8971a..8b43521 mode 000000,100644..100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug @@@ -1,0 -1,134 +1,134 @@@ + //- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + include /app/helpers/jade/mixins + + -var form = 'communication' + -var model = '$ctrl.clonedCluster' + -var communication = model + '.communication' + + panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) + panel-title Communication + panel-description + | Configuration of communication with other nodes by TCP/IP. + | Provide basic plumbing to send and receive grid messages and is utilized for all distributed grid operations. + | #[a.link-success(href="https://apacheignite.readme.io/docs/network-config" target="_blank") More info] + panel-content.pca-form-row(ng-if=`ui.isPanelLoaded('${form}')`) + .pca-form-column-6.pc-form-grid-row + .pc-form-grid-col-30 + +number('Timeout:', `${model}.networkTimeout`, '"commNetworkTimeout"', 'true', '5000', '1', 'Maximum timeout in milliseconds for network requests') + .pc-form-grid-col-30 + +number('Send retry delay:', `${model}.networkSendRetryDelay`, '"networkSendRetryDelay"', 'true', '1000', '1', 'Interval in milliseconds between message send retries') + .pc-form-grid-col-30 + +number('Send retry count:', `${model}.networkSendRetryCount`, '"networkSendRetryCount"', 'true', '3', '1', 'Message send retries count') + .pc-form-grid-col-30(ng-if='$ctrl.available(["1.0.0", "2.3.0"])') + +number('Discovery startup delay:', `${model}.discoveryStartupDelay`, '"discoveryStartupDelay"', 'true', '60000', '1', 'This value is used to expire messages from waiting list whenever node discovery discrepancies happen') + .pc-form-grid-col-60 + +java-class('Communication listener:', `${communication}.listener`, '"comListener"', 'true', 'false', 'Listener of communication events') + .pc-form-grid-col-30 + +text-ip-address('Local IP address:', `${communication}.localAddress`, '"comLocalAddress"', 'true', '0.0.0.0', + 'Local host address for socket binding<br/>\ + If not specified use all available addres on local host') + .pc-form-grid-col-30 + +number-min-max('Local port:', `${communication}.localPort`, '"comLocalPort"', 'true', '47100', '1024', '65535', 'Local port for socket binding') + .pc-form-grid-col-30 + +number('Local port range:', `${communication}.localPortRange`, '"comLocalPortRange"', 'true', '100', '1', 'Local port range for local host ports') + .pc-form-grid-col-30 + +sane-ignite-form-field-number({ + label: 'Shared memory port:', + model: `${communication}.sharedMemoryPort`, + name: '"sharedMemoryPort"', + placeholder: '{{ ::$ctrl.Clusters.sharedMemoryPort.default }}', + min: '{{ ::$ctrl.Clusters.sharedMemoryPort.min }}', + max: '{{ ::$ctrl.Clusters.sharedMemoryPort.max }}', + tip: `Local port to accept shared memory connections<br/>If set to <b>-1</b> shared memory communication will be disabled` + })( + pc-not-in-collection='::$ctrl.Clusters.sharedMemoryPort.invalidValues' + ) + +form-field-feedback('"sharedMemoryPort"', 'notInCollection', 'Shared memory port should be more than "{{ ::$ctrl.Clusters.sharedMemoryPort.invalidValues[0] }}" or equal to "{{ ::$ctrl.Clusters.sharedMemoryPort.min }}"') + .pc-form-grid-col-30 + +number('Idle connection timeout:', `${communication}.idleConnectionTimeout`, '"idleConnectionTimeout"', 'true', '30000', '1', + 'Maximum idle connection timeout upon which a connection to client will be closed') + .pc-form-grid-col-30 + +number('Connect timeout:', `${communication}.connectTimeout`, '"connectTimeout"', 'true', '5000', '0', 'Connect timeout used when establishing connection with remote nodes') + .pc-form-grid-col-30 + +number('Max. connect timeout:', `${communication}.maxConnectTimeout`, '"maxConnectTimeout"', 'true', '600000', '0', 'Maximum connect timeout') + .pc-form-grid-col-30 + +number('Reconnect count:', `${communication}.reconnectCount`, '"comReconnectCount"', 'true', '10', '1', + 'Maximum number of reconnect attempts used when establishing connection with remote nodes') + .pc-form-grid-col-30 + +number('Socket send buffer:', `${communication}.socketSendBuffer`, '"socketSendBuffer"', 'true', '32768', '0', 'Send buffer size for sockets created or accepted by this SPI') + .pc-form-grid-col-30 + +number('Socket receive buffer:', `${communication}.socketReceiveBuffer`, '"socketReceiveBuffer"', 'true', '32768', '0', 'Receive buffer size for sockets created or accepted by this SPI') + .pc-form-grid-col-30 + +number('Slow client queue limit:', `${communication}.slowClientQueueLimit`, '"slowClientQueueLimit"', 'true', '0', '0', 'Slow client queue limit') + .pc-form-grid-col-30 + +sane-ignite-form-field-number({ + label: 'Ack send threshold:', + model: `${communication}.ackSendThreshold`, + name: '"ackSendThreshold"', + placeholder: '{{ ::$ctrl.Clusters.ackSendThreshold.default }}', + min: '{{ ::$ctrl.Clusters.ackSendThreshold.min }}', + tip: 'Number of received messages per connection to node after which acknowledgment message is sent' + }) + .pc-form-grid-col-30 + +sane-ignite-form-field-number({ + label: 'Message queue limit:', + model: `${communication}.messageQueueLimit`, + name: '"messageQueueLimit"', + placeholder: '{{ ::$ctrl.Clusters.messageQueueLimit.default }}', + min: '{{ ::$ctrl.Clusters.messageQueueLimit.min }}', + tip: 'Message queue limit for incoming and outgoing messages' + }) + .pc-form-grid-col-30 ++ //- allowInvalid: true prevents from infinite digest loop when old value was 0 and becomes less than allowed minimum + +sane-ignite-form-field-number({ + label: 'Unacknowledged messages:', + model: `${communication}.unacknowledgedMessagesBufferSize`, + name: '"unacknowledgedMessagesBufferSize"', + placeholder: '{{ ::$ctrl.Clusters.unacknowledgedMessagesBufferSize.default }}', + min: `{{ $ctrl.Clusters.unacknowledgedMessagesBufferSize.min( + ${communication}.unacknowledgedMessagesBufferSize, + ${communication}.messageQueueLimit, + ${communication}.ackSendThreshold + ) }}`, + tip: `Maximum number of stored unacknowledged messages per connection to node<br/> + If specified non zero value it should be + <ul> + <li>At least ack send threshold * {{ ::$ctrl.Clusters.unacknowledgedMessagesBufferSize.validRatio }}</li> + <li>At least message queue limit * {{ ::$ctrl.Clusters.unacknowledgedMessagesBufferSize.validRatio }}</li> + </ul>` + })( - //- allowInvalid: true prevents from infinite digest loop when old value was 0 and becomes less than allowed minimum + ng-model-options=`{ + allowInvalid: true + }` + ) + .pc-form-grid-col-30 + +number('Socket write timeout:', `${communication}.socketWriteTimeout`, '"socketWriteTimeout"', 'true', '2000', '0', 'Socket write timeout') + .pc-form-grid-col-30 + +number('Selectors count:', `${communication}.selectorsCount`, '"selectorsCount"', 'true', 'min(4, availableProcessors)', '1', 'Count of selectors te be used in TCP server') + .pc-form-grid-col-60 + +java-class('Address resolver:', `${communication}.addressResolver`, '"comAddressResolver"', 'true', 'false', 'Provides resolution between external and internal addresses') + .pc-form-grid-col-60 + +checkbox('Direct buffer', `${communication}.directBuffer`, '"directBuffer"', + 'If value is true, then SPI will use ByteBuffer.allocateDirect(int) call<br/>\ + Otherwise, SPI will use ByteBuffer.allocate(int) call') + .pc-form-grid-col-60 + +checkbox('Direct send buffer', `${communication}.directSendBuffer`, '"directSendBuffer"', 'Flag defining whether direct send buffer should be used') + .pc-form-grid-col-60 + +checkbox('TCP_NODELAY option', `${communication}.tcpNoDelay`, '"tcpNoDelay"', 'Value for TCP_NODELAY socket option') + .pca-form-column-6 + +preview-xml-java(model, 'clusterCommunication') http://git-wip-us.apache.org/repos/asf/ignite/blob/e333f306/modules/web-console/frontend/app/components/page-configure/services/summary.worker.js ---------------------------------------------------------------------- diff --cc modules/web-console/frontend/app/components/page-configure/services/summary.worker.js index 0000000,c80d698..b3b0bce mode 000000,100644..100644 --- a/modules/web-console/frontend/app/components/page-configure/services/summary.worker.js +++ b/modules/web-console/frontend/app/components/page-configure/services/summary.worker.js @@@ -1,0 -1,147 +1,147 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import JSZip from 'jszip'; + + import IgniteMavenGenerator from 'app/modules/configuration/generator/Maven.service'; + import IgniteDockerGenerator from 'app/modules/configuration/generator/Docker.service'; + import IgniteReadmeGenerator from 'app/modules/configuration/generator/Readme.service'; + import IgnitePropertiesGenerator from 'app/modules/configuration/generator/Properties.service'; + import IgniteConfigurationGenerator from 'app/modules/configuration/generator/ConfigurationGenerator'; + + import IgniteJavaTransformer from 'app/modules/configuration/generator/JavaTransformer.service'; + import IgniteSpringTransformer from 'app/modules/configuration/generator/SpringTransformer.service'; + + import {nonEmpty, nonNil} from 'app/utils/lodashMixins'; + import get from 'lodash/get'; + import filter from 'lodash/filter'; + import isEmpty from 'lodash/isEmpty'; + + const maven = new IgniteMavenGenerator(); + const docker = new IgniteDockerGenerator(); + const readme = new IgniteReadmeGenerator(); + const properties = new IgnitePropertiesGenerator(); + + const java = IgniteJavaTransformer; + const spring = IgniteSpringTransformer; + + const generator = IgniteConfigurationGenerator; + + const escapeFileName = (name) => name.replace(/[\\\/*\"\[\],\.:;|=<>?]/g, '-').replace(/ /g, '_'); + + const kubernetesConfig = (cluster) => { + if (!cluster.discovery.Kubernetes) + cluster.discovery.Kubernetes = { serviceName: 'ignite' }; + + return `apiVersion: v1\n\ + kind: Service\n\ + metadata:\n\ + # Name of Ignite Service used by Kubernetes IP finder for IP addresses lookup.\n\ + name: ${ cluster.discovery.Kubernetes.serviceName || 'ignite' }\n\ + spec:\n\ + clusterIP: None # custom value.\n\ + ports:\n\ + - port: 9042 # custom value.\n\ + selector:\n\ + # Must be equal to one of the labels set in Ignite pods'\n\ + # deployement configuration.\n\ + app: ${ cluster.discovery.Kubernetes.serviceName || 'ignite' }`; + }; + + // eslint-disable-next-line no-undef + onmessage = function(e) { + const {cluster, data, demo, targetVer} = e.data; + + const zip = new JSZip(); + + if (!data.docker) + data.docker = docker.generate(cluster, targetVer); + + zip.file('Dockerfile', data.docker); + zip.file('.dockerignore', docker.ignoreFile()); + + const cfg = generator.igniteConfiguration(cluster, targetVer, false); + const clientCfg = generator.igniteConfiguration(cluster, targetVer, true); + const clientNearCaches = filter(cluster.caches, (cache) => + cache.cacheMode === 'PARTITIONED' && get(cache, 'clientNearConfiguration.enabled')); + + const secProps = properties.generate(cfg); + + if (secProps) + zip.file('src/main/resources/secret.properties', secProps); + + const srcPath = 'src/main/java'; + const resourcesPath = 'src/main/resources'; + + const serverXml = `${escapeFileName(cluster.name)}-server.xml`; + const clientXml = `${escapeFileName(cluster.name)}-client.xml`; + + const metaPath = `${resourcesPath}/META-INF`; + + if (cluster.discovery.kind === 'Kubernetes') + zip.file(`${metaPath}/ignite-service.yaml`, kubernetesConfig(cluster)); + + zip.file(`${metaPath}/${serverXml}`, spring.igniteConfiguration(cfg, targetVer).asString()); + zip.file(`${metaPath}/${clientXml}`, spring.igniteConfiguration(clientCfg, targetVer, clientNearCaches).asString()); + + const cfgPath = `${srcPath}/config`; + + zip.file(`${cfgPath}/ServerConfigurationFactory.java`, java.igniteConfiguration(cfg, targetVer, 'config', 'ServerConfigurationFactory').asString()); + zip.file(`${cfgPath}/ClientConfigurationFactory.java`, java.igniteConfiguration(clientCfg, targetVer, 'config', 'ClientConfigurationFactory', clientNearCaches).asString()); + + if (java.isDemoConfigured(cluster, demo)) { + zip.file(`${srcPath}/demo/DemoStartup.java`, java.nodeStartup(cluster, 'demo.DemoStartup', + 'ServerConfigurationFactory.createConfiguration()', 'config.ServerConfigurationFactory')); + } + + // Generate loader for caches with configured store. - const cachesToLoad = filter(cluster.caches, (cache) => nonNil(cache.cacheStoreFactory)); ++ const cachesToLoad = filter(cluster.caches, (cache) => nonNil(_.get(cache, 'cacheStoreFactory.kind'))); + + if (nonEmpty(cachesToLoad)) + zip.file(`${srcPath}/load/LoadCaches.java`, java.loadCaches(cachesToLoad, 'load', 'LoadCaches', `"${clientXml}"`)); + + const startupPath = `${srcPath}/startup`; + + zip.file(`${startupPath}/ServerNodeSpringStartup.java`, java.nodeStartup(cluster, 'startup.ServerNodeSpringStartup', `"${serverXml}"`)); + zip.file(`${startupPath}/ClientNodeSpringStartup.java`, java.nodeStartup(cluster, 'startup.ClientNodeSpringStartup', `"${clientXml}"`)); + + zip.file(`${startupPath}/ServerNodeCodeStartup.java`, java.nodeStartup(cluster, 'startup.ServerNodeCodeStartup', + 'ServerConfigurationFactory.createConfiguration()', 'config.ServerConfigurationFactory')); + zip.file(`${startupPath}/ClientNodeCodeStartup.java`, java.nodeStartup(cluster, 'startup.ClientNodeCodeStartup', + 'ClientConfigurationFactory.createConfiguration()', 'config.ClientConfigurationFactory', clientNearCaches)); + + zip.file('pom.xml', maven.generate(cluster, targetVer)); + + zip.file('README.txt', readme.generate()); + zip.file('jdbc-drivers/README.txt', readme.generateJDBC()); + + if (isEmpty(data.pojos)) + data.pojos = java.pojos(cluster.caches, true); + + for (const pojo of data.pojos) { + if (pojo.keyClass) + zip.file(`${srcPath}/${pojo.keyType.replace(/\./g, '/')}.java`, pojo.keyClass); + + zip.file(`${srcPath}/${pojo.valueType.replace(/\./g, '/')}.java`, pojo.valueClass); + } + + zip.generateAsync({ + type: 'blob', + compression: 'DEFLATE', + mimeType: 'application/octet-stream' + }).then((blob) => postMessage(blob)); + }; http://git-wip-us.apache.org/repos/asf/ignite/blob/e333f306/modules/web-console/frontend/app/components/page-configure/states.js ---------------------------------------------------------------------- diff --cc modules/web-console/frontend/app/components/page-configure/states.js index 0000000,f8bb4dc..a75e851 mode 000000,100644..100644 --- a/modules/web-console/frontend/app/components/page-configure/states.js +++ b/modules/web-console/frontend/app/components/page-configure/states.js @@@ -1,0 -1,273 +1,270 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + -import angular from 'angular'; - + import base2 from 'views/base2.pug'; + import pageConfigureAdvancedClusterComponent from '../page-configure-advanced/components/page-configure-advanced-cluster/component'; + import pageConfigureAdvancedModelsComponent from '../page-configure-advanced/components/page-configure-advanced-models/component'; + import pageConfigureAdvancedCachesComponent from '../page-configure-advanced/components/page-configure-advanced-caches/component'; + import pageConfigureAdvancedIGFSComponent from '../page-configure-advanced/components/page-configure-advanced-igfs/component'; + -import get from 'lodash/get'; + import {Observable} from 'rxjs/Observable'; + + const idRegex = `new|[a-z0-9]+`; + + const shortCachesResolve = ['ConfigSelectors', 'ConfigureState', 'ConfigEffects', '$transition$', (ConfigSelectors, ConfigureState, {etp}, $transition$) => { + if ($transition$.params().clusterID === 'new') return Promise.resolve(); + return Observable.fromPromise($transition$.injector().getAsync('_cluster')) + .switchMap(() => ConfigureState.state$.let(ConfigSelectors.selectCluster($transition$.params().clusterID)).take(1)) + .switchMap((cluster) => { + return etp('LOAD_SHORT_CACHES', {ids: cluster.caches, clusterID: cluster._id}); + }) + .toPromise(); + }]; + + function registerStates($stateProvider) { + // Setup the states. + $stateProvider + .state('base.configuration', { + abstract: true, + permission: 'configuration', + url: '/configuration', + onEnter: ['ConfigureState', (ConfigureState) => ConfigureState.dispatchAction({type: 'PRELOAD_STATE', state: {}})], + views: { + '@': { + template: base2 + } + }, + resolve: { + _shortClusters: ['ConfigEffects', ({etp}) => { + return etp('LOAD_USER_CLUSTERS'); + }] + }, + resolvePolicy: { + async: 'NOWAIT' + } + }) + .state('base.configuration.overview', { + url: '/overview', + component: 'pageConfigureOverview', + permission: 'configuration', + tfMetaTags: { + title: 'Configuration' + } + }) + .state('base.configuration.edit', { + url: `/{clusterID:${idRegex}}`, + permission: 'configuration', + component: 'pageConfigure', + resolve: { + _cluster: ['ConfigEffects', '$transition$', ({etp}, $transition$) => { + return $transition$.injector().getAsync('_shortClusters').then(() => { + return etp('LOAD_AND_EDIT_CLUSTER', {clusterID: $transition$.params().clusterID}); + }); + }] + }, + data: { + errorState: 'base.configuration.overview' + }, + redirectTo: ($transition$) => { + const [ConfigureState, ConfigSelectors] = ['ConfigureState', 'ConfigSelectors'].map((t) => $transition$.injector().get(t)); + const waitFor = ['_cluster', '_shortClusters'].map((t) => $transition$.injector().getAsync(t)); + return Observable.fromPromise(Promise.all(waitFor)).switchMap(() => { + return Observable.combineLatest( + ConfigureState.state$.let(ConfigSelectors.selectCluster($transition$.params().clusterID)).take(1), + ConfigureState.state$.let(ConfigSelectors.selectShortClusters()).take(1) + ); + }) + .map(([cluster = {caches: []}, clusters]) => { + return (clusters.value.size > 10 || cluster.caches.length > 5) + ? 'base.configuration.edit.advanced' + : 'base.configuration.edit.basic'; + }) + .toPromise(); + }, + failState: 'signin', + tfMetaTags: { + title: 'Configuration' + } + }) + .state('base.configuration.edit.basic', { + url: '/basic', + component: 'pageConfigureBasic', + permission: 'configuration', + resolve: { + _shortCaches: shortCachesResolve + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Basic Configuration' + } + }) + .state('base.configuration.edit.advanced', { + url: '/advanced', + component: 'pageConfigureAdvanced', + permission: 'configuration', + redirectTo: 'base.configuration.edit.advanced.cluster' + }) + .state('base.configuration.edit.advanced.cluster', { + url: '/cluster', + component: pageConfigureAdvancedClusterComponent.name, + permission: 'configuration', + resolve: { + _shortCaches: shortCachesResolve + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Configure Cluster' + } + }) + .state('base.configuration.edit.advanced.caches', { + url: '/caches', + permission: 'configuration', + component: pageConfigureAdvancedCachesComponent.name, + resolve: { + _shortCachesAndModels: ['ConfigSelectors', 'ConfigureState', 'ConfigEffects', '$transition$', (ConfigSelectors, ConfigureState, {etp}, $transition$) => { + if ($transition$.params().clusterID === 'new') return Promise.resolve(); + return Observable.fromPromise($transition$.injector().getAsync('_cluster')) + .switchMap(() => ConfigureState.state$.let(ConfigSelectors.selectCluster($transition$.params().clusterID)).take(1)) + .map((cluster) => { + return Promise.all([ + etp('LOAD_SHORT_CACHES', {ids: cluster.caches, clusterID: cluster._id}), + etp('LOAD_SHORT_MODELS', {ids: cluster.models, clusterID: cluster._id}), + etp('LOAD_SHORT_IGFSS', {ids: cluster.igfss, clusterID: cluster._id}) + ]); + }) + .toPromise(); + }] + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Configure Caches' + } + }) + .state('base.configuration.edit.advanced.caches.cache', { + url: `/{cacheID:${idRegex}}`, + permission: 'configuration', + resolve: { + _cache: ['ConfigEffects', '$transition$', ({etp}, $transition$) => { + const {clusterID, cacheID} = $transition$.params(); + if (cacheID === 'new') return Promise.resolve(); + return etp('LOAD_CACHE', {cacheID}); + }] + }, + data: { + errorState: 'base.configuration.edit.advanced.caches' + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Configure Caches' + } + }) + .state('base.configuration.edit.advanced.models', { + url: '/models', + component: pageConfigureAdvancedModelsComponent.name, + permission: 'configuration', + resolve: { + _shortCachesAndModels: ['ConfigSelectors', 'ConfigureState', 'ConfigEffects', '$transition$', (ConfigSelectors, ConfigureState, {etp}, $transition$) => { + if ($transition$.params().clusterID === 'new') return Promise.resolve(); + return Observable.fromPromise($transition$.injector().getAsync('_cluster')) + .switchMap(() => ConfigureState.state$.let(ConfigSelectors.selectCluster($transition$.params().clusterID)).take(1)) + .map((cluster) => { + return Promise.all([ + etp('LOAD_SHORT_CACHES', {ids: cluster.caches, clusterID: cluster._id}), + etp('LOAD_SHORT_MODELS', {ids: cluster.models, clusterID: cluster._id}) + ]); + }) + .toPromise(); + }] + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Configure SQL Schemes' + } + }) + .state('base.configuration.edit.advanced.models.model', { + url: `/{modelID:${idRegex}}`, + resolve: { + _cache: ['ConfigEffects', '$transition$', ({etp}, $transition$) => { + const {clusterID, modelID} = $transition$.params(); + if (modelID === 'new') return Promise.resolve(); + return etp('LOAD_MODEL', {modelID}); + }] + }, + data: { + errorState: 'base.configuration.edit.advanced.models' + }, + permission: 'configuration', + resolvePolicy: { + async: 'NOWAIT' + } + }) + .state('base.configuration.edit.advanced.igfs', { + url: '/igfs', + component: pageConfigureAdvancedIGFSComponent.name, + permission: 'configuration', + resolve: { + _shortIGFSs: ['ConfigSelectors', 'ConfigureState', 'ConfigEffects', '$transition$', (ConfigSelectors, ConfigureState, {etp}, $transition$) => { + if ($transition$.params().clusterID === 'new') return Promise.resolve(); + return Observable.fromPromise($transition$.injector().getAsync('_cluster')) + .switchMap(() => ConfigureState.state$.let(ConfigSelectors.selectCluster($transition$.params().clusterID)).take(1)) + .map((cluster) => { + return Promise.all([ + etp('LOAD_SHORT_IGFSS', {ids: cluster.igfss, clusterID: cluster._id}) + ]); + }) + .toPromise(); + }] + }, + resolvePolicy: { + async: 'NOWAIT' + }, + tfMetaTags: { + title: 'Configure IGFS' + } + }) + .state('base.configuration.edit.advanced.igfs.igfs', { + url: `/{igfsID:${idRegex}}`, + permission: 'configuration', + resolve: { + _igfs: ['ConfigEffects', '$transition$', ({etp}, $transition$) => { + const {clusterID, igfsID} = $transition$.params(); + if (igfsID === 'new') return Promise.resolve(); + return etp('LOAD_IGFS', {igfsID}); + }] + }, + data: { + errorState: 'base.configuration.edit.advanced.igfs' + }, + resolvePolicy: { + async: 'NOWAIT' + } + }); + } + + registerStates.$inject = ['$stateProvider']; + + export {registerStates};