[13/14] ignite git commit: IGNITE-8153 Nodes fail to connect each other when SSL is enabled - Fixes #3773.
IGNITE-8153 Nodes fail to connect each other when SSL is enabled - Fixes #3773. Signed-off-by: Valentin Kulichenko Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f4de6df7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f4de6df7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f4de6df7 Branch: refs/heads/ignite-8201 Commit: f4de6df71b256506ce36c1c4e16533bb063782a0 Parents: a96ac04 Author: mcherkasov Authored: Tue Apr 10 17:23:29 2018 -0700 Committer: Valentin Kulichenko Committed: Tue Apr 10 17:23:29 2018 -0700 -- .../ignite/internal/util/nio/ssl/BlockingSslHandler.java | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f4de6df7/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java index 638106f..0099c46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java @@ -373,9 +373,10 @@ public class BlockingSslHandler { * @throws GridNioException If failed to pass event to the next filter. */ private Status unwrapHandshake() throws SSLException, IgniteCheckedException { -// Flip input buffer so we can read the collected data. -readFromNet(); +if(!inNetBuf.hasRemaining()) +readFromNet(); +// Flip input buffer so we can read the collected data. inNetBuf.flip(); SSLEngineResult res = unwrap0(); @@ -399,7 +400,10 @@ public class BlockingSslHandler { else if (res.getStatus() == BUFFER_UNDERFLOW) { inNetBuf.compact(); -inNetBuf = expandBuffer(inNetBuf, inNetBuf.capacity() * 2); +if(inNetBuf.capacity() == inNetBuf.limit()) +inNetBuf = expandBuffer(inNetBuf, inNetBuf.capacity() * 2); + +readFromNet(); } else // prepare to be written again
[04/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java deleted file mode 100644 index fec0a83..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java +++ /dev/null @@ -1,568 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.ml.trees.trainers.columnbased; - -import com.zaxxer.sparsebits.SparseBitSet; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.DoubleStream; -import java.util.stream.IntStream; -import java.util.stream.Stream; -import javax.cache.Cache; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.IgniteLogger; -import org.apache.ignite.Ignition; -import org.apache.ignite.cache.CachePeekMode; -import org.apache.ignite.cache.affinity.Affinity; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.internal.processors.cache.CacheEntryImpl; -import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.ml.Trainer; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.distributed.CacheUtils; -import org.apache.ignite.ml.math.functions.Functions; -import org.apache.ignite.ml.math.functions.IgniteBiFunction; -import org.apache.ignite.ml.math.functions.IgniteCurriedBiFunction; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.functions.IgniteSupplier; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.models.DecisionTreeModel; -import org.apache.ignite.ml.trees.nodes.DecisionTreeNode; -import org.apache.ignite.ml.trees.nodes.Leaf; -import org.apache.ignite.ml.trees.nodes.SplitNode; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ContextCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache.FeatureKey; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ProjectionsCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ProjectionsCache.RegionKey; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.SplitCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.SplitCache.SplitKey; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.FeatureProcessor; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.SplitInfo; -import org.jetbrains.annotations.NotNull; - -import static org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache.getFeatureCacheKey; - -/** - * This trainer stores observations as columns and features as rows. - * Ideas from https://github.com/fabuzaid21/yggdrasil are used here. - */ -public class ColumnDecisionTreeTrainer implements -Trainer { -/** - * Function used to assign a value to a region. - */ -private final IgniteFunction regCalc; - -/** - * Function used to calculate impurity in regions used by categorical features. - */ -private final IgniteFunction> continuousCalculatorProvider; - -/** - * Categorical calculator provider. - **/ -private final IgniteFunction> categoricalCalculatorProvider; - -/** - * Cache used for storing data for training. - */ -private IgniteCache> prjsCache; - -/** - * Minimal information gain. - */ -
[05/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java b/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java new file mode 100644 index 000..3fc8515 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java @@ -0,0 +1,133 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.tree.impurity.mse; + +import org.apache.ignite.ml.tree.impurity.ImpurityMeasure; + +/** + * Mean squared error (variance) impurity measure which is calculated the following way: + * {@code \frac{1}{L}\sum_{i=0}^{n}(y_i - \mu)^2}. + */ +public class MSEImpurityMeasure implements ImpurityMeasure { +/** */ +private static final long serialVersionUID = 4536394578628409689L; + +/** Sum of all elements in the left part. */ +private final double leftY; + +/** Sum of all squared elements in the left part. */ +private final double leftY2; + +/** Number of elements in the left part. */ +private final long leftCnt; + +/** Sum of all elements in the right part. */ +private final double rightY; + +/** Sum of all squared elements in the right part. */ +private final double rightY2; + +/** Number of elements in the right part. */ +private final long rightCnt; + +/** + * Constructs a new instance of mean squared error (variance) impurity measure. + * + * @param leftY Sum of all elements in the left part. + * @param leftY2 Sum of all squared elements in the left part. + * @param leftCnt Number of elements in the left part. + * @param rightY Sum of all elements in the right part. + * @param rightY2 Sum of all squared elements in the right part. + * @param rightCnt Number of elements in the right part. + */ +public MSEImpurityMeasure(double leftY, double leftY2, long leftCnt, double rightY, double rightY2, long rightCnt) { +this.leftY = leftY; +this.leftY2 = leftY2; +this.leftCnt = leftCnt; +this.rightY = rightY; +this.rightY2 = rightY2; +this.rightCnt = rightCnt; +} + +/** {@inheritDoc} */ +@Override public double impurity() { +double impurity = 0; + +if (leftCnt > 0) +impurity += leftY2 - 2.0 * leftY / leftCnt * leftY + Math.pow(leftY / leftCnt, 2) * leftCnt; + +if (rightCnt > 0) +impurity += rightY2 - 2.0 * rightY / rightCnt * rightY + Math.pow(rightY / rightCnt, 2) * rightCnt; + +return impurity; +} + +/** {@inheritDoc} */ +@Override public MSEImpurityMeasure add(MSEImpurityMeasure b) { +return new MSEImpurityMeasure( +leftY + b.leftY, +leftY2 + b.leftY2, +leftCnt + b.leftCnt, +rightY + b.rightY, +rightY2 + b.rightY2, +rightCnt + b.rightCnt +); +} + +/** {@inheritDoc} */ +@Override public MSEImpurityMeasure subtract(MSEImpurityMeasure b) { +return new MSEImpurityMeasure( +leftY - b.leftY, +leftY2 - b.leftY2, +leftCnt - b.leftCnt, +rightY - b.rightY, +rightY2 - b.rightY2, +rightCnt - b.rightCnt +); +} + +/** */ +public double getLeftY() { +return leftY; +} + +/** */ +public double getLeftY2() { +return leftY2; +} + +/** */ +public long getLeftCnt() { +return leftCnt; +} + +/** */ +public double getRightY() { +return rightY; +} + +/** */ +public double getRightY2() { +return rightY2; +} + +/** */ +public long getRightCnt() { +return rightCnt; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureCalculator.java -- diff -
[06/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
IGNITE-8059: Integrate decision tree with partition based dataset. this closes #3760 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/139c2af6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/139c2af6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/139c2af6 Branch: refs/heads/ignite-8201 Commit: 139c2af66a9f745f89429842810f5d5fe1addf28 Parents: a64b941 Author: dmitrievanthony Authored: Tue Apr 10 12:46:43 2018 +0300 Committer: YuriBabak Committed: Tue Apr 10 12:46:44 2018 +0300 -- ...ecisionTreeClassificationTrainerExample.java | 147 + .../DecisionTreeRegressionTrainerExample.java | 124 .../ignite/examples/ml/tree/package-info.java | 22 + .../examples/ml/trees/DecisionTreesExample.java | 354 .../ignite/examples/ml/trees/package-info.java | 22 - .../main/java/org/apache/ignite/ml/Trainer.java | 3 - .../org/apache/ignite/ml/tree/DecisionTree.java | 252 .../tree/DecisionTreeClassificationTrainer.java | 93 +++ .../ml/tree/DecisionTreeConditionalNode.java| 78 +++ .../ignite/ml/tree/DecisionTreeLeafNode.java| 48 ++ .../apache/ignite/ml/tree/DecisionTreeNode.java | 26 + .../ml/tree/DecisionTreeRegressionTrainer.java | 60 ++ .../org/apache/ignite/ml/tree/TreeFilter.java | 38 ++ .../ignite/ml/tree/data/DecisionTreeData.java | 128 + .../ml/tree/data/DecisionTreeDataBuilder.java | 73 +++ .../ignite/ml/tree/data/package-info.java | 22 + .../ml/tree/impurity/ImpurityMeasure.java | 55 ++ .../impurity/ImpurityMeasureCalculator.java | 38 ++ .../tree/impurity/gini/GiniImpurityMeasure.java | 115 .../gini/GiniImpurityMeasureCalculator.java | 110 .../ml/tree/impurity/gini/package-info.java | 22 + .../tree/impurity/mse/MSEImpurityMeasure.java | 133 + .../mse/MSEImpurityMeasureCalculator.java | 80 +++ .../ml/tree/impurity/mse/package-info.java | 22 + .../ignite/ml/tree/impurity/package-info.java | 22 + .../util/SimpleStepFunctionCompressor.java | 149 + .../ml/tree/impurity/util/StepFunction.java | 162 ++ .../impurity/util/StepFunctionCompressor.java | 55 ++ .../ml/tree/impurity/util/package-info.java | 22 + .../ml/tree/leaf/DecisionTreeLeafBuilder.java | 38 ++ .../tree/leaf/MeanDecisionTreeLeafBuilder.java | 73 +++ .../leaf/MostCommonDecisionTreeLeafBuilder.java | 86 +++ .../ignite/ml/tree/leaf/package-info.java | 22 + .../org/apache/ignite/ml/tree/package-info.java | 22 + .../ignite/ml/trees/CategoricalRegionInfo.java | 72 --- .../ignite/ml/trees/CategoricalSplitInfo.java | 68 --- .../ignite/ml/trees/ContinuousRegionInfo.java | 74 --- .../ml/trees/ContinuousSplitCalculator.java | 51 -- .../org/apache/ignite/ml/trees/RegionInfo.java | 62 -- .../ml/trees/models/DecisionTreeModel.java | 44 -- .../ignite/ml/trees/models/package-info.java| 22 - .../ml/trees/nodes/CategoricalSplitNode.java| 50 -- .../ml/trees/nodes/ContinuousSplitNode.java | 56 -- .../ignite/ml/trees/nodes/DecisionTreeNode.java | 33 -- .../org/apache/ignite/ml/trees/nodes/Leaf.java | 49 -- .../apache/ignite/ml/trees/nodes/SplitNode.java | 100 .../ignite/ml/trees/nodes/package-info.java | 22 - .../apache/ignite/ml/trees/package-info.java| 22 - .../ml/trees/trainers/columnbased/BiIndex.java | 113 ...exedCacheColumnDecisionTreeTrainerInput.java | 57 -- .../CacheColumnDecisionTreeTrainerInput.java| 141 - .../columnbased/ColumnDecisionTreeTrainer.java | 568 --- .../ColumnDecisionTreeTrainerInput.java | 55 -- .../MatrixColumnDecisionTreeTrainerInput.java | 83 --- .../trainers/columnbased/RegionProjection.java | 109 .../trainers/columnbased/TrainingContext.java | 166 -- .../columnbased/caches/ContextCache.java| 68 --- .../columnbased/caches/FeaturesCache.java | 151 - .../columnbased/caches/ProjectionsCache.java| 286 -- .../trainers/columnbased/caches/SplitCache.java | 206 --- .../columnbased/caches/package-info.java| 22 - .../ContinuousSplitCalculators.java | 34 -- .../contsplitcalcs/GiniSplitCalculator.java | 234 .../contsplitcalcs/VarianceSplitCalculator.java | 179 -- .../contsplitcalcs/package-info.java| 22 - .../trainers/columnbased/package-info.java | 22 - .../columnbased/regcalcs/RegionCalculators.java | 85 --- .../columnbased/regcalcs/package-info.java | 22 - .../vectors/CategoricalFeatureProcessor.java| 212 --- .../vectors/ContinuousFeatureProcessor.java | 111 .../vectors/ContinuousSplitInfo.java| 71 --- .../columnbased/vectors/FeatureProcessor.java | 82 --- .../vectors/FeatureVectorProcessorUtils.java| 57 -- .../columnbased/v
[07/14] ignite git commit: IGNITE-7927 Web Console: Fixed demo for non-collocated joins.
IGNITE-7927 Web Console: Fixed demo for non-collocated joins. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/647620b3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/647620b3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/647620b3 Branch: refs/heads/ignite-8201 Commit: 647620b3ccf204c7bf11c4ff540584d0c99d9a15 Parents: 139c2af Author: Vasiliy Sisko Authored: Tue Apr 10 17:48:52 2018 +0700 Committer: Alexey Kuznetsov Committed: Tue Apr 10 17:48:52 2018 +0700 -- modules/web-console/backend/routes/demo.js | 2 ++ .../demo/service/DemoCachesLoadService.java | 22 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/647620b3/modules/web-console/backend/routes/demo.js -- diff --git a/modules/web-console/backend/routes/demo.js b/modules/web-console/backend/routes/demo.js index a18fa7a..b081d0c 100644 --- a/modules/web-console/backend/routes/demo.js +++ b/modules/web-console/backend/routes/demo.js @@ -95,10 +95,12 @@ module.exports.factory = (errors, settings, mongo, spacesService) => { domain.space = cacheDoc.space; domain.caches.push(cacheDoc._id); +domain.clusters.push(cluster._id); return domain.save() .then((domainDoc) => { cacheDoc.domains.push(domainDoc._id); + cluster.models.push(domainDoc._id); return cacheDoc.save(); }); http://git-wip-us.apache.org/repos/asf/ignite/blob/647620b3/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java -- diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java index 6691d1d..2aace06 100644 --- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java +++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java @@ -269,6 +269,14 @@ public class DemoCachesLoadService implements Service { type.setFields(qryFlds); +// Indexes for DEPARTMENT. + +ArrayList indexes = new ArrayList<>(); + +indexes.add(new QueryIndex("countryId", QueryIndexType.SORTED, false, "DEP_COUNTRY")); + +type.setIndexes(indexes); + ccfg.setQueryEntities(qryEntities); return ccfg; @@ -312,6 +320,11 @@ public class DemoCachesLoadService implements Service { // Indexes for EMPLOYEE. +Collection indexes = new ArrayList<>(); + +indexes.add(new QueryIndex("departmentId", QueryIndexType.SORTED, false, "EMP_DEPARTMENT")); +indexes.add(new QueryIndex("managerId", QueryIndexType.SORTED, false, "EMP_MANAGER")); + QueryIndex idx = new QueryIndex(); idx.setName("EMP_NAMES"); @@ -323,8 +336,6 @@ public class DemoCachesLoadService implements Service { idx.setFields(indFlds); -Collection indexes = new ArrayList<>(); - indexes.add(idx); indexes.add(new QueryIndex("salary", QueryIndexType.SORTED, false, "EMP_SALARY")); @@ -392,6 +403,13 @@ public class DemoCachesLoadService implements Service { type.setFields(qryFlds); +// Indexes for CAR. + +ArrayList indexes = new ArrayList<>(); + +indexes.add(new QueryIndex("parkingId", QueryIndexType.SORTED, false, "CAR_PARKING")); +type.setIndexes(indexes); + ccfg.setQueryEntities(qryEntities); return ccfg;
[12/14] ignite git commit: IGNITE-8101 Ability to terminate system workers by JMX for test purposes.
IGNITE-8101 Ability to terminate system workers by JMX for test purposes. Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a96ac047 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a96ac047 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a96ac047 Branch: refs/heads/ignite-8201 Commit: a96ac04755d2c7448508990fe9e1dad62b90 Parents: 3a71765 Author: Dmitriy Sorokin Authored: Tue Apr 10 22:20:41 2018 +0300 Committer: Andrey Gura Committed: Tue Apr 10 22:20:41 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 7 ++ .../failure/StopNodeOrHaltFailureHandler.java | 2 +- .../ignite/internal/GridKernalContext.java | 8 ++ .../ignite/internal/GridKernalContextImpl.java | 10 +++ .../apache/ignite/internal/IgniteKernal.java| 16 +++- .../discovery/GridDiscoveryManager.java | 2 +- .../GridCachePartitionExchangeManager.java | 3 +- .../cache/GridCacheSharedTtlCleanupManager.java | 3 +- .../wal/reader/StandaloneGridKernalContext.java | 6 ++ .../timeout/GridTimeoutProcessor.java | 3 +- .../ignite/internal/util/IgniteUtils.java | 7 +- .../worker/WorkersControlMXBeanImpl.java| 62 +++ .../ignite/internal/worker/WorkersRegistry.java | 80 .../ignite/internal/worker/package-info.java| 22 ++ .../ignite/mxbean/WorkersControlMXBean.java | 49 15 files changed, 271 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a96ac047/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 152d845..9da123e 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -423,6 +423,13 @@ public final class IgniteSystemProperties { public static final String IGNITE_MBEANS_DISABLED = "IGNITE_MBEANS_DISABLED"; /** + * If property is set to {@code true}, then test features will be enabled. + * + * Default is {@code false}. + */ +public static final String IGNITE_TEST_FEATURES_ENABLED = "IGNITE_TEST_FEATURES_ENABLED"; + +/** * Property controlling size of buffer holding last exception. Default value of {@code 1000}. */ public static final String IGNITE_EXCEPTION_REGISTRY_MAX_SIZE = "IGNITE_EXCEPTION_REGISTRY_MAX_SIZE"; http://git-wip-us.apache.org/repos/asf/ignite/blob/a96ac047/modules/core/src/main/java/org/apache/ignite/failure/StopNodeOrHaltFailureHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/failure/StopNodeOrHaltFailureHandler.java b/modules/core/src/main/java/org/apache/ignite/failure/StopNodeOrHaltFailureHandler.java index 4f74406..3ce4ff6 100644 --- a/modules/core/src/main/java/org/apache/ignite/failure/StopNodeOrHaltFailureHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/failure/StopNodeOrHaltFailureHandler.java @@ -92,7 +92,7 @@ public class StopNodeOrHaltFailureHandler implements FailureHandler { ).start(); } else { -U.error(log, "JVM will be halted immediately on ignite failure: [failureCtx=" + failureCtx + ']'); +U.error(log, "JVM will be halted immediately due to the failure: [failureCtx=" + failureCtx + ']'); Runtime.getRuntime().halt(Ignition.KILL_EXIT_CODE); } http://git-wip-us.apache.org/repos/asf/ignite/blob/a96ac047/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java index 0b40054..505c3d6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java @@ -32,6 +32,7 @@ import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager; import org.apache.ignite.internal.managers.failover.GridFailoverManager; import org.apache.ignite.internal.managers.indexing.GridIndexingManager; import org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerManager; +import org.apache.ignite.internal.worker.WorkersRegistry; import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor; import or
[02/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java new file mode 100644 index 000..3d11d9d --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.tree.impurity.mse; + +import java.util.Random; +import org.junit.Test; + +import static junit.framework.TestCase.assertEquals; + +/** + * Tests for {@link MSEImpurityMeasure}. + */ +public class MSEImpurityMeasureTest { +/** */ +@Test +public void testImpurityOnEmptyData() { +MSEImpurityMeasure impurity = new MSEImpurityMeasure(0, 0, 0, 0, 0, 0); + +assertEquals(0.0, impurity.impurity(), 1e-10); +} + +/** */ +@Test +public void testImpurityLeftPart() { +// Test on left part [1, 2, 2, 1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(8, 12, 6, 0, 0, 0); + +assertEquals(1.333, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testImpurityRightPart() { +// Test on right part [1, 2, 2, 1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(0, 0, 0, 8, 12, 6); + +assertEquals(1.333, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testImpurityLeftAndRightPart() { +// Test on left part [1, 2, 2] and right part [1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(5, 9, 3, 3, 3, 3); + +assertEquals(0.666, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testAdd() { +Random rnd = new Random(0); + +MSEImpurityMeasure a = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure b = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure c = a.add(b); + +assertEquals(a.getLeftY() + b.getLeftY(), c.getLeftY(), 1e-10); +assertEquals(a.getLeftY2() + b.getLeftY2(), c.getLeftY2(), 1e-10); +assertEquals(a.getLeftCnt() + b.getLeftCnt(), c.getLeftCnt()); +assertEquals(a.getRightY() + b.getRightY(), c.getRightY(), 1e-10); +assertEquals(a.getRightY2() + b.getRightY2(), c.getRightY2(), 1e-10); +assertEquals(a.getRightCnt() + b.getRightCnt(), c.getRightCnt()); +} + +/** */ +@Test +public void testSubtract() { +Random rnd = new Random(0); + +MSEImpurityMeasure a = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure b = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure c = a.subtract(b); + +assertEquals(a.getLeftY() - b.getLeftY(), c.getLeftY(), 1e-10); +assertEquals(a.getLeftY2() - b.getLeftY2(), c.getLeftY2(), 1e-10); +assertEquals(a.getLeftCnt() - b.getLeftCnt(), c.getLeftCnt()); +assertEquals(a.getRightY() - b.getRightY(), c.getRightY(), 1e-10); +assertEquals(a.getRightY2() - b.getRightY2(), c.getRightY2(), 1e-10); +assertEquals(a.getRightCnt() - b.getRightCnt(), c.getRightCnt()); +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressorTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressorTest.ja
[14/14] ignite git commit: Merge branches 'ignite-8201' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201
Merge branches 'ignite-8201' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/df938d56 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/df938d56 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/df938d56 Branch: refs/heads/ignite-8201 Commit: df938d562e9fb59938c1628be2163a5c273d21d4 Parents: a808932 f4de6df Author: Alexey Kuznetsov Authored: Wed Apr 11 14:00:06 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 14:00:06 2018 +0700 -- ...ecisionTreeClassificationTrainerExample.java | 147 + .../DecisionTreeRegressionTrainerExample.java | 124 .../ignite/examples/ml/tree/package-info.java | 22 + .../examples/ml/trees/DecisionTreesExample.java | 354 .../ignite/examples/ml/trees/package-info.java | 22 - .../apache/ignite/IgniteSystemProperties.java | 7 + .../failure/StopNodeOrHaltFailureHandler.java | 2 +- .../ignite/internal/GridKernalContext.java | 8 + .../ignite/internal/GridKernalContextImpl.java | 10 + .../apache/ignite/internal/IgniteKernal.java| 16 +- .../org/apache/ignite/internal/IgnitionEx.java | 15 +- .../GridClientConnectionManagerAdapter.java | 6 + .../impl/GridTcpRouterNioListenerAdapter.java | 6 + .../discovery/GridDiscoveryManager.java | 18 +- .../pagemem/impl/PageMemoryNoStoreImpl.java | 17 +- .../GridCachePartitionExchangeManager.java | 15 +- .../cache/GridCacheSharedTtlCleanupManager.java | 44 +- .../GridCacheDatabaseSharedManager.java | 60 +- .../persistence/pagemem/PageMemoryImpl.java | 17 +- .../wal/FileWriteAheadLogManager.java | 157 +++-- .../wal/FsyncModeFileWriteAheadLogManager.java | 34 +- .../wal/reader/StandaloneGridKernalContext.java | 6 + .../timeout/GridTimeoutProcessor.java | 105 ++-- .../ignite/internal/util/IgniteUtils.java | 7 +- .../ignite/internal/util/StripedExecutor.java | 69 ++- .../ignite/internal/util/nio/GridNioServer.java | 43 +- .../util/nio/GridNioServerListener.java | 6 + .../util/nio/GridNioServerListenerAdapter.java | 6 + .../util/nio/ssl/BlockingSslHandler.java| 10 +- .../worker/WorkersControlMXBeanImpl.java| 62 ++ .../ignite/internal/worker/WorkersRegistry.java | 80 +++ .../ignite/internal/worker/package-info.java| 22 + .../ignite/mxbean/WorkersControlMXBean.java | 49 ++ .../communication/tcp/TcpCommunicationSpi.java | 41 +- .../ignite/spi/discovery/tcp/ServerImpl.java| 51 +- .../failure/AbstractFailureHandlerTest.java | 74 +++ .../ignite/failure/IoomFailureHandlerTest.java | 144 + .../cache/CacheGroupsMetricsRebalanceTest.java | 31 +- .../persistence/pagemem/PageMemoryImplTest.java | 9 + .../internal/util/StripedExecutorTest.java | 2 +- .../ignite/testframework/GridTestUtils.java | 2 +- .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + .../main/java/org/apache/ignite/ml/Trainer.java | 3 - .../org/apache/ignite/ml/tree/DecisionTree.java | 252 .../tree/DecisionTreeClassificationTrainer.java | 93 +++ .../ml/tree/DecisionTreeConditionalNode.java| 78 +++ .../ignite/ml/tree/DecisionTreeLeafNode.java| 48 ++ .../apache/ignite/ml/tree/DecisionTreeNode.java | 26 + .../ml/tree/DecisionTreeRegressionTrainer.java | 60 ++ .../org/apache/ignite/ml/tree/TreeFilter.java | 38 ++ .../ignite/ml/tree/data/DecisionTreeData.java | 128 + .../ml/tree/data/DecisionTreeDataBuilder.java | 73 +++ .../ignite/ml/tree/data/package-info.java | 22 + .../ml/tree/impurity/ImpurityMeasure.java | 55 ++ .../impurity/ImpurityMeasureCalculator.java | 38 ++ .../tree/impurity/gini/GiniImpurityMeasure.java | 115 .../gini/GiniImpurityMeasureCalculator.java | 110 .../ml/tree/impurity/gini/package-info.java | 22 + .../tree/impurity/mse/MSEImpurityMeasure.java | 133 + .../mse/MSEImpurityMeasureCalculator.java | 80 +++ .../ml/tree/impurity/mse/package-info.java | 22 + .../ignite/ml/tree/impurity/package-info.java | 22 + .../util/SimpleStepFunctionCompressor.java | 149 + .../ml/tree/impurity/util/StepFunction.java | 162 ++ .../impurity/util/StepFunctionCompressor.java | 55 ++ .../ml/tree/impurity/util/package-info.java | 22 + .../ml/tree/leaf/DecisionTreeLeafBuilder.java | 38 ++ .../tree/leaf/MeanDecisionTreeLeafBuilder.java | 73 +++ .../leaf/MostCommonDecisionTreeLeafBuilder.java | 86 +++ .../ignite/ml/tree/leaf/package-info.java | 22 + .../org/apache/ignite/ml/tree/package-info.java | 22 + .../ignite/ml/trees/CategoricalRegionInfo.java | 72 --- .../ignite/ml/trees/CategoricalSplitInfo.java | 68 --- .../ignite/ml/trees/ContinuousRegionInf
[10/14] ignite git commit: IGNITE-8069 IgniteOutOfMemoryException should be handled accordingly to provided failure handler
IGNITE-8069 IgniteOutOfMemoryException should be handled accordingly to provided failure handler Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9bb4ce8a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9bb4ce8a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9bb4ce8a Branch: refs/heads/ignite-8201 Commit: 9bb4ce8ab9770967d39f0acac5cdc1dc4230abb4 Parents: c807ae9 Author: Aleksey Plekhanov Authored: Tue Apr 10 18:54:03 2018 +0300 Committer: Andrey Gura Committed: Tue Apr 10 18:54:03 2018 +0300 -- .../pagemem/impl/PageMemoryNoStoreImpl.java | 17 ++- .../persistence/pagemem/PageMemoryImpl.java | 17 ++- .../failure/AbstractFailureHandlerTest.java | 74 ++ .../ignite/failure/IoomFailureHandlerTest.java | 144 +++ .../persistence/pagemem/PageMemoryImplTest.java | 9 ++ .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + 6 files changed, 259 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9bb4ce8a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java index 7424af6..d4b22a6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java @@ -28,6 +28,8 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.configuration.DataRegionConfiguration; +import org.apache.ignite.failure.FailureContext; +import org.apache.ignite.failure.FailureType; import org.apache.ignite.internal.mem.DirectMemoryProvider; import org.apache.ignite.internal.mem.DirectMemoryRegion; import org.apache.ignite.internal.mem.IgniteOutOfMemoryException; @@ -158,6 +160,9 @@ public class PageMemoryNoStoreImpl implements PageMemory { /** */ private final boolean trackAcquiredPages; +/** Shared context. */ +private final GridCacheSharedContext ctx; + /** * @param log Logger. * @param directMemoryProvider Memory allocator to use. @@ -184,6 +189,7 @@ public class PageMemoryNoStoreImpl implements PageMemory { this.trackAcquiredPages = trackAcquiredPages; this.memMetrics = memMetrics; this.dataRegionCfg = dataRegionCfg; +this.ctx = sharedCtx; sysPageSize = pageSize + PAGE_OVERHEAD; @@ -288,8 +294,8 @@ public class PageMemoryNoStoreImpl implements PageMemory { } } -if (relPtr == INVALID_REL_PTR) -throw new IgniteOutOfMemoryException("Out of memory in data region [" + +if (relPtr == INVALID_REL_PTR) { +IgniteOutOfMemoryException oom = new IgniteOutOfMemoryException("Out of memory in data region [" + "name=" + dataRegionCfg.getName() + ", initSize=" + U.readableSize(dataRegionCfg.getInitialSize(), false) + ", maxSize=" + U.readableSize(dataRegionCfg.getMaxSize(), false) + @@ -299,6 +305,13 @@ public class PageMemoryNoStoreImpl implements PageMemory { " ^-- Enable eviction or expiration policies" ); +if (ctx != null) +ctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, oom)); + +throw oom; +} + + assert (relPtr & ~PageIdUtils.PAGE_IDX_MASK) == 0 : U.hexLong(relPtr & ~PageIdUtils.PAGE_IDX_MASK); // Assign page ID according to flags and partition ID. http://git-wip-us.apache.org/repos/asf/ignite/blob/9bb4ce8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java index 46fb7dd..4463224 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java @@ -40,6 +40,8 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.configurat
[01/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
Repository: ignite Updated Branches: refs/heads/ignite-8201 a80893232 -> df938d562 http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java -- diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java deleted file mode 100644 index f9117f4..000 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.yardstick.ml.trees; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.BitSet; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.DoubleStream; -import java.util.stream.IntStream; -import java.util.stream.Stream; -import org.apache.ignite.Ignite; -import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.ml.math.StorageConstants; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.exceptions.MathIllegalArgumentException; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix; -import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; -import org.apache.ignite.ml.structures.LabeledVectorDouble; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.models.DecisionTreeModel; -import org.apache.ignite.ml.trees.trainers.columnbased.ColumnDecisionTreeTrainer; -import org.apache.ignite.ml.trees.trainers.columnbased.ColumnDecisionTreeTrainerInput; -import org.apache.ignite.ml.trees.trainers.columnbased.MatrixColumnDecisionTreeTrainerInput; -import org.apache.ignite.ml.util.Utils; - -/** */ -class SplitDataGenerator { -/** */ -private static final Random rnd = new Random(12349L); - -/** */ -private static final double DELTA = 100.0; - -/** Map of the form of (is categorical -> list of region indexes). */ -private final Map> di; - -/** List of regions. */ -private final List regs; - -/** Data of bounds of regions. */ -private final Map> boundsData; - -/** */ -private final Map catFeaturesInfo; - -/** Supplier of vectors. */ -private final Supplier supplier; - -/** Features count. */ -private final int featCnt; - -/** - * Create SplitDataGenerator. - * - * @param featCnt Features count. - * @param catFeaturesInfo Information about categorical features in form of map (feature index -> categories - * count). - * @param supplier Supplier of vectors. - */ -SplitDataGenerator(int featCnt, Map catFeaturesInfo, Supplier supplier) { -regs = new LinkedList<>(); -boundsData = new HashMap<>(); -this.supplier = supplier; -this.featCnt = featCnt; -this.catFeaturesInfo = catFeaturesInfo; - -// Divide indexes into indexes of categorical coordinates and indexes of continuous coordinates. -di = IntStream.range(0, featCnt). -boxed(). -collect(Collectors.partitioningBy(catFeaturesInfo::containsKey)); - -// Categorical coordinates info. -Map catCoords = new HashMap<>(); -di.get(true).forEach(i -> { -BitSet bs = new BitSet(); -bs.set(0, catFeaturesInfo.get(i)); -catCoords.put(i, new CatCoordInfo(bs)); -}); - -// Continuous coordinates info. -Map contCoords = new HashMap<>(); -di.get(false).forEach(i -> { -contCoords.put(i, new ContCoordInfo()); -boundsData.put(i, new IgniteBiTuple<>(-1.0, 1.0)); -
[09/14] ignite git commit: ignite-7772 System workers critical failures handling
ignite-7772 System workers critical failures handling Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c807ae95 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c807ae95 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c807ae95 Branch: refs/heads/ignite-8201 Commit: c807ae952c233cf1a8c0a63d543fafe19c40c6aa Parents: 05d7092 Author: Andrey Kuznetsov Authored: Tue Apr 10 17:30:12 2018 +0300 Committer: Andrey Gura Committed: Tue Apr 10 17:30:12 2018 +0300 -- .../org/apache/ignite/internal/IgnitionEx.java | 15 +- .../GridClientConnectionManagerAdapter.java | 6 + .../impl/GridTcpRouterNioListenerAdapter.java | 6 + .../discovery/GridDiscoveryManager.java | 16 +- .../GridCachePartitionExchangeManager.java | 12 +- .../cache/GridCacheSharedTtlCleanupManager.java | 41 +++-- .../GridCacheDatabaseSharedManager.java | 60 +-- .../wal/FileWriteAheadLogManager.java | 157 --- .../wal/FsyncModeFileWriteAheadLogManager.java | 34 +++- .../timeout/GridTimeoutProcessor.java | 102 +++- .../ignite/internal/util/StripedExecutor.java | 69 +--- .../ignite/internal/util/nio/GridNioServer.java | 43 - .../util/nio/GridNioServerListener.java | 6 + .../util/nio/GridNioServerListenerAdapter.java | 6 + .../communication/tcp/TcpCommunicationSpi.java | 41 - .../ignite/spi/discovery/tcp/ServerImpl.java| 51 +- .../internal/util/StripedExecutorTest.java | 2 +- 17 files changed, 501 insertions(+), 166 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c807ae95/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index 417ba1e..10a0752 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -137,6 +137,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; import static org.apache.ignite.configuration.IgniteConfiguration.DFLT_THREAD_KEEP_ALIVE_TIME; import static org.apache.ignite.configuration.MemoryConfiguration.DFLT_MEMORY_POLICY_MAX_SIZE; import static org.apache.ignite.configuration.MemoryConfiguration.DFLT_MEM_PLC_DEFAULT_NAME; +import static org.apache.ignite.failure.FailureType.SYSTEM_WORKER_TERMINATION; import static org.apache.ignite.internal.IgniteComponentType.SPRING; import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.RESTART_JVM; @@ -1806,7 +1807,13 @@ public class IgnitionEx { cfg.getStripedPoolSize(), cfg.getIgniteInstanceName(), "sys", -log); +log, +new Thread.UncaughtExceptionHandler() { +@Override public void uncaughtException(Thread thread, Throwable t) { +if (grid != null) +grid.context().failure().process(new FailureContext(SYSTEM_WORKER_TERMINATION, t)); +} +}); // Note that since we use 'LinkedBlockingQueue', number of // maximum threads has no effect. @@ -1846,6 +1853,12 @@ public class IgnitionEx { cfg.getIgniteInstanceName(), "data-streamer", log, +new Thread.UncaughtExceptionHandler() { +@Override public void uncaughtException(Thread thread, Throwable t) { +if (grid != null) +grid.context().failure().process(new FailureContext(SYSTEM_WORKER_TERMINATION, t)); +} +}, true); // Note that we do not pre-start threads here as igfs pool may not be needed. http://git-wip-us.apache.org/repos/asf/ignite/blob/c807ae95/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index 829b188..fe0453f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/
[11/14] ignite git commit: IGNITE-6430 Complete failing test early
IGNITE-6430 Complete failing test early Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3a717658 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3a717658 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3a717658 Branch: refs/heads/ignite-8201 Commit: 3a7176582d622fc8a52a730f2a3f1e4b4319e4a3 Parents: 9bb4ce8 Author: Alexey Goncharuk Authored: Tue Apr 10 20:33:47 2018 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 10 20:33:47 2018 +0300 -- .../cache/CacheGroupsMetricsRebalanceTest.java | 31 1 file changed, 18 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3a717658/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java index 89c8236..ceb9852 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java @@ -227,29 +227,34 @@ public class CacheGroupsMetricsRebalanceTest extends GridCommonAbstractTest { System.out.println("Wait until keys left will be less " + keysLine); -while (finishRebalanceLatch.getCount() != 0) { -CacheMetrics m = ig2.cache(CACHE1).localMetrics(); +try { +while (finishRebalanceLatch.getCount() != 0) { +CacheMetrics m = ig2.cache(CACHE1).localMetrics(); -long keyLeft = m.getKeysToRebalanceLeft(); +long keyLeft = m.getKeysToRebalanceLeft(); -if (keyLeft > 0 && keyLeft < keysLine) -latch.countDown(); +if (keyLeft > 0 && keyLeft < keysLine) +latch.countDown(); -System.out.println("Keys left: " + m.getKeysToRebalanceLeft()); +System.out.println("Keys left: " + m.getKeysToRebalanceLeft()); -try { -Thread.sleep(1_000); -} -catch (InterruptedException e) { -System.out.println("Interrupt thread: " + e.getMessage()); +try { +Thread.sleep(1_000); +} +catch (InterruptedException e) { +System.out.println("Interrupt thread: " + e.getMessage()); -Thread.currentThread().interrupt(); +Thread.currentThread().interrupt(); +} } } +finally { +latch.countDown(); +} } }); -latch.await(); +assertTrue(latch.await(getTestTimeout(), TimeUnit.MILLISECONDS)); long finishTime = ig2.cache(CACHE1).localMetrics().getEstimatedRebalancingFinishTime();
[03/14] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/139c2af6/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java deleted file mode 100644 index 66c54f2..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.ml.trees.trainers.columnbased.contsplitcalcs; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.PrimitiveIterator; -import java.util.stream.DoubleStream; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.ContinuousSplitInfo; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.SplitInfo; - -/** - * Calculator of variance in a given region. - */ -public class VarianceSplitCalculator implements ContinuousSplitCalculator { -/** - * Data used in variance calculations. - */ -public static class VarianceData extends ContinuousRegionInfo { -/** Mean value in a given region. */ -double mean; - -/** - * @param var Variance in this region. - * @param size Size of data for which variance is calculated. - * @param mean Mean value in this region. - */ -public VarianceData(double var, int size, double mean) { -super(var, size); -this.mean = mean; -} - -/** - * No-op constructor. For serialization/deserialization. - */ -public VarianceData() { -// No-op. -} - -/** {@inheritDoc} */ -@Override public void writeExternal(ObjectOutput out) throws IOException { -super.writeExternal(out); -out.writeDouble(mean); -} - -/** {@inheritDoc} */ -@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { -super.readExternal(in); -mean = in.readDouble(); -} - -/** - * Returns mean. - */ -public double mean() { -return mean; -} -} - -/** {@inheritDoc} */ -@Override public VarianceData calculateRegionInfo(DoubleStream s, int size) { -PrimitiveIterator.OfDouble itr = s.iterator(); -int i = 0; - -double mean = 0.0; -double m2 = 0.0; - -// Here we calculate variance and mean by incremental computation. -while (itr.hasNext()) { -i++; -double x = itr.next(); -double delta = x - mean; -mean += delta / i; -double delta2 = x - mean; -m2 += delta * delta2; -} - -return new VarianceData(m2 / i, size, mean); -} - -/** {@inheritDoc} */ -@Override public SplitInfo splitRegion(Integer[] s, double[] values, double[] labels, int regionIdx, -VarianceData d) { -int size = d.getSize(); - -double lm2 = 0.0; -double rm2 = d.impurity() * size; -int lSize = size; - -double lMean = 0.0; -double rMean = d.mean; - -double minImpurity = d.impurity() * size; -double curThreshold; -double curImpurity; -double threshold = Double.NEGATIVE_INFINITY; - -int i = 0; -int nextIdx = s[0]; -i++; -double[] lrImps = new double[] {lm2, rm2, lMean, rMean}; - -do { -// Process all values equal to prev. -while (i < s.length) { -moveLeft(labels[nextIdx], lrImps[2], i, lrImps[0], lrImps[3], size - i, lrImps[1], lrImps); -curImpurity = (lrImps[0] + lrImps[1]); -
[08/14] ignite git commit: IGNITE-8025 Future must fail if assertion error has been thrown in the worker thread
IGNITE-8025 Future must fail if assertion error has been thrown in the worker thread Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/05d7092e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/05d7092e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/05d7092e Branch: refs/heads/ignite-8201 Commit: 05d7092e255295cf6b78b9d9082ad9eab5e8a246 Parents: 647620b Author: Alexey Goncharuk Authored: Tue Apr 10 16:22:28 2018 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 10 16:23:06 2018 +0300 -- .../test/java/org/apache/ignite/testframework/GridTestUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/05d7092e/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java index 4e9a7c2..e6c6657 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java @@ -814,7 +814,7 @@ public final class GridTestUtils { catch (IgniteFutureCancelledCheckedException e) { resFut.onCancelled(); } -catch (IgniteCheckedException e) { +catch (Throwable e) { resFut.onDone(e); } });
[2/2] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
IGNITE-7871 Implemented additional synchronization phase for correct partition counters update Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/da77b981 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/da77b981 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/da77b981 Branch: refs/heads/master Commit: da77b9818a70495b7afdf6899ebd9180dadd7f68 Parents: f4de6df Author: Pavel Kovalenko Authored: Wed Apr 11 11:23:46 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 11:23:46 2018 +0300 -- .../org/apache/ignite/internal/GridTopic.java | 5 +- .../communication/GridIoMessageFactory.java | 6 + .../discovery/GridDiscoveryManager.java | 10 + .../MetaPageUpdatePartitionDataRecord.java | 2 +- .../processors/cache/CacheMetricsImpl.java | 2 +- .../processors/cache/GridCacheMvccManager.java | 38 + .../GridCachePartitionExchangeManager.java | 17 + .../cache/GridCacheSharedContext.java | 9 +- .../processors/cache/GridCacheUtils.java| 2 +- .../cache/IgniteCacheOffheapManager.java| 8 +- .../cache/IgniteCacheOffheapManagerImpl.java| 10 +- .../dht/GridClientPartitionTopology.java| 5 + .../distributed/dht/GridDhtLocalPartition.java | 9 +- .../dht/GridDhtPartitionTopology.java | 6 + .../dht/GridDhtPartitionTopologyImpl.java | 26 +- .../dht/GridDhtPartitionsStateValidator.java| 255 +++ .../cache/distributed/dht/GridDhtTxLocal.java | 5 + .../GridDhtPartitionsExchangeFuture.java| 96 ++- .../GridDhtPartitionsSingleMessage.java | 68 +- .../dht/preloader/InitNewCoordinatorFuture.java | 2 +- .../preloader/latch/ExchangeLatchManager.java | 695 +++ .../distributed/dht/preloader/latch/Latch.java | 52 ++ .../dht/preloader/latch/LatchAckMessage.java| 165 + .../cache/distributed/near/GridNearTxLocal.java | 10 + .../persistence/GridCacheOffheapManager.java| 10 +- .../cache/transactions/IgniteTxAdapter.java | 2 +- .../cache/transactions/IgniteTxManager.java | 36 +- ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 2 +- .../processors/cache/IgniteCacheGroupsTest.java | 1 + ...ExchangeLatchManagerCoordinatorFailTest.java | 244 +++ .../GridCachePartitionsStateValidationTest.java | 316 + ...idCachePartitionsStateValidatorSelfTest.java | 158 + .../TxOptimisticOnPartitionExchangeTest.java| 322 + .../ignite/testsuites/IgniteCacheTestSuite.java | 4 + .../testsuites/IgniteCacheTestSuite6.java | 6 + 35 files changed, 2568 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java index 1227e8c..0b2d41a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java @@ -124,7 +124,10 @@ public enum GridTopic { TOPIC_METRICS, /** */ -TOPIC_AUTH; +TOPIC_AUTH, + +/** */ +TOPIC_EXCHANGE; /** Enum values. */ private static final GridTopic[] VALS = values(); http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java index 5616fd0..581c32e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java @@ -53,6 +53,7 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl; import org.apache.ignite.internal.processors.cache.WalStateAckMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataRequestMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataResponseMessage; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.LatchAckMessage; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTtlUpdateRequest; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryRequest; import org.apache.ignite.internal.processors.cac
[1/2] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
Repository: ignite Updated Branches: refs/heads/master f4de6df71 -> da77b9818 http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java new file mode 100644 index 000..bad1b61 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java @@ -0,0 +1,165 @@ +/* + * 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. + */ +package org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch; + +import java.nio.ByteBuffer; +import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageReader; +import org.apache.ignite.plugin.extensions.communication.MessageWriter; + +/** + * Message is used to send acks for {@link Latch} instances management. + */ +public class LatchAckMessage implements Message { +/** */ +private static final long serialVersionUID = 0L; + +/** Latch id. */ +private String latchId; + +/** Latch topology version. */ +private AffinityTopologyVersion topVer; + +/** Flag indicates that ack is final. */ +private boolean isFinal; + +/** + * Constructor. + * + * @param latchId Latch id. + * @param topVer Latch topology version. + * @param isFinal Final acknowledgement flag. + */ +public LatchAckMessage(String latchId, AffinityTopologyVersion topVer, boolean isFinal) { +this.latchId = latchId; +this.topVer = topVer; +this.isFinal = isFinal; +} + +/** + * Empty constructor for marshalling purposes. + */ +public LatchAckMessage() { +} + +/** + * @return Latch id. + */ +public String latchId() { +return latchId; +} + +/** + * @return Latch topology version. + */ +public AffinityTopologyVersion topVer() { +return topVer; +} + +/** + * @return {@code} if ack is final. + */ +public boolean isFinal() { +return isFinal; +} + +/** {@inheritDoc} */ +@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { +writer.setBuffer(buf); + +if (!writer.isHeaderWritten()) { +if (!writer.writeHeader(directType(), fieldsCount())) +return false; + +writer.onHeaderWritten(); +} + +switch (writer.state()) { +case 0: +if (!writer.writeBoolean("isFinal", isFinal)) +return false; + +writer.incrementState(); + +case 1: +if (!writer.writeString("latchId", latchId)) +return false; + +writer.incrementState(); + +case 2: +if (!writer.writeMessage("topVer", topVer)) +return false; + +writer.incrementState(); +} + +return true; +} + +/** {@inheritDoc} */ +@Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { +reader.setBuffer(buf); + +if (!reader.beforeMessageRead()) +return false; + +switch (reader.state()) { +case 0: +isFinal = reader.readBoolean("isFinal"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 1: +latchId = reader.readString("latchId"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 2: +topVer = reader.readMessage("topVer"); + +if (!reader.isLastRead()) +
[2/2] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
IGNITE-7871 Implemented additional synchronization phase for correct partition counters update Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b4cc9f2d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b4cc9f2d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b4cc9f2d Branch: refs/heads/ignite-2.5 Commit: b4cc9f2d45d78c360abe224165e707c23533469e Parents: b4cb2f0 Author: Pavel Kovalenko Authored: Wed Apr 11 11:23:46 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 11:30:27 2018 +0300 -- .../org/apache/ignite/internal/GridTopic.java | 5 +- .../communication/GridIoMessageFactory.java | 6 + .../discovery/GridDiscoveryManager.java | 10 + .../MetaPageUpdatePartitionDataRecord.java | 2 +- .../processors/cache/CacheMetricsImpl.java | 2 +- .../processors/cache/GridCacheMvccManager.java | 38 + .../GridCachePartitionExchangeManager.java | 17 + .../cache/GridCacheSharedContext.java | 9 +- .../processors/cache/GridCacheUtils.java| 2 +- .../cache/IgniteCacheOffheapManager.java| 8 +- .../cache/IgniteCacheOffheapManagerImpl.java| 10 +- .../dht/GridClientPartitionTopology.java| 5 + .../distributed/dht/GridDhtLocalPartition.java | 9 +- .../dht/GridDhtPartitionTopology.java | 6 + .../dht/GridDhtPartitionTopologyImpl.java | 26 +- .../dht/GridDhtPartitionsStateValidator.java| 255 +++ .../cache/distributed/dht/GridDhtTxLocal.java | 5 + .../GridDhtPartitionsExchangeFuture.java| 96 ++- .../GridDhtPartitionsSingleMessage.java | 68 +- .../dht/preloader/InitNewCoordinatorFuture.java | 2 +- .../preloader/latch/ExchangeLatchManager.java | 695 +++ .../distributed/dht/preloader/latch/Latch.java | 52 ++ .../dht/preloader/latch/LatchAckMessage.java| 165 + .../cache/distributed/near/GridNearTxLocal.java | 10 + .../persistence/GridCacheOffheapManager.java| 10 +- .../cache/transactions/IgniteTxAdapter.java | 2 +- .../cache/transactions/IgniteTxManager.java | 36 +- ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 2 +- .../processors/cache/IgniteCacheGroupsTest.java | 1 + ...ExchangeLatchManagerCoordinatorFailTest.java | 244 +++ .../GridCachePartitionsStateValidationTest.java | 316 + ...idCachePartitionsStateValidatorSelfTest.java | 158 + .../TxOptimisticOnPartitionExchangeTest.java| 322 + .../ignite/testsuites/IgniteCacheTestSuite.java | 4 + .../testsuites/IgniteCacheTestSuite6.java | 6 + 35 files changed, 2568 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b4cc9f2d/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java index 1227e8c..0b2d41a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java @@ -124,7 +124,10 @@ public enum GridTopic { TOPIC_METRICS, /** */ -TOPIC_AUTH; +TOPIC_AUTH, + +/** */ +TOPIC_EXCHANGE; /** Enum values. */ private static final GridTopic[] VALS = values(); http://git-wip-us.apache.org/repos/asf/ignite/blob/b4cc9f2d/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java index 5616fd0..581c32e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java @@ -53,6 +53,7 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl; import org.apache.ignite.internal.processors.cache.WalStateAckMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataRequestMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataResponseMessage; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.LatchAckMessage; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTtlUpdateRequest; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryRequest; import org.apache.ignite.internal.processors
[1/2] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
Repository: ignite Updated Branches: refs/heads/ignite-2.5 b4cb2f0df -> b4cc9f2d4 http://git-wip-us.apache.org/repos/asf/ignite/blob/b4cc9f2d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java new file mode 100644 index 000..bad1b61 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java @@ -0,0 +1,165 @@ +/* + * 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. + */ +package org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch; + +import java.nio.ByteBuffer; +import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageReader; +import org.apache.ignite.plugin.extensions.communication.MessageWriter; + +/** + * Message is used to send acks for {@link Latch} instances management. + */ +public class LatchAckMessage implements Message { +/** */ +private static final long serialVersionUID = 0L; + +/** Latch id. */ +private String latchId; + +/** Latch topology version. */ +private AffinityTopologyVersion topVer; + +/** Flag indicates that ack is final. */ +private boolean isFinal; + +/** + * Constructor. + * + * @param latchId Latch id. + * @param topVer Latch topology version. + * @param isFinal Final acknowledgement flag. + */ +public LatchAckMessage(String latchId, AffinityTopologyVersion topVer, boolean isFinal) { +this.latchId = latchId; +this.topVer = topVer; +this.isFinal = isFinal; +} + +/** + * Empty constructor for marshalling purposes. + */ +public LatchAckMessage() { +} + +/** + * @return Latch id. + */ +public String latchId() { +return latchId; +} + +/** + * @return Latch topology version. + */ +public AffinityTopologyVersion topVer() { +return topVer; +} + +/** + * @return {@code} if ack is final. + */ +public boolean isFinal() { +return isFinal; +} + +/** {@inheritDoc} */ +@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { +writer.setBuffer(buf); + +if (!writer.isHeaderWritten()) { +if (!writer.writeHeader(directType(), fieldsCount())) +return false; + +writer.onHeaderWritten(); +} + +switch (writer.state()) { +case 0: +if (!writer.writeBoolean("isFinal", isFinal)) +return false; + +writer.incrementState(); + +case 1: +if (!writer.writeString("latchId", latchId)) +return false; + +writer.incrementState(); + +case 2: +if (!writer.writeMessage("topVer", topVer)) +return false; + +writer.incrementState(); +} + +return true; +} + +/** {@inheritDoc} */ +@Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { +reader.setBuffer(buf); + +if (!reader.beforeMessageRead()) +return false; + +switch (reader.state()) { +case 0: +isFinal = reader.readBoolean("isFinal"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 1: +latchId = reader.readString("latchId"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 2: +topVer = reader.readMessage("topVer"); + +if (!reader.isLastRead()
ignite git commit: IGNITE-7222 .NET: Ignore missing IgniteConfiguration.CommunicationFailureResolver
Repository: ignite Updated Branches: refs/heads/master da77b9818 -> 780fc07be IGNITE-7222 .NET: Ignore missing IgniteConfiguration.CommunicationFailureResolver Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/780fc07b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/780fc07b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/780fc07b Branch: refs/heads/master Commit: 780fc07be0b257b578647682585c89548e6d695d Parents: da77b98 Author: Pavel Tupitsyn Authored: Wed Apr 11 11:51:45 2018 +0300 Committer: Pavel Tupitsyn Committed: Wed Apr 11 11:51:45 2018 +0300 -- .../ApiParity/IgniteConfigurationParityTest.cs| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/780fc07b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs index d68083f..bf34fc0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs @@ -63,7 +63,8 @@ namespace Apache.Ignite.Core.Tests.ApiParity "ClassLoader", "CacheStoreSessionListenerFactories", "PlatformConfiguration", -"ExecutorConfiguration" +"ExecutorConfiguration", +"CommunicationFailureResolver" }; /** Properties that are missing on .NET side. */
[2/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java new file mode 100644 index 000..3d11d9d --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureTest.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.tree.impurity.mse; + +import java.util.Random; +import org.junit.Test; + +import static junit.framework.TestCase.assertEquals; + +/** + * Tests for {@link MSEImpurityMeasure}. + */ +public class MSEImpurityMeasureTest { +/** */ +@Test +public void testImpurityOnEmptyData() { +MSEImpurityMeasure impurity = new MSEImpurityMeasure(0, 0, 0, 0, 0, 0); + +assertEquals(0.0, impurity.impurity(), 1e-10); +} + +/** */ +@Test +public void testImpurityLeftPart() { +// Test on left part [1, 2, 2, 1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(8, 12, 6, 0, 0, 0); + +assertEquals(1.333, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testImpurityRightPart() { +// Test on right part [1, 2, 2, 1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(0, 0, 0, 8, 12, 6); + +assertEquals(1.333, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testImpurityLeftAndRightPart() { +// Test on left part [1, 2, 2] and right part [1, 1, 1]. +MSEImpurityMeasure impurity = new MSEImpurityMeasure(5, 9, 3, 3, 3, 3); + +assertEquals(0.666, impurity.impurity(), 1e-3); +} + +/** */ +@Test +public void testAdd() { +Random rnd = new Random(0); + +MSEImpurityMeasure a = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure b = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure c = a.add(b); + +assertEquals(a.getLeftY() + b.getLeftY(), c.getLeftY(), 1e-10); +assertEquals(a.getLeftY2() + b.getLeftY2(), c.getLeftY2(), 1e-10); +assertEquals(a.getLeftCnt() + b.getLeftCnt(), c.getLeftCnt()); +assertEquals(a.getRightY() + b.getRightY(), c.getRightY(), 1e-10); +assertEquals(a.getRightY2() + b.getRightY2(), c.getRightY2(), 1e-10); +assertEquals(a.getRightCnt() + b.getRightCnt(), c.getRightCnt()); +} + +/** */ +@Test +public void testSubtract() { +Random rnd = new Random(0); + +MSEImpurityMeasure a = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure b = new MSEImpurityMeasure( +rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt(), rnd.nextDouble(), rnd.nextDouble(), rnd.nextInt() +); + +MSEImpurityMeasure c = a.subtract(b); + +assertEquals(a.getLeftY() - b.getLeftY(), c.getLeftY(), 1e-10); +assertEquals(a.getLeftY2() - b.getLeftY2(), c.getLeftY2(), 1e-10); +assertEquals(a.getLeftCnt() - b.getLeftCnt(), c.getLeftCnt()); +assertEquals(a.getRightY() - b.getRightY(), c.getRightY(), 1e-10); +assertEquals(a.getRightY2() - b.getRightY2(), c.getRightY2(), 1e-10); +assertEquals(a.getRightCnt() - b.getRightCnt(), c.getRightCnt()); +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressorTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/util/SimpleStepFunctionCompressorTest.ja
[6/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
IGNITE-8059: Integrate decision tree with partition based dataset. this closes #3760 (cherry picked from commit 139c2af) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9abfee69 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9abfee69 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9abfee69 Branch: refs/heads/ignite-2.5 Commit: 9abfee69aa153888456f9e8574ece1f2d0cbe4d9 Parents: b4cc9f2 Author: dmitrievanthony Authored: Tue Apr 10 12:46:43 2018 +0300 Committer: YuriBabak Committed: Wed Apr 11 12:20:51 2018 +0300 -- ...ecisionTreeClassificationTrainerExample.java | 147 + .../DecisionTreeRegressionTrainerExample.java | 124 .../ignite/examples/ml/tree/package-info.java | 22 + .../examples/ml/trees/DecisionTreesExample.java | 354 .../ignite/examples/ml/trees/package-info.java | 22 - .../main/java/org/apache/ignite/ml/Trainer.java | 3 - .../org/apache/ignite/ml/tree/DecisionTree.java | 252 .../tree/DecisionTreeClassificationTrainer.java | 93 +++ .../ml/tree/DecisionTreeConditionalNode.java| 78 +++ .../ignite/ml/tree/DecisionTreeLeafNode.java| 48 ++ .../apache/ignite/ml/tree/DecisionTreeNode.java | 26 + .../ml/tree/DecisionTreeRegressionTrainer.java | 60 ++ .../org/apache/ignite/ml/tree/TreeFilter.java | 38 ++ .../ignite/ml/tree/data/DecisionTreeData.java | 128 + .../ml/tree/data/DecisionTreeDataBuilder.java | 73 +++ .../ignite/ml/tree/data/package-info.java | 22 + .../ml/tree/impurity/ImpurityMeasure.java | 55 ++ .../impurity/ImpurityMeasureCalculator.java | 38 ++ .../tree/impurity/gini/GiniImpurityMeasure.java | 115 .../gini/GiniImpurityMeasureCalculator.java | 110 .../ml/tree/impurity/gini/package-info.java | 22 + .../tree/impurity/mse/MSEImpurityMeasure.java | 133 + .../mse/MSEImpurityMeasureCalculator.java | 80 +++ .../ml/tree/impurity/mse/package-info.java | 22 + .../ignite/ml/tree/impurity/package-info.java | 22 + .../util/SimpleStepFunctionCompressor.java | 149 + .../ml/tree/impurity/util/StepFunction.java | 162 ++ .../impurity/util/StepFunctionCompressor.java | 55 ++ .../ml/tree/impurity/util/package-info.java | 22 + .../ml/tree/leaf/DecisionTreeLeafBuilder.java | 38 ++ .../tree/leaf/MeanDecisionTreeLeafBuilder.java | 73 +++ .../leaf/MostCommonDecisionTreeLeafBuilder.java | 86 +++ .../ignite/ml/tree/leaf/package-info.java | 22 + .../org/apache/ignite/ml/tree/package-info.java | 22 + .../ignite/ml/trees/CategoricalRegionInfo.java | 72 --- .../ignite/ml/trees/CategoricalSplitInfo.java | 68 --- .../ignite/ml/trees/ContinuousRegionInfo.java | 74 --- .../ml/trees/ContinuousSplitCalculator.java | 51 -- .../org/apache/ignite/ml/trees/RegionInfo.java | 62 -- .../ml/trees/models/DecisionTreeModel.java | 44 -- .../ignite/ml/trees/models/package-info.java| 22 - .../ml/trees/nodes/CategoricalSplitNode.java| 50 -- .../ml/trees/nodes/ContinuousSplitNode.java | 56 -- .../ignite/ml/trees/nodes/DecisionTreeNode.java | 33 -- .../org/apache/ignite/ml/trees/nodes/Leaf.java | 49 -- .../apache/ignite/ml/trees/nodes/SplitNode.java | 100 .../ignite/ml/trees/nodes/package-info.java | 22 - .../apache/ignite/ml/trees/package-info.java| 22 - .../ml/trees/trainers/columnbased/BiIndex.java | 113 ...exedCacheColumnDecisionTreeTrainerInput.java | 57 -- .../CacheColumnDecisionTreeTrainerInput.java| 141 - .../columnbased/ColumnDecisionTreeTrainer.java | 568 --- .../ColumnDecisionTreeTrainerInput.java | 55 -- .../MatrixColumnDecisionTreeTrainerInput.java | 83 --- .../trainers/columnbased/RegionProjection.java | 109 .../trainers/columnbased/TrainingContext.java | 166 -- .../columnbased/caches/ContextCache.java| 68 --- .../columnbased/caches/FeaturesCache.java | 151 - .../columnbased/caches/ProjectionsCache.java| 286 -- .../trainers/columnbased/caches/SplitCache.java | 206 --- .../columnbased/caches/package-info.java| 22 - .../ContinuousSplitCalculators.java | 34 -- .../contsplitcalcs/GiniSplitCalculator.java | 234 .../contsplitcalcs/VarianceSplitCalculator.java | 179 -- .../contsplitcalcs/package-info.java| 22 - .../trainers/columnbased/package-info.java | 22 - .../columnbased/regcalcs/RegionCalculators.java | 85 --- .../columnbased/regcalcs/package-info.java | 22 - .../vectors/CategoricalFeatureProcessor.java| 212 --- .../vectors/ContinuousFeatureProcessor.java | 111 .../vectors/ContinuousSplitInfo.java| 71 --- .../columnbased/vectors/FeatureProcessor.java | 82 --- .../vectors/FeatureVectorProcessorUtils
[1/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 b4cc9f2d4 -> 9abfee69a http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java -- diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java deleted file mode 100644 index f9117f4..000 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/trees/SplitDataGenerator.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.yardstick.ml.trees; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.BitSet; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.DoubleStream; -import java.util.stream.IntStream; -import java.util.stream.Stream; -import org.apache.ignite.Ignite; -import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.ml.math.StorageConstants; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.exceptions.MathIllegalArgumentException; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix; -import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; -import org.apache.ignite.ml.structures.LabeledVectorDouble; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.models.DecisionTreeModel; -import org.apache.ignite.ml.trees.trainers.columnbased.ColumnDecisionTreeTrainer; -import org.apache.ignite.ml.trees.trainers.columnbased.ColumnDecisionTreeTrainerInput; -import org.apache.ignite.ml.trees.trainers.columnbased.MatrixColumnDecisionTreeTrainerInput; -import org.apache.ignite.ml.util.Utils; - -/** */ -class SplitDataGenerator { -/** */ -private static final Random rnd = new Random(12349L); - -/** */ -private static final double DELTA = 100.0; - -/** Map of the form of (is categorical -> list of region indexes). */ -private final Map> di; - -/** List of regions. */ -private final List regs; - -/** Data of bounds of regions. */ -private final Map> boundsData; - -/** */ -private final Map catFeaturesInfo; - -/** Supplier of vectors. */ -private final Supplier supplier; - -/** Features count. */ -private final int featCnt; - -/** - * Create SplitDataGenerator. - * - * @param featCnt Features count. - * @param catFeaturesInfo Information about categorical features in form of map (feature index -> categories - * count). - * @param supplier Supplier of vectors. - */ -SplitDataGenerator(int featCnt, Map catFeaturesInfo, Supplier supplier) { -regs = new LinkedList<>(); -boundsData = new HashMap<>(); -this.supplier = supplier; -this.featCnt = featCnt; -this.catFeaturesInfo = catFeaturesInfo; - -// Divide indexes into indexes of categorical coordinates and indexes of continuous coordinates. -di = IntStream.range(0, featCnt). -boxed(). -collect(Collectors.partitioningBy(catFeaturesInfo::containsKey)); - -// Categorical coordinates info. -Map catCoords = new HashMap<>(); -di.get(true).forEach(i -> { -BitSet bs = new BitSet(); -bs.set(0, catFeaturesInfo.get(i)); -catCoords.put(i, new CatCoordInfo(bs)); -}); - -// Continuous coordinates info. -Map contCoords = new HashMap<>(); -di.get(false).forEach(i -> { -contCoords.put(i, new ContCoordInfo()); -boundsData.put(i, new IgniteBiTuple<>(-1.0, 1.0)); -
[3/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java deleted file mode 100644 index 66c54f2..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/contsplitcalcs/VarianceSplitCalculator.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.ml.trees.trainers.columnbased.contsplitcalcs; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.PrimitiveIterator; -import java.util.stream.DoubleStream; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.ContinuousSplitInfo; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.SplitInfo; - -/** - * Calculator of variance in a given region. - */ -public class VarianceSplitCalculator implements ContinuousSplitCalculator { -/** - * Data used in variance calculations. - */ -public static class VarianceData extends ContinuousRegionInfo { -/** Mean value in a given region. */ -double mean; - -/** - * @param var Variance in this region. - * @param size Size of data for which variance is calculated. - * @param mean Mean value in this region. - */ -public VarianceData(double var, int size, double mean) { -super(var, size); -this.mean = mean; -} - -/** - * No-op constructor. For serialization/deserialization. - */ -public VarianceData() { -// No-op. -} - -/** {@inheritDoc} */ -@Override public void writeExternal(ObjectOutput out) throws IOException { -super.writeExternal(out); -out.writeDouble(mean); -} - -/** {@inheritDoc} */ -@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { -super.readExternal(in); -mean = in.readDouble(); -} - -/** - * Returns mean. - */ -public double mean() { -return mean; -} -} - -/** {@inheritDoc} */ -@Override public VarianceData calculateRegionInfo(DoubleStream s, int size) { -PrimitiveIterator.OfDouble itr = s.iterator(); -int i = 0; - -double mean = 0.0; -double m2 = 0.0; - -// Here we calculate variance and mean by incremental computation. -while (itr.hasNext()) { -i++; -double x = itr.next(); -double delta = x - mean; -mean += delta / i; -double delta2 = x - mean; -m2 += delta * delta2; -} - -return new VarianceData(m2 / i, size, mean); -} - -/** {@inheritDoc} */ -@Override public SplitInfo splitRegion(Integer[] s, double[] values, double[] labels, int regionIdx, -VarianceData d) { -int size = d.getSize(); - -double lm2 = 0.0; -double rm2 = d.impurity() * size; -int lSize = size; - -double lMean = 0.0; -double rMean = d.mean; - -double minImpurity = d.impurity() * size; -double curThreshold; -double curImpurity; -double threshold = Double.NEGATIVE_INFINITY; - -int i = 0; -int nextIdx = s[0]; -i++; -double[] lrImps = new double[] {lm2, rm2, lMean, rMean}; - -do { -// Process all values equal to prev. -while (i < s.length) { -moveLeft(labels[nextIdx], lrImps[2], i, lrImps[0], lrImps[3], size - i, lrImps[1], lrImps); -curImpurity = (lrImps[0] + lrImps[1]); -
[5/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java b/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java new file mode 100644 index 000..3fc8515 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasure.java @@ -0,0 +1,133 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.tree.impurity.mse; + +import org.apache.ignite.ml.tree.impurity.ImpurityMeasure; + +/** + * Mean squared error (variance) impurity measure which is calculated the following way: + * {@code \frac{1}{L}\sum_{i=0}^{n}(y_i - \mu)^2}. + */ +public class MSEImpurityMeasure implements ImpurityMeasure { +/** */ +private static final long serialVersionUID = 4536394578628409689L; + +/** Sum of all elements in the left part. */ +private final double leftY; + +/** Sum of all squared elements in the left part. */ +private final double leftY2; + +/** Number of elements in the left part. */ +private final long leftCnt; + +/** Sum of all elements in the right part. */ +private final double rightY; + +/** Sum of all squared elements in the right part. */ +private final double rightY2; + +/** Number of elements in the right part. */ +private final long rightCnt; + +/** + * Constructs a new instance of mean squared error (variance) impurity measure. + * + * @param leftY Sum of all elements in the left part. + * @param leftY2 Sum of all squared elements in the left part. + * @param leftCnt Number of elements in the left part. + * @param rightY Sum of all elements in the right part. + * @param rightY2 Sum of all squared elements in the right part. + * @param rightCnt Number of elements in the right part. + */ +public MSEImpurityMeasure(double leftY, double leftY2, long leftCnt, double rightY, double rightY2, long rightCnt) { +this.leftY = leftY; +this.leftY2 = leftY2; +this.leftCnt = leftCnt; +this.rightY = rightY; +this.rightY2 = rightY2; +this.rightCnt = rightCnt; +} + +/** {@inheritDoc} */ +@Override public double impurity() { +double impurity = 0; + +if (leftCnt > 0) +impurity += leftY2 - 2.0 * leftY / leftCnt * leftY + Math.pow(leftY / leftCnt, 2) * leftCnt; + +if (rightCnt > 0) +impurity += rightY2 - 2.0 * rightY / rightCnt * rightY + Math.pow(rightY / rightCnt, 2) * rightCnt; + +return impurity; +} + +/** {@inheritDoc} */ +@Override public MSEImpurityMeasure add(MSEImpurityMeasure b) { +return new MSEImpurityMeasure( +leftY + b.leftY, +leftY2 + b.leftY2, +leftCnt + b.leftCnt, +rightY + b.rightY, +rightY2 + b.rightY2, +rightCnt + b.rightCnt +); +} + +/** {@inheritDoc} */ +@Override public MSEImpurityMeasure subtract(MSEImpurityMeasure b) { +return new MSEImpurityMeasure( +leftY - b.leftY, +leftY2 - b.leftY2, +leftCnt - b.leftCnt, +rightY - b.rightY, +rightY2 - b.rightY2, +rightCnt - b.rightCnt +); +} + +/** */ +public double getLeftY() { +return leftY; +} + +/** */ +public double getLeftY2() { +return leftY2; +} + +/** */ +public long getLeftCnt() { +return leftCnt; +} + +/** */ +public double getRightY() { +return rightY; +} + +/** */ +public double getRightY2() { +return rightY2; +} + +/** */ +public long getRightCnt() { +return rightCnt; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/mse/MSEImpurityMeasureCalculator.java -- diff -
[4/6] ignite git commit: IGNITE-8059: Integrate decision tree with partition based dataset.
http://git-wip-us.apache.org/repos/asf/ignite/blob/9abfee69/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java deleted file mode 100644 index fec0a83..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/ColumnDecisionTreeTrainer.java +++ /dev/null @@ -1,568 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.ml.trees.trainers.columnbased; - -import com.zaxxer.sparsebits.SparseBitSet; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.DoubleStream; -import java.util.stream.IntStream; -import java.util.stream.Stream; -import javax.cache.Cache; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.IgniteLogger; -import org.apache.ignite.Ignition; -import org.apache.ignite.cache.CachePeekMode; -import org.apache.ignite.cache.affinity.Affinity; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.internal.processors.cache.CacheEntryImpl; -import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.ml.Trainer; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.distributed.CacheUtils; -import org.apache.ignite.ml.math.functions.Functions; -import org.apache.ignite.ml.math.functions.IgniteBiFunction; -import org.apache.ignite.ml.math.functions.IgniteCurriedBiFunction; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.functions.IgniteSupplier; -import org.apache.ignite.ml.trees.ContinuousRegionInfo; -import org.apache.ignite.ml.trees.ContinuousSplitCalculator; -import org.apache.ignite.ml.trees.models.DecisionTreeModel; -import org.apache.ignite.ml.trees.nodes.DecisionTreeNode; -import org.apache.ignite.ml.trees.nodes.Leaf; -import org.apache.ignite.ml.trees.nodes.SplitNode; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ContextCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache.FeatureKey; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ProjectionsCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.ProjectionsCache.RegionKey; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.SplitCache; -import org.apache.ignite.ml.trees.trainers.columnbased.caches.SplitCache.SplitKey; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.FeatureProcessor; -import org.apache.ignite.ml.trees.trainers.columnbased.vectors.SplitInfo; -import org.jetbrains.annotations.NotNull; - -import static org.apache.ignite.ml.trees.trainers.columnbased.caches.FeaturesCache.getFeatureCacheKey; - -/** - * This trainer stores observations as columns and features as rows. - * Ideas from https://github.com/fabuzaid21/yggdrasil are used here. - */ -public class ColumnDecisionTreeTrainer implements -Trainer { -/** - * Function used to assign a value to a region. - */ -private final IgniteFunction regCalc; - -/** - * Function used to calculate impurity in regions used by categorical features. - */ -private final IgniteFunction> continuousCalculatorProvider; - -/** - * Categorical calculator provider. - **/ -private final IgniteFunction> categoricalCalculatorProvider; - -/** - * Cache used for storing data for training. - */ -private IgniteCache> prjsCache; - -/** - * Minimal information gain. - */ -
ignite git commit: IGNITE-8216 Fixed javadoc for release build
Repository: ignite Updated Branches: refs/heads/master 780fc07be -> 6557fe626 IGNITE-8216 Fixed javadoc for release build Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6557fe62 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6557fe62 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6557fe62 Branch: refs/heads/master Commit: 6557fe62696ac24c740e445b53482da298b59b27 Parents: 780fc07 Author: Sergey Chugunov Authored: Wed Apr 11 12:28:40 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 12:28:40 2018 +0300 -- parent/pom.xml | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6557fe62/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 16a9395..3decc16 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -404,6 +404,10 @@ org.apache.ignite.spi.eventstorage* +Communication Failure Detection +org.apache.ignite.failure + + Segmentation Detection org.apache.ignite.plugin.segmentation
ignite git commit: IGNITE-8216 Fixed javadoc for release build
Repository: ignite Updated Branches: refs/heads/ignite-2.5 9abfee69a -> 1ea17c821 IGNITE-8216 Fixed javadoc for release build Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1ea17c82 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1ea17c82 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1ea17c82 Branch: refs/heads/ignite-2.5 Commit: 1ea17c821f51d8725290021599a60cbbdfd2ee25 Parents: 9abfee6 Author: Sergey Chugunov Authored: Wed Apr 11 12:28:40 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 12:30:24 2018 +0300 -- parent/pom.xml | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1ea17c82/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 16a9395..3decc16 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -404,6 +404,10 @@ org.apache.ignite.spi.eventstorage* +Communication Failure Detection +org.apache.ignite.failure + + Segmentation Detection org.apache.ignite.plugin.segmentation
ignite git commit: IGNITE-7830: Knn Lin Reg with new datasets
Repository: ignite Updated Branches: refs/heads/master 6557fe626 -> a4653b7c1 IGNITE-7830: Knn Lin Reg with new datasets this closes #3583 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a4653b7c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4653b7c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4653b7c Branch: refs/heads/master Commit: a4653b7c1287a039206bf22e9d85125bb15bc412 Parents: 6557fe6 Author: zaleslaw Authored: Wed Apr 11 12:31:48 2018 +0300 Committer: YuriBabak Committed: Wed Apr 11 12:31:48 2018 +0300 -- .../java/org/apache/ignite/ml/knn/KNNUtils.java | 59 .../KNNClassificationTrainer.java | 23 +-- .../ml/knn/regression/KNNRegressionModel.java | 87 +++ .../ml/knn/regression/KNNRegressionTrainer.java | 40 ++ .../ignite/ml/knn/regression/package-info.java | 22 +++ .../apache/ignite/ml/knn/KNNRegressionTest.java | 143 +++ .../org/apache/ignite/ml/knn/KNNTestSuite.java | 1 + 7 files changed, 354 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a4653b7c/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java new file mode 100644 index 000..88fa70f --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.knn; + +import org.apache.ignite.ml.dataset.Dataset; +import org.apache.ignite.ml.dataset.DatasetBuilder; +import org.apache.ignite.ml.dataset.PartitionDataBuilder; +import org.apache.ignite.ml.knn.partitions.KNNPartitionContext; +import org.apache.ignite.ml.math.functions.IgniteBiFunction; +import org.apache.ignite.ml.structures.LabeledDataset; +import org.apache.ignite.ml.structures.LabeledVector; +import org.apache.ignite.ml.structures.partition.LabeledDatasetPartitionDataBuilderOnHeap; +import org.jetbrains.annotations.Nullable; + +/** + * Helper class for KNNRegression. + */ +public class KNNUtils { +/** + * Builds dataset. + * + * @param datasetBuilder Dataset builder. + * @param featureExtractor Feature extractor. + * @param lbExtractor Label extractor. + * @return Dataset. + */ +@Nullable public static Dataset> buildDataset(DatasetBuilder datasetBuilder, IgniteBiFunction featureExtractor, IgniteBiFunction lbExtractor) { +PartitionDataBuilder> partDataBuilder += new LabeledDatasetPartitionDataBuilderOnHeap<>( +featureExtractor, +lbExtractor +); + +Dataset> dataset = null; + +if (datasetBuilder != null) { +dataset = datasetBuilder.build( +(upstream, upstreamSize) -> new KNNPartitionContext(), +partDataBuilder +); +} +return dataset; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/a4653b7c/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java index 357047f..c0c8e65 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java @@ -17,14 +17,9 @@ package org.apache.ignite.ml.knn.classification; -import org.apache.ignite.ml.dataset.Dataset; import org.apache.ignite.ml.dataset.DatasetBuilder; -import org.apache.ignite.ml.dataset.PartitionDataBuilder; -import org.apache.ignite.ml.knn.partitions.KNNPa
ignite git commit: IGNITE-7830: Knn Lin Reg with new datasets
Repository: ignite Updated Branches: refs/heads/ignite-2.5 1ea17c821 -> 6bc937575 IGNITE-7830: Knn Lin Reg with new datasets this closes #3583 (cherry picked from commit a4653b7) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6bc93757 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6bc93757 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6bc93757 Branch: refs/heads/ignite-2.5 Commit: 6bc937575d5dfbe1d2c05865c8df0cabc6ace90c Parents: 1ea17c8 Author: zaleslaw Authored: Wed Apr 11 12:31:48 2018 +0300 Committer: YuriBabak Committed: Wed Apr 11 12:33:40 2018 +0300 -- .../java/org/apache/ignite/ml/knn/KNNUtils.java | 59 .../KNNClassificationTrainer.java | 23 +-- .../ml/knn/regression/KNNRegressionModel.java | 87 +++ .../ml/knn/regression/KNNRegressionTrainer.java | 40 ++ .../ignite/ml/knn/regression/package-info.java | 22 +++ .../apache/ignite/ml/knn/KNNRegressionTest.java | 143 +++ .../org/apache/ignite/ml/knn/KNNTestSuite.java | 1 + 7 files changed, 354 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6bc93757/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java new file mode 100644 index 000..88fa70f --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.knn; + +import org.apache.ignite.ml.dataset.Dataset; +import org.apache.ignite.ml.dataset.DatasetBuilder; +import org.apache.ignite.ml.dataset.PartitionDataBuilder; +import org.apache.ignite.ml.knn.partitions.KNNPartitionContext; +import org.apache.ignite.ml.math.functions.IgniteBiFunction; +import org.apache.ignite.ml.structures.LabeledDataset; +import org.apache.ignite.ml.structures.LabeledVector; +import org.apache.ignite.ml.structures.partition.LabeledDatasetPartitionDataBuilderOnHeap; +import org.jetbrains.annotations.Nullable; + +/** + * Helper class for KNNRegression. + */ +public class KNNUtils { +/** + * Builds dataset. + * + * @param datasetBuilder Dataset builder. + * @param featureExtractor Feature extractor. + * @param lbExtractor Label extractor. + * @return Dataset. + */ +@Nullable public static Dataset> buildDataset(DatasetBuilder datasetBuilder, IgniteBiFunction featureExtractor, IgniteBiFunction lbExtractor) { +PartitionDataBuilder> partDataBuilder += new LabeledDatasetPartitionDataBuilderOnHeap<>( +featureExtractor, +lbExtractor +); + +Dataset> dataset = null; + +if (datasetBuilder != null) { +dataset = datasetBuilder.build( +(upstream, upstreamSize) -> new KNNPartitionContext(), +partDataBuilder +); +} +return dataset; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/6bc93757/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java index 357047f..c0c8e65 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java @@ -17,14 +17,9 @@ package org.apache.ignite.ml.knn.classification; -import org.apache.ignite.ml.dataset.Dataset; import org.apache.ignite.ml.dataset.DatasetBuilder; -import org.apache.ignite.ml.dataset.PartitionDataBuilder; -imp
ignite git commit: IGNITE-8111 Add extra validation for WAL segment size - Fixes #3768.
Repository: ignite Updated Branches: refs/heads/master a4653b7c1 -> 975246687 IGNITE-8111 Add extra validation for WAL segment size - Fixes #3768. Signed-off-by: dpavlov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/97524668 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/97524668 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/97524668 Branch: refs/heads/master Commit: 975246687c9d143830501340e597a35d1a4c492a Parents: a4653b7 Author: denis.garus Authored: Wed Apr 11 13:01:22 2018 +0300 Committer: dpavlov Committed: Wed Apr 11 13:01:22 2018 +0300 -- .../configuration/DataStorageConfiguration.java | 6 ++-- .../DataStorageConfigurationValidationTest.java | 33 ++-- .../db/wal/IgniteWalFlushFailoverTest.java | 4 +-- ...lFlushMultiNodeFailoverAbstractSelfTest.java | 4 +-- 4 files changed, 39 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/97524668/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java index a433760..747efd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java @@ -533,12 +533,14 @@ public class DataStorageConfiguration implements Serializable { /** * Sets size of a WAL segment. + * If value is not set (or zero), {@link #DFLT_WAL_SEGMENT_SIZE} will be used. * - * @param walSegmentSize WAL segment size. 64 MB is used by default. Maximum value is 2Gb. + * @param walSegmentSize WAL segment size. Value must be between 512Kb and 2Gb. * @return {@code This} for chaining. */ public DataStorageConfiguration setWalSegmentSize(int walSegmentSize) { -A.ensure(walSegmentSize >= 0, "WAL segment size must be non-negative and less than 2 Gb."); +if (walSegmentSize != 0) +A.ensure(walSegmentSize >= 512 * 1024, "WAL segment size must be between 512Kb and 2Gb."); this.walSegmentSize = walSegmentSize; http://git-wip-us.apache.org/repos/asf/ignite/blob/97524668/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java index 7f667ee..9471a82 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java @@ -31,11 +31,10 @@ public class DataStorageConfigurationValidationTest extends TestCase { * * @throws Exception If failed. */ -public void testWalSegmentSizeOveflow() throws Exception { +public void testWalSegmentSizeOverflow() throws Exception { final DataStorageConfiguration cfg = new DataStorageConfiguration(); GridTestUtils.assertThrows(null, new Callable() { -/** {@inheritDoc} */ @Override public Void call() { cfg.setWalSegmentSize(1 << 31); @@ -43,4 +42,34 @@ public class DataStorageConfigurationValidationTest extends TestCase { } }, IllegalArgumentException.class, null); } + +/** + * @throws Exception If failed. + */ +public void testSetWalSegmentSizeShouldThrowExceptionWhenSizeLessThen512Kb() throws Exception { +final DataStorageConfiguration cfg = new DataStorageConfiguration(); + +GridTestUtils.assertThrows(null, new Callable() { +@Override public Void call() throws Exception { +cfg.setWalSegmentSize(512 * 1024 - 1); + +return null; +} +}, IllegalArgumentException.class, null); +} + +/** + * @throws Exception If failed. + */ +public void testSetWalSegmentSizeShouldBeOkWhenSizeBetween512KbAnd2Gb() throws Exception { +final DataStorageConfiguration cfg = new DataStorageConfiguration(); + +cfg.setWalSegmentSize(512 * 1024); + +assertEquals(512 * 1024, cfg.getWalSegmentSize()); + +cfg.setWalSegmentSize(Integer.MAX_VALUE); + +assertEquals(Integer.MAX_
ignite git commit: IGNITE-4091 Web Console: Refactored using of internal Angular API.
Repository: ignite Updated Branches: refs/heads/master 975246687 -> 74d254564 IGNITE-4091 Web Console: Refactored using of internal Angular API. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/74d25456 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/74d25456 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/74d25456 Branch: refs/heads/master Commit: 74d254564a44a95db9945652c9b579ed6b431ee9 Parents: 9752466 Author: Alexander Kalinin Authored: Wed Apr 11 17:09:41 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 17:09:41 2018 +0700 -- modules/web-console/frontend/app/app.config.js | 14 +++--- .../components/modal-import-models/component.js | 4 +- .../app/components/page-profile/controller.js | 4 +- .../frontend/app/modules/ace.module.js | 47 ++-- .../services/AngularStrapSelect.decorator.js| 5 ++- .../services/AngularStrapTooltip.decorator.js | 8 ++-- .../frontend/app/services/FormUtils.service.js | 3 +- 7 files changed, 45 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/74d25456/modules/web-console/frontend/app/app.config.js -- diff --git a/modules/web-console/frontend/app/app.config.js b/modules/web-console/frontend/app/app.config.js index 9d8dc99..e2bc057 100644 --- a/modules/web-console/frontend/app/app.config.js +++ b/modules/web-console/frontend/app/app.config.js @@ -43,7 +43,7 @@ igniteConsoleCfg.config(['$animateProvider', ($animateProvider) => { // AngularStrap modal popup configuration. igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { -angular.extend($modalProvider.defaults, { +Object.assign($modalProvider.defaults, { animation: 'am-fade-and-scale', placement: 'center', html: true @@ -52,7 +52,7 @@ igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { // AngularStrap popover configuration. igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { -angular.extend($popoverProvider.defaults, { +Object.assign($popoverProvider.defaults, { trigger: 'manual', placement: 'right', container: 'body', @@ -62,7 +62,7 @@ igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { // AngularStrap tooltips configuration. igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { -angular.extend($tooltipProvider.defaults, { +Object.assign($tooltipProvider.defaults, { container: 'body', delay: {show: 150, hide: 150}, placement: 'right', @@ -73,7 +73,7 @@ igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { // AngularStrap select (combobox) configuration. igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { -angular.extend($selectProvider.defaults, { +Object.assign($selectProvider.defaults, { container: 'body', maxLength: '5', allText: 'Select All', @@ -87,7 +87,7 @@ igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { // AngularStrap alerts configuration. igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { -angular.extend($alertProvider.defaults, { +Object.assign($alertProvider.defaults, { container: 'body', placement: 'top-right', duration: '5', @@ -99,7 +99,7 @@ igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { -angular.extend($dropdownProvider.defaults, { +Object.assign($dropdownProvider.defaults, { templateUrl: dropdownTemplateUrl, animation: '' }); @@ -107,7 +107,7 @@ igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$datepickerProvider', ($datepickerProvider) => { -angular.extend($datepickerProvider.defaults, { +Object.assign($datepickerProvider.defaults, { autoclose: true, iconLeft: 'icon-datepicker-left', iconRight: 'icon-datepicker-right' http://git-wip-us.apache.org/repos/asf/ignite/blob/74d25456/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js b/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js index 7f852b0..813c998 100644 --- a/modules/web-console/frontend/app/components/page-configure/components/modal-import-models
ignite git commit: IGNITE-4091 Web Console: Refactored using of internal Angular API.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 6bc937575 -> b96271866 IGNITE-4091 Web Console: Refactored using of internal Angular API. (cherry picked from commit 74d2545) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b9627186 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b9627186 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b9627186 Branch: refs/heads/ignite-2.5 Commit: b96271866aeb09b434e2b95a457655a44d913254 Parents: 6bc9375 Author: Alexander Kalinin Authored: Wed Apr 11 17:09:41 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 17:11:44 2018 +0700 -- modules/web-console/frontend/app/app.config.js | 14 +++--- .../components/modal-import-models/component.js | 4 +- .../app/components/page-profile/controller.js | 4 +- .../frontend/app/modules/ace.module.js | 47 ++-- .../services/AngularStrapSelect.decorator.js| 5 ++- .../services/AngularStrapTooltip.decorator.js | 8 ++-- .../frontend/app/services/FormUtils.service.js | 3 +- 7 files changed, 45 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b9627186/modules/web-console/frontend/app/app.config.js -- diff --git a/modules/web-console/frontend/app/app.config.js b/modules/web-console/frontend/app/app.config.js index 9d8dc99..e2bc057 100644 --- a/modules/web-console/frontend/app/app.config.js +++ b/modules/web-console/frontend/app/app.config.js @@ -43,7 +43,7 @@ igniteConsoleCfg.config(['$animateProvider', ($animateProvider) => { // AngularStrap modal popup configuration. igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { -angular.extend($modalProvider.defaults, { +Object.assign($modalProvider.defaults, { animation: 'am-fade-and-scale', placement: 'center', html: true @@ -52,7 +52,7 @@ igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { // AngularStrap popover configuration. igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { -angular.extend($popoverProvider.defaults, { +Object.assign($popoverProvider.defaults, { trigger: 'manual', placement: 'right', container: 'body', @@ -62,7 +62,7 @@ igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { // AngularStrap tooltips configuration. igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { -angular.extend($tooltipProvider.defaults, { +Object.assign($tooltipProvider.defaults, { container: 'body', delay: {show: 150, hide: 150}, placement: 'right', @@ -73,7 +73,7 @@ igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { // AngularStrap select (combobox) configuration. igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { -angular.extend($selectProvider.defaults, { +Object.assign($selectProvider.defaults, { container: 'body', maxLength: '5', allText: 'Select All', @@ -87,7 +87,7 @@ igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { // AngularStrap alerts configuration. igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { -angular.extend($alertProvider.defaults, { +Object.assign($alertProvider.defaults, { container: 'body', placement: 'top-right', duration: '5', @@ -99,7 +99,7 @@ igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { -angular.extend($dropdownProvider.defaults, { +Object.assign($dropdownProvider.defaults, { templateUrl: dropdownTemplateUrl, animation: '' }); @@ -107,7 +107,7 @@ igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$datepickerProvider', ($datepickerProvider) => { -angular.extend($datepickerProvider.defaults, { +Object.assign($datepickerProvider.defaults, { autoclose: true, iconLeft: 'icon-datepicker-left', iconRight: 'icon-datepicker-right' http://git-wip-us.apache.org/repos/asf/ignite/blob/b9627186/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js b/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js index 7f852b0..813c998 100644 --- a/modules/web-console/frontend/app/components/
ignite git commit: IGNITE-7871 Check local join future on error. - Fixes #3793.
Repository: ignite Updated Branches: refs/heads/master 74d254564 -> 0e73fa2c1 IGNITE-7871 Check local join future on error. - Fixes #3793. Signed-off-by: dpavlov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0e73fa2c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e73fa2c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e73fa2c Branch: refs/heads/master Commit: 0e73fa2c10dcd96ff98279018bdd3f8b36568008 Parents: 74d2545 Author: Pavel Kovalenko Authored: Wed Apr 11 14:12:50 2018 +0300 Committer: dpavlov Committed: Wed Apr 11 14:12:50 2018 +0300 -- .../distributed/dht/preloader/latch/ExchangeLatchManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0e73fa2c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java index c205cb1..404f88f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java @@ -104,7 +104,8 @@ public class ExchangeLatchManager { // First coordinator initialization. ctx.discovery().localJoinFuture().listen(f -> { -this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); +if (f.error() == null) +this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); }); ctx.event().addDiscoveryEventListener((e, cache) -> {
ignite git commit: IGNITE-4756 Print info about partition distribution to log
Repository: ignite Updated Branches: refs/heads/master 0e73fa2c1 -> a3eb1f5d7 IGNITE-4756 Print info about partition distribution to log Signed-off-by: Anton Vinogradov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a3eb1f5d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a3eb1f5d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a3eb1f5d Branch: refs/heads/master Commit: a3eb1f5d753a38c4019440e1bf39d00bc6136455 Parents: 0e73fa2 Author: Vyacheslav Daradur Authored: Wed Apr 11 14:41:29 2018 +0300 Committer: Anton Vinogradov Committed: Wed Apr 11 14:41:29 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 7 + .../affinity/GridAffinityAssignmentCache.java | 50 +++- .../AffinityDistributionLoggingTest.java| 268 +++ .../testsuites/IgniteCacheTestSuite5.java | 9 +- 4 files changed, 327 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a3eb1f5d/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 9da123e..04eb425 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -857,6 +857,13 @@ public final class IgniteSystemProperties { public static final String IGNITE_BPLUS_TREE_LOCK_RETRIES = "IGNITE_BPLUS_TREE_LOCK_RETRIES"; /** + * The threshold of uneven distribution above which partition distribution will be logged. + * + * The default is '50', that means: warn about nodes with 50+% difference. + */ +public static final String IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD = "IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD"; + +/** * Enforces singleton. */ private IgniteSystemProperties() { http://git-wip-us.apache.org/repos/asf/ignite/blob/a3eb1f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java index 18edd02..b1899e3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java @@ -34,13 +34,14 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; +import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.AffinityCentralizedFunction; import org.apache.ignite.cache.affinity.AffinityFunction; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.internal.GridKernalContext; -import org.apache.ignite.internal.cluster.NodeOrderComparator; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.cluster.NodeOrderComparator; import org.apache.ignite.internal.managers.discovery.DiscoCache; import org.apache.ignite.internal.processors.cache.ExchangeDiscoveryEvents; import org.apache.ignite.internal.processors.cluster.BaselineTopology; @@ -53,7 +54,10 @@ import org.apache.ignite.lang.IgnitePredicate; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.IgniteSystemProperties.IGNITE_AFFINITY_HISTORY_SIZE; +import static org.apache.ignite.IgniteSystemProperties.IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD; +import static org.apache.ignite.IgniteSystemProperties.getFloat; import static org.apache.ignite.IgniteSystemProperties.getInteger; +import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT; /** @@ -63,6 +67,9 @@ public class GridAffinityAssignmentCache { /** Cleanup history size. */ private final int MAX_HIST_SIZE = getInteger(IGNITE_AFFINITY_HISTORY_SIZE, 500); +/** Partition distribution. */ +private final float partDistribution = getFloat(IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD, 50f); + /** Group name if specified or cache name. */ private final String cacheOrGrpName; @@ -367,6 +374,9 @@ public class GridAffinityAssignmentCache {
[06/10] ignite git commit: IGNITE-7830: Knn Lin Reg with new datasets
IGNITE-7830: Knn Lin Reg with new datasets this closes #3583 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a4653b7c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4653b7c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4653b7c Branch: refs/heads/ignite-8201 Commit: a4653b7c1287a039206bf22e9d85125bb15bc412 Parents: 6557fe6 Author: zaleslaw Authored: Wed Apr 11 12:31:48 2018 +0300 Committer: YuriBabak Committed: Wed Apr 11 12:31:48 2018 +0300 -- .../java/org/apache/ignite/ml/knn/KNNUtils.java | 59 .../KNNClassificationTrainer.java | 23 +-- .../ml/knn/regression/KNNRegressionModel.java | 87 +++ .../ml/knn/regression/KNNRegressionTrainer.java | 40 ++ .../ignite/ml/knn/regression/package-info.java | 22 +++ .../apache/ignite/ml/knn/KNNRegressionTest.java | 143 +++ .../org/apache/ignite/ml/knn/KNNTestSuite.java | 1 + 7 files changed, 354 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a4653b7c/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java new file mode 100644 index 000..88fa70f --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/KNNUtils.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package org.apache.ignite.ml.knn; + +import org.apache.ignite.ml.dataset.Dataset; +import org.apache.ignite.ml.dataset.DatasetBuilder; +import org.apache.ignite.ml.dataset.PartitionDataBuilder; +import org.apache.ignite.ml.knn.partitions.KNNPartitionContext; +import org.apache.ignite.ml.math.functions.IgniteBiFunction; +import org.apache.ignite.ml.structures.LabeledDataset; +import org.apache.ignite.ml.structures.LabeledVector; +import org.apache.ignite.ml.structures.partition.LabeledDatasetPartitionDataBuilderOnHeap; +import org.jetbrains.annotations.Nullable; + +/** + * Helper class for KNNRegression. + */ +public class KNNUtils { +/** + * Builds dataset. + * + * @param datasetBuilder Dataset builder. + * @param featureExtractor Feature extractor. + * @param lbExtractor Label extractor. + * @return Dataset. + */ +@Nullable public static Dataset> buildDataset(DatasetBuilder datasetBuilder, IgniteBiFunction featureExtractor, IgniteBiFunction lbExtractor) { +PartitionDataBuilder> partDataBuilder += new LabeledDatasetPartitionDataBuilderOnHeap<>( +featureExtractor, +lbExtractor +); + +Dataset> dataset = null; + +if (datasetBuilder != null) { +dataset = datasetBuilder.build( +(upstream, upstreamSize) -> new KNNPartitionContext(), +partDataBuilder +); +} +return dataset; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/a4653b7c/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java index 357047f..c0c8e65 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/knn/classification/KNNClassificationTrainer.java @@ -17,14 +17,9 @@ package org.apache.ignite.ml.knn.classification; -import org.apache.ignite.ml.dataset.Dataset; import org.apache.ignite.ml.dataset.DatasetBuilder; -import org.apache.ignite.ml.dataset.PartitionDataBuilder; -import org.apache.ignite.ml.knn.partitions.KNNPartitionContext; +import org.apache.ignite.ml.knn.KNNUtils; import org.apache
[07/10] ignite git commit: IGNITE-8111 Add extra validation for WAL segment size - Fixes #3768.
IGNITE-8111 Add extra validation for WAL segment size - Fixes #3768. Signed-off-by: dpavlov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/97524668 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/97524668 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/97524668 Branch: refs/heads/ignite-8201 Commit: 975246687c9d143830501340e597a35d1a4c492a Parents: a4653b7 Author: denis.garus Authored: Wed Apr 11 13:01:22 2018 +0300 Committer: dpavlov Committed: Wed Apr 11 13:01:22 2018 +0300 -- .../configuration/DataStorageConfiguration.java | 6 ++-- .../DataStorageConfigurationValidationTest.java | 33 ++-- .../db/wal/IgniteWalFlushFailoverTest.java | 4 +-- ...lFlushMultiNodeFailoverAbstractSelfTest.java | 4 +-- 4 files changed, 39 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/97524668/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java index a433760..747efd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java @@ -533,12 +533,14 @@ public class DataStorageConfiguration implements Serializable { /** * Sets size of a WAL segment. + * If value is not set (or zero), {@link #DFLT_WAL_SEGMENT_SIZE} will be used. * - * @param walSegmentSize WAL segment size. 64 MB is used by default. Maximum value is 2Gb. + * @param walSegmentSize WAL segment size. Value must be between 512Kb and 2Gb. * @return {@code This} for chaining. */ public DataStorageConfiguration setWalSegmentSize(int walSegmentSize) { -A.ensure(walSegmentSize >= 0, "WAL segment size must be non-negative and less than 2 Gb."); +if (walSegmentSize != 0) +A.ensure(walSegmentSize >= 512 * 1024, "WAL segment size must be between 512Kb and 2Gb."); this.walSegmentSize = walSegmentSize; http://git-wip-us.apache.org/repos/asf/ignite/blob/97524668/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java index 7f667ee..9471a82 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/DataStorageConfigurationValidationTest.java @@ -31,11 +31,10 @@ public class DataStorageConfigurationValidationTest extends TestCase { * * @throws Exception If failed. */ -public void testWalSegmentSizeOveflow() throws Exception { +public void testWalSegmentSizeOverflow() throws Exception { final DataStorageConfiguration cfg = new DataStorageConfiguration(); GridTestUtils.assertThrows(null, new Callable() { -/** {@inheritDoc} */ @Override public Void call() { cfg.setWalSegmentSize(1 << 31); @@ -43,4 +42,34 @@ public class DataStorageConfigurationValidationTest extends TestCase { } }, IllegalArgumentException.class, null); } + +/** + * @throws Exception If failed. + */ +public void testSetWalSegmentSizeShouldThrowExceptionWhenSizeLessThen512Kb() throws Exception { +final DataStorageConfiguration cfg = new DataStorageConfiguration(); + +GridTestUtils.assertThrows(null, new Callable() { +@Override public Void call() throws Exception { +cfg.setWalSegmentSize(512 * 1024 - 1); + +return null; +} +}, IllegalArgumentException.class, null); +} + +/** + * @throws Exception If failed. + */ +public void testSetWalSegmentSizeShouldBeOkWhenSizeBetween512KbAnd2Gb() throws Exception { +final DataStorageConfiguration cfg = new DataStorageConfiguration(); + +cfg.setWalSegmentSize(512 * 1024); + +assertEquals(512 * 1024, cfg.getWalSegmentSize()); + +cfg.setWalSegmentSize(Integer.MAX_VALUE); + +assertEquals(Integer.MAX_VALUE, cfg.getWalSegmentSize()); +} } http://git-wip-us.apache.org/repo
[09/10] ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fe21ed57 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fe21ed57 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fe21ed57 Branch: refs/heads/ignite-8201 Commit: fe21ed5710396c6b2cb7b9cbb1f8f115e697dc49 Parents: 86d0bcb 74d2545 Author: Alexey Kuznetsov Authored: Wed Apr 11 17:39:20 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 17:39:20 2018 +0700 -- .../configuration/DataStorageConfiguration.java | 6 +- .../org/apache/ignite/internal/GridTopic.java | 5 +- .../communication/GridIoMessageFactory.java | 6 + .../discovery/GridDiscoveryManager.java | 10 + .../MetaPageUpdatePartitionDataRecord.java | 2 +- .../processors/cache/CacheMetricsImpl.java | 2 +- .../processors/cache/GridCacheMvccManager.java | 38 + .../GridCachePartitionExchangeManager.java | 17 + .../cache/GridCacheSharedContext.java | 9 +- .../processors/cache/GridCacheUtils.java| 2 +- .../cache/IgniteCacheOffheapManager.java| 8 +- .../cache/IgniteCacheOffheapManagerImpl.java| 10 +- .../dht/GridClientPartitionTopology.java| 5 + .../distributed/dht/GridDhtLocalPartition.java | 9 +- .../dht/GridDhtPartitionTopology.java | 6 + .../dht/GridDhtPartitionTopologyImpl.java | 26 +- .../dht/GridDhtPartitionsStateValidator.java| 255 +++ .../cache/distributed/dht/GridDhtTxLocal.java | 5 + .../GridDhtPartitionsExchangeFuture.java| 96 ++- .../GridDhtPartitionsSingleMessage.java | 68 +- .../dht/preloader/InitNewCoordinatorFuture.java | 2 +- .../preloader/latch/ExchangeLatchManager.java | 695 +++ .../distributed/dht/preloader/latch/Latch.java | 52 ++ .../dht/preloader/latch/LatchAckMessage.java| 165 + .../cache/distributed/near/GridNearTxLocal.java | 10 + .../persistence/GridCacheOffheapManager.java| 10 +- .../cache/transactions/IgniteTxAdapter.java | 2 +- .../cache/transactions/IgniteTxManager.java | 36 +- ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 2 +- .../DataStorageConfigurationValidationTest.java | 33 +- .../processors/cache/IgniteCacheGroupsTest.java | 1 + ...ExchangeLatchManagerCoordinatorFailTest.java | 244 +++ .../GridCachePartitionsStateValidationTest.java | 316 + ...idCachePartitionsStateValidatorSelfTest.java | 158 + .../db/wal/IgniteWalFlushFailoverTest.java | 4 +- ...lFlushMultiNodeFailoverAbstractSelfTest.java | 4 +- .../TxOptimisticOnPartitionExchangeTest.java| 322 + .../ignite/testsuites/IgniteCacheTestSuite.java | 4 + .../testsuites/IgniteCacheTestSuite6.java | 6 + .../java/org/apache/ignite/ml/knn/KNNUtils.java | 59 ++ .../KNNClassificationTrainer.java | 23 +- .../ml/knn/regression/KNNRegressionModel.java | 87 +++ .../ml/knn/regression/KNNRegressionTrainer.java | 40 ++ .../ignite/ml/knn/regression/package-info.java | 22 + .../apache/ignite/ml/knn/KNNRegressionTest.java | 143 .../org/apache/ignite/ml/knn/KNNTestSuite.java | 1 + .../ApiParity/IgniteConfigurationParityTest.cs | 3 +- modules/web-console/frontend/app/app.config.js | 14 +- .../components/modal-import-models/component.js | 4 +- .../app/components/page-profile/controller.js | 4 +- .../frontend/app/modules/ace.module.js | 47 +- .../services/AngularStrapSelect.decorator.js| 5 +- .../services/AngularStrapTooltip.decorator.js | 8 +- .../frontend/app/services/FormUtils.service.js | 3 +- parent/pom.xml | 4 + 55 files changed, 3012 insertions(+), 106 deletions(-) --
[01/10] ignite git commit: IGNITE-8201 WIP.
Repository: ignite Updated Branches: refs/heads/ignite-8201 df938d562 -> 3780ac0a0 IGNITE-8201 WIP. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/86d0bcb7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/86d0bcb7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/86d0bcb7 Branch: refs/heads/ignite-8201 Commit: 86d0bcb7d134686fb521dd7da5dc0e583d7f917c Parents: df938d5 Author: Alexey Kuznetsov Authored: Wed Apr 11 15:19:58 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 15:19:58 2018 +0700 -- .../JettyRestProcessorAbstractSelfTest.java | 21 ++-- ...ettyRestProcessorAuthenticationSelfTest.java | 2 +- .../processors/rest/GridRestProcessor.java | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/86d0bcb7/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java index 5201b33..38f22ba 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java @@ -294,8 +294,9 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro /** * @param content Content to check. + * @return JSON node with actual response. */ -private JsonNode jsonCacheOperationResponse(String content, boolean bulk) throws IOException { +protected JsonNode assertResponseSucceeded(String content, boolean bulk) throws IOException { assertNotNull(content); assertFalse(content.isEmpty()); @@ -315,7 +316,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @param res Response. */ private void assertCacheOperation(String content, Object res) throws IOException { -JsonNode ret = jsonCacheOperationResponse(content, false); +JsonNode ret = assertResponseSucceeded(content, false); assertEquals(String.valueOf(res), ret.isObject() ? ret.toString() : ret.asText()); } @@ -325,7 +326,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @param res Response. */ private void assertCacheBulkOperation(String content, Object res) throws IOException { -JsonNode ret = jsonCacheOperationResponse(content, true); +JsonNode ret = assertResponseSucceeded(content, true); assertEquals(String.valueOf(res), ret.asText()); } @@ -334,7 +335,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @param content Content to check. */ private void assertCacheMetrics(String content) throws IOException { -JsonNode ret = jsonCacheOperationResponse(content, true); +JsonNode ret = assertResponseSucceeded(content, true); assertTrue(ret.isObject()); } @@ -403,7 +404,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @throws IOException If failed. */ private void checkJson(String json, Person p) throws IOException { -JsonNode res = jsonCacheOperationResponse(json, false); +JsonNode res = assertResponseSucceeded(json, false); assertEquals(p.id.intValue(), res.get("id").asInt()); assertEquals(p.getOrganizationId().intValue(), res.get("orgId").asInt()); @@ -455,7 +456,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro info("Get command result: " + ret); -JsonNode res = jsonCacheOperationResponse(ret, false); +JsonNode res = assertResponseSucceeded(ret, false); assertEquals("Alex", res.get("NAME").asText()); assertEquals(300, res.get("SALARY").asInt()); @@ -476,7 +477,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro info("Get command result: " + ret); -JsonNode json = jsonCacheOperationResponse(ret, false); +JsonNode json = assertResponseSucceeded(ret, false); assertEquals(ref1.name, json.get("name").asText()); ref2.ref(ref1); @@ -552,7 +553,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro info("Get command result: " + ret); -JsonNode res = jsonCacheOperationResponse(ret, fals
[03/10] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
IGNITE-7871 Implemented additional synchronization phase for correct partition counters update Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/da77b981 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/da77b981 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/da77b981 Branch: refs/heads/ignite-8201 Commit: da77b9818a70495b7afdf6899ebd9180dadd7f68 Parents: f4de6df Author: Pavel Kovalenko Authored: Wed Apr 11 11:23:46 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 11:23:46 2018 +0300 -- .../org/apache/ignite/internal/GridTopic.java | 5 +- .../communication/GridIoMessageFactory.java | 6 + .../discovery/GridDiscoveryManager.java | 10 + .../MetaPageUpdatePartitionDataRecord.java | 2 +- .../processors/cache/CacheMetricsImpl.java | 2 +- .../processors/cache/GridCacheMvccManager.java | 38 + .../GridCachePartitionExchangeManager.java | 17 + .../cache/GridCacheSharedContext.java | 9 +- .../processors/cache/GridCacheUtils.java| 2 +- .../cache/IgniteCacheOffheapManager.java| 8 +- .../cache/IgniteCacheOffheapManagerImpl.java| 10 +- .../dht/GridClientPartitionTopology.java| 5 + .../distributed/dht/GridDhtLocalPartition.java | 9 +- .../dht/GridDhtPartitionTopology.java | 6 + .../dht/GridDhtPartitionTopologyImpl.java | 26 +- .../dht/GridDhtPartitionsStateValidator.java| 255 +++ .../cache/distributed/dht/GridDhtTxLocal.java | 5 + .../GridDhtPartitionsExchangeFuture.java| 96 ++- .../GridDhtPartitionsSingleMessage.java | 68 +- .../dht/preloader/InitNewCoordinatorFuture.java | 2 +- .../preloader/latch/ExchangeLatchManager.java | 695 +++ .../distributed/dht/preloader/latch/Latch.java | 52 ++ .../dht/preloader/latch/LatchAckMessage.java| 165 + .../cache/distributed/near/GridNearTxLocal.java | 10 + .../persistence/GridCacheOffheapManager.java| 10 +- .../cache/transactions/IgniteTxAdapter.java | 2 +- .../cache/transactions/IgniteTxManager.java | 36 +- ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 2 +- .../processors/cache/IgniteCacheGroupsTest.java | 1 + ...ExchangeLatchManagerCoordinatorFailTest.java | 244 +++ .../GridCachePartitionsStateValidationTest.java | 316 + ...idCachePartitionsStateValidatorSelfTest.java | 158 + .../TxOptimisticOnPartitionExchangeTest.java| 322 + .../ignite/testsuites/IgniteCacheTestSuite.java | 4 + .../testsuites/IgniteCacheTestSuite6.java | 6 + 35 files changed, 2568 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java index 1227e8c..0b2d41a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java @@ -124,7 +124,10 @@ public enum GridTopic { TOPIC_METRICS, /** */ -TOPIC_AUTH; +TOPIC_AUTH, + +/** */ +TOPIC_EXCHANGE; /** Enum values. */ private static final GridTopic[] VALS = values(); http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java index 5616fd0..581c32e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java @@ -53,6 +53,7 @@ import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl; import org.apache.ignite.internal.processors.cache.WalStateAckMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataRequestMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataResponseMessage; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.LatchAckMessage; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTtlUpdateRequest; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryRequest; import org.apache.ignite.internal.processor
[02/10] ignite git commit: IGNITE-7871 Implemented additional synchronization phase for correct partition counters update
http://git-wip-us.apache.org/repos/asf/ignite/blob/da77b981/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java new file mode 100644 index 000..bad1b61 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/LatchAckMessage.java @@ -0,0 +1,165 @@ +/* + * 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. + */ +package org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch; + +import java.nio.ByteBuffer; +import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageReader; +import org.apache.ignite.plugin.extensions.communication.MessageWriter; + +/** + * Message is used to send acks for {@link Latch} instances management. + */ +public class LatchAckMessage implements Message { +/** */ +private static final long serialVersionUID = 0L; + +/** Latch id. */ +private String latchId; + +/** Latch topology version. */ +private AffinityTopologyVersion topVer; + +/** Flag indicates that ack is final. */ +private boolean isFinal; + +/** + * Constructor. + * + * @param latchId Latch id. + * @param topVer Latch topology version. + * @param isFinal Final acknowledgement flag. + */ +public LatchAckMessage(String latchId, AffinityTopologyVersion topVer, boolean isFinal) { +this.latchId = latchId; +this.topVer = topVer; +this.isFinal = isFinal; +} + +/** + * Empty constructor for marshalling purposes. + */ +public LatchAckMessage() { +} + +/** + * @return Latch id. + */ +public String latchId() { +return latchId; +} + +/** + * @return Latch topology version. + */ +public AffinityTopologyVersion topVer() { +return topVer; +} + +/** + * @return {@code} if ack is final. + */ +public boolean isFinal() { +return isFinal; +} + +/** {@inheritDoc} */ +@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { +writer.setBuffer(buf); + +if (!writer.isHeaderWritten()) { +if (!writer.writeHeader(directType(), fieldsCount())) +return false; + +writer.onHeaderWritten(); +} + +switch (writer.state()) { +case 0: +if (!writer.writeBoolean("isFinal", isFinal)) +return false; + +writer.incrementState(); + +case 1: +if (!writer.writeString("latchId", latchId)) +return false; + +writer.incrementState(); + +case 2: +if (!writer.writeMessage("topVer", topVer)) +return false; + +writer.incrementState(); +} + +return true; +} + +/** {@inheritDoc} */ +@Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { +reader.setBuffer(buf); + +if (!reader.beforeMessageRead()) +return false; + +switch (reader.state()) { +case 0: +isFinal = reader.readBoolean("isFinal"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 1: +latchId = reader.readString("latchId"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); + +case 2: +topVer = reader.readMessage("topVer"); + +if (!reader.isLastRead()) +return false; + +reader.incrementState(); +
[10/10] ignite git commit: IGNITE-8201 WIP.
IGNITE-8201 WIP. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3780ac0a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3780ac0a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3780ac0a Branch: refs/heads/ignite-8201 Commit: 3780ac0a09198e2918206d23ee515a2fe522352c Parents: fe21ed5 Author: Alexey Kuznetsov Authored: Wed Apr 11 19:28:11 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 19:28:11 2018 +0700 -- ...ettyRestProcessorAuthenticationSelfTest.java | 43 ++-- .../http/jetty/GridJettyRestHandler.java| 8 +++- 2 files changed, 28 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3780ac0a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java index 145d7e9..1536d9d 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java @@ -41,12 +41,6 @@ public class JettyRestProcessorAuthenticationSelfTest extends JettyRestProcessor private static final String DFLT_PWD = "ignite"; /** */ -private String user = DFLT_USER; - -/** */ -private String pwd = DFLT_PWD; - -/** */ private String tok = ""; /** {@inheritDoc} */ @@ -60,8 +54,22 @@ public class JettyRestProcessorAuthenticationSelfTest extends JettyRestProcessor @Override protected void beforeTest() throws Exception { super.beforeTest(); -user = DFLT_USER; -pwd = DFLT_PWD; +// Authenticate and extract token. +if (F.isEmpty(tok)) { +String ret = content(null, GridRestCommand.AUTHENTICATE, +"user", DFLT_USER, +"password", DFLT_PWD); + +int p1 = ret.indexOf("sessionToken"); +int p2 = ret.indexOf('"', p1 + 16); + +tok = ret.substring(p1 + 15, p2); +} +} + +/** {@inheritDoc} */ +@Override protected boolean securityEnabled() { +return true; } /** {@inheritDoc} */ @@ -104,14 +112,8 @@ public class JettyRestProcessorAuthenticationSelfTest extends JettyRestProcessor @Override protected String restUrl() { String url = super.restUrl(); -if (!F.isEmpty(user)) { -url += "user=" + user; - -if (!F.isEmpty(pwd)) -url += "&password=" + pwd; - -url += '&'; -} +if (!F.isEmpty(tok)) +url += "sessionToken=" + tok + "&"; return url; } @@ -122,19 +124,18 @@ public class JettyRestProcessorAuthenticationSelfTest extends JettyRestProcessor public void testAuthenticationCommand() throws Exception { String ret = content(null, GridRestCommand.AUTHENTICATE); -assertResponseContainsError(ret, "The user name or password is incorrect"); +assertResponseSucceeded(ret, false); } /** * @throws Exception If failed. */ -public void testMissingCredentials() throws Exception { -user = null; -pwd = null; +public void testMissingSessionToken() throws Exception { +tok = null; String ret = content(null, GridRestCommand.VERSION); -assertResponseSucceeded(ret, false); +assertResponseContainsError(ret, "The user name or password is incorrect"); } /** http://git-wip-us.apache.org/repos/asf/ignite/blob/3780ac0a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java -- diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java index e70ef6a..7f20dca 100644 --- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java +++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java @@ -69,6 +69,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.jetbrains.annotations.Nullable; import static org.
[04/10] ignite git commit: IGNITE-7222 .NET: Ignore missing IgniteConfiguration.CommunicationFailureResolver
IGNITE-7222 .NET: Ignore missing IgniteConfiguration.CommunicationFailureResolver Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/780fc07b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/780fc07b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/780fc07b Branch: refs/heads/ignite-8201 Commit: 780fc07be0b257b578647682585c89548e6d695d Parents: da77b98 Author: Pavel Tupitsyn Authored: Wed Apr 11 11:51:45 2018 +0300 Committer: Pavel Tupitsyn Committed: Wed Apr 11 11:51:45 2018 +0300 -- .../ApiParity/IgniteConfigurationParityTest.cs| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/780fc07b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs index d68083f..bf34fc0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/IgniteConfigurationParityTest.cs @@ -63,7 +63,8 @@ namespace Apache.Ignite.Core.Tests.ApiParity "ClassLoader", "CacheStoreSessionListenerFactories", "PlatformConfiguration", -"ExecutorConfiguration" +"ExecutorConfiguration", +"CommunicationFailureResolver" }; /** Properties that are missing on .NET side. */
[05/10] ignite git commit: IGNITE-8216 Fixed javadoc for release build
IGNITE-8216 Fixed javadoc for release build Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6557fe62 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6557fe62 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6557fe62 Branch: refs/heads/ignite-8201 Commit: 6557fe62696ac24c740e445b53482da298b59b27 Parents: 780fc07 Author: Sergey Chugunov Authored: Wed Apr 11 12:28:40 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 12:28:40 2018 +0300 -- parent/pom.xml | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6557fe62/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 16a9395..3decc16 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -404,6 +404,10 @@ org.apache.ignite.spi.eventstorage* +Communication Failure Detection +org.apache.ignite.failure + + Segmentation Detection org.apache.ignite.plugin.segmentation
[08/10] ignite git commit: IGNITE-4091 Web Console: Refactored using of internal Angular API.
IGNITE-4091 Web Console: Refactored using of internal Angular API. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/74d25456 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/74d25456 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/74d25456 Branch: refs/heads/ignite-8201 Commit: 74d254564a44a95db9945652c9b579ed6b431ee9 Parents: 9752466 Author: Alexander Kalinin Authored: Wed Apr 11 17:09:41 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 17:09:41 2018 +0700 -- modules/web-console/frontend/app/app.config.js | 14 +++--- .../components/modal-import-models/component.js | 4 +- .../app/components/page-profile/controller.js | 4 +- .../frontend/app/modules/ace.module.js | 47 ++-- .../services/AngularStrapSelect.decorator.js| 5 ++- .../services/AngularStrapTooltip.decorator.js | 8 ++-- .../frontend/app/services/FormUtils.service.js | 3 +- 7 files changed, 45 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/74d25456/modules/web-console/frontend/app/app.config.js -- diff --git a/modules/web-console/frontend/app/app.config.js b/modules/web-console/frontend/app/app.config.js index 9d8dc99..e2bc057 100644 --- a/modules/web-console/frontend/app/app.config.js +++ b/modules/web-console/frontend/app/app.config.js @@ -43,7 +43,7 @@ igniteConsoleCfg.config(['$animateProvider', ($animateProvider) => { // AngularStrap modal popup configuration. igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { -angular.extend($modalProvider.defaults, { +Object.assign($modalProvider.defaults, { animation: 'am-fade-and-scale', placement: 'center', html: true @@ -52,7 +52,7 @@ igniteConsoleCfg.config(['$modalProvider', ($modalProvider) => { // AngularStrap popover configuration. igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { -angular.extend($popoverProvider.defaults, { +Object.assign($popoverProvider.defaults, { trigger: 'manual', placement: 'right', container: 'body', @@ -62,7 +62,7 @@ igniteConsoleCfg.config(['$popoverProvider', ($popoverProvider) => { // AngularStrap tooltips configuration. igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { -angular.extend($tooltipProvider.defaults, { +Object.assign($tooltipProvider.defaults, { container: 'body', delay: {show: 150, hide: 150}, placement: 'right', @@ -73,7 +73,7 @@ igniteConsoleCfg.config(['$tooltipProvider', ($tooltipProvider) => { // AngularStrap select (combobox) configuration. igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { -angular.extend($selectProvider.defaults, { +Object.assign($selectProvider.defaults, { container: 'body', maxLength: '5', allText: 'Select All', @@ -87,7 +87,7 @@ igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => { // AngularStrap alerts configuration. igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { -angular.extend($alertProvider.defaults, { +Object.assign($alertProvider.defaults, { container: 'body', placement: 'top-right', duration: '5', @@ -99,7 +99,7 @@ igniteConsoleCfg.config(['$alertProvider', ($alertProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { -angular.extend($dropdownProvider.defaults, { +Object.assign($dropdownProvider.defaults, { templateUrl: dropdownTemplateUrl, animation: '' }); @@ -107,7 +107,7 @@ igniteConsoleCfg.config(['$dropdownProvider', ($dropdownProvider) => { // AngularStrap dropdowns () configuration. igniteConsoleCfg.config(['$datepickerProvider', ($datepickerProvider) => { -angular.extend($datepickerProvider.defaults, { +Object.assign($datepickerProvider.defaults, { autoclose: true, iconLeft: 'icon-datepicker-left', iconRight: 'icon-datepicker-right' http://git-wip-us.apache.org/repos/asf/ignite/blob/74d25456/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js b/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js index 7f852b0..813c998 100644 --- a/modules/web-console/frontend/app/components/page-configure/components/modal-import-models/component.js +++ b/modules/web-console/frontend/app/components/page-configu
ignite git commit: IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735.
Repository: ignite Updated Branches: refs/heads/master a3eb1f5d7 -> 98ef92593 IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735. Signed-off-by: Alexey Kuznetsov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/98ef9259 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/98ef9259 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/98ef9259 Branch: refs/heads/master Commit: 98ef925933f392d419f70b2fcf51e3655b08b290 Parents: a3eb1f5 Author: Ilya Kasnacheev Authored: Wed Apr 11 19:32:52 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 19:32:52 2018 +0700 -- .../cluster/GridChangeStateCommandHandler.java | 3 +- .../apache/ignite/internal/util/typedef/X.java | 37 +++- .../visor/util/VisorExceptionWrapper.java | 11 +++--- .../communication/tcp/TcpCommunicationSpi.java | 2 +- .../ignite/GridSuppressedExceptionSelfTest.java | 23 +++- 5 files changed, 59 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef9259/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java index 7bb13d9..619be34 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java @@ -27,6 +27,7 @@ import org.apache.ignite.internal.processors.rest.handlers.GridRestCommandHandle import org.apache.ignite.internal.processors.rest.request.GridRestChangeStateRequest; import org.apache.ignite.internal.processors.rest.request.GridRestRequest; import org.apache.ignite.internal.util.future.GridFutureAdapter; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.internal.util.typedef.internal.U; @@ -78,7 +79,7 @@ public class GridChangeStateCommandHandler extends GridRestCommandHandlerAdapter sb.a(e.getMessage()).a("\n").a("suppressed: \n"); -for (Throwable t:e.getSuppressed()) +for (Throwable t : X.getSuppressedList(e)) sb.a(t.getMessage()).a("\n"); res.setError(sb.toString()); http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef9259/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java index 395de23..1a43daa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java @@ -469,14 +469,12 @@ public final class X { if (t == null || cls == null) return false; -if (t.getSuppressed() != null) { -for (Throwable th : t.getSuppressed()) { -if (cls.isAssignableFrom(th.getClass())) -return true; +for (Throwable th : t.getSuppressed()) { +if (cls.isAssignableFrom(th.getClass())) +return true; -if (hasSuppressed(th, cls)) -return true; -} +if (hasSuppressed(th, cls)) +return true; } return false; @@ -749,6 +747,29 @@ public final class X { } /** + * Collects suppressed exceptions from throwable and all it causes. + * + * @param t Throwable. + * @return List of suppressed throwables. + */ +public static List getSuppressedList(@Nullable Throwable t) { +List result = new ArrayList<>(); + +if (t == null) +return result; + +do { +for (Throwable suppressed : t.getSuppressed()) { +result.add(suppressed); + +result.addAll(getSuppressedList(suppressed)); +} +} while ((t = t.getCause()) != null); + +return result; +} + +/** * A way to get the entire nested stack-trace of an throwable. * * The result of this method is highly dependent on the JDK version @@ -889,4 +910,4 @@ public final class X { return dflt; } } -} \ No newline at e
ignite git commit: IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 b96271866 -> 2be10fdcd IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735. Signed-off-by: Alexey Kuznetsov (cherry picked from commit 98ef925) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2be10fdc Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2be10fdc Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2be10fdc Branch: refs/heads/ignite-2.5 Commit: 2be10fdcde3c529b866f85a5b74ff3d471c5c9c7 Parents: b962718 Author: Ilya Kasnacheev Authored: Wed Apr 11 19:32:52 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 19:34:26 2018 +0700 -- .../cluster/GridChangeStateCommandHandler.java | 3 +- .../apache/ignite/internal/util/typedef/X.java | 37 +++- .../visor/util/VisorExceptionWrapper.java | 11 +++--- .../communication/tcp/TcpCommunicationSpi.java | 2 +- .../ignite/GridSuppressedExceptionSelfTest.java | 23 +++- 5 files changed, 59 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2be10fdc/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java index 7bb13d9..619be34 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java @@ -27,6 +27,7 @@ import org.apache.ignite.internal.processors.rest.handlers.GridRestCommandHandle import org.apache.ignite.internal.processors.rest.request.GridRestChangeStateRequest; import org.apache.ignite.internal.processors.rest.request.GridRestRequest; import org.apache.ignite.internal.util.future.GridFutureAdapter; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.internal.util.typedef.internal.U; @@ -78,7 +79,7 @@ public class GridChangeStateCommandHandler extends GridRestCommandHandlerAdapter sb.a(e.getMessage()).a("\n").a("suppressed: \n"); -for (Throwable t:e.getSuppressed()) +for (Throwable t : X.getSuppressedList(e)) sb.a(t.getMessage()).a("\n"); res.setError(sb.toString()); http://git-wip-us.apache.org/repos/asf/ignite/blob/2be10fdc/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java index 395de23..1a43daa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java @@ -469,14 +469,12 @@ public final class X { if (t == null || cls == null) return false; -if (t.getSuppressed() != null) { -for (Throwable th : t.getSuppressed()) { -if (cls.isAssignableFrom(th.getClass())) -return true; +for (Throwable th : t.getSuppressed()) { +if (cls.isAssignableFrom(th.getClass())) +return true; -if (hasSuppressed(th, cls)) -return true; -} +if (hasSuppressed(th, cls)) +return true; } return false; @@ -749,6 +747,29 @@ public final class X { } /** + * Collects suppressed exceptions from throwable and all it causes. + * + * @param t Throwable. + * @return List of suppressed throwables. + */ +public static List getSuppressedList(@Nullable Throwable t) { +List result = new ArrayList<>(); + +if (t == null) +return result; + +do { +for (Throwable suppressed : t.getSuppressed()) { +result.add(suppressed); + +result.addAll(getSuppressedList(suppressed)); +} +} while ((t = t.getCause()) != null); + +return result; +} + +/** * A way to get the entire nested stack-trace of an throwable. * * The result of this method is highly dependent on the JDK version @@ -889,4 +910,4 @@ public final class X { return
ignite git commit: IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785.
Repository: ignite Updated Branches: refs/heads/master 98ef92593 -> 747e6c5f9 IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/747e6c5f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/747e6c5f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/747e6c5f Branch: refs/heads/master Commit: 747e6c5f9c635a5b9c6856efd2b94b05297b7f25 Parents: 98ef925 Author: Alexander Paschenko Authored: Wed Apr 11 16:20:16 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:20:16 2018 +0300 -- .../query/h2/twostep/GridMapQueryExecutor.java | 7 +++ .../query/h2/twostep/MapQueryLazyWorker.java | 13 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/747e6c5f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java index 9b1e4fa..930ada2 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java @@ -234,6 +234,13 @@ public class GridMapQueryExecutor { } /** + * @return Busy lock for lazy workers to guard their operations with. + */ +GridSpinBusyLock busyLock() { +return busyLock; +} + +/** * @param node Node. * @param msg Message. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/747e6c5f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java index 59c050f..98f3df9 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java @@ -80,8 +80,17 @@ public class MapQueryLazyWorker extends GridWorker { while (!isCancelled()) { Runnable task = tasks.take(); -if (task != null) -task.run(); +if (task != null) { +if (!exec.busyLock().enterBusy()) +return; + +try { +task.run(); +} +finally { +exec.busyLock().leaveBusy(); +} +} } } finally {
ignite git commit: IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 2be10fdcd -> 7f463be9f IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7f463be9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7f463be9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7f463be9 Branch: refs/heads/ignite-2.5 Commit: 7f463be9ff6c5d2d84b0aacc888159ffe68bf269 Parents: 2be10fd Author: Alexander Paschenko Authored: Wed Apr 11 16:20:16 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:24:24 2018 +0300 -- .../query/h2/twostep/GridMapQueryExecutor.java | 7 +++ .../query/h2/twostep/MapQueryLazyWorker.java | 13 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7f463be9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java index 9b1e4fa..930ada2 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java @@ -234,6 +234,13 @@ public class GridMapQueryExecutor { } /** + * @return Busy lock for lazy workers to guard their operations with. + */ +GridSpinBusyLock busyLock() { +return busyLock; +} + +/** * @param node Node. * @param msg Message. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/7f463be9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java index 59c050f..98f3df9 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java @@ -80,8 +80,17 @@ public class MapQueryLazyWorker extends GridWorker { while (!isCancelled()) { Runnable task = tasks.take(); -if (task != null) -task.run(); +if (task != null) { +if (!exec.busyLock().enterBusy()) +return; + +try { +task.run(); +} +finally { +exec.busyLock().leaveBusy(); +} +} } } finally {
ignite git commit: IGNITE-8221: Security for thin clients.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 7f463be9f -> 7eee6e247 IGNITE-8221: Security for thin clients. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7eee6e24 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7eee6e24 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7eee6e24 Branch: refs/heads/ignite-2.5 Commit: 7eee6e24736d8c0958e0107471c47ef4035037d8 Parents: 7f463be Author: Alexey Kukushkin Authored: Wed Apr 11 16:29:07 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:31:34 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 6 +++ .../client/ClientAuthenticationException.java | 2 +- .../client/ClientAuthorizationException.java| 46 .../internal/client/thin/ClientChannel.java | 3 +- .../internal/client/thin/TcpClientChannel.java | 39 - .../IgniteAuthenticationProcessor.java | 5 ++- .../processors/cache/GridCacheProcessor.java| 32 ++ .../processors/cache/GridCacheUtils.java| 5 +++ .../client/ClientConnectionContext.java | 45 ++- .../platform/client/ClientRequest.java | 29 .../platform/client/ClientStatus.java | 3 ++ .../cache/ClientCacheClearKeyRequest.java | 3 ++ .../cache/ClientCacheClearKeysRequest.java | 3 ++ .../client/cache/ClientCacheClearRequest.java | 3 ++ .../cache/ClientCacheContainsKeyRequest.java| 3 ++ .../cache/ClientCacheContainsKeysRequest.java | 3 ++ ...ientCacheCreateWithConfigurationRequest.java | 6 ++- .../cache/ClientCacheCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheDestroyRequest.java | 3 ++ .../client/cache/ClientCacheGetAllRequest.java | 3 ++ .../ClientCacheGetAndPutIfAbsentRequest.java| 3 ++ .../cache/ClientCacheGetAndPutRequest.java | 3 ++ .../cache/ClientCacheGetAndRemoveRequest.java | 3 ++ .../cache/ClientCacheGetAndReplaceRequest.java | 3 ++ ...acheGetOrCreateWithConfigurationRequest.java | 6 ++- .../ClientCacheGetOrCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheGetRequest.java | 3 ++ .../client/cache/ClientCacheGetSizeRequest.java | 3 ++ .../client/cache/ClientCachePutAllRequest.java | 3 ++ .../cache/ClientCachePutIfAbsentRequest.java| 3 ++ .../client/cache/ClientCachePutRequest.java | 3 ++ .../cache/ClientCacheRemoveAllRequest.java | 3 ++ .../cache/ClientCacheRemoveIfEqualsRequest.java | 3 ++ .../cache/ClientCacheRemoveKeyRequest.java | 3 ++ .../cache/ClientCacheRemoveKeysRequest.java | 3 ++ .../ClientCacheReplaceIfEqualsRequest.java | 3 ++ .../client/cache/ClientCacheReplaceRequest.java | 3 ++ .../client/cache/ClientCacheRequest.java| 32 ++ .../cache/ClientCacheScanQueryRequest.java | 3 ++ .../cache/ClientCacheSqlFieldsQueryRequest.java | 1 + .../cache/ClientCacheSqlQueryRequest.java | 1 + .../plugin/security/AuthenticationContext.java | 40 + .../plugin/security/SecurityPermission.java | 11 - .../ignite/spi/discovery/tcp/ServerImpl.java| 12 - 44 files changed, 371 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7eee6e24/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 9da123e..ac7947b 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -835,6 +835,12 @@ public final class IgniteSystemProperties { public static final String IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER = "IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER"; /** + * When set to {@code true}, on-heap cache cannot be enabled - see + * {@link CacheConfiguration#setOnheapCacheEnabled(boolean)}. + * Default is {@code false}. + */ +public static final String IGNITE_DISABLE_ONHEAP_CACHE = "IGNITE_DISABLE_ONHEAP_CACHE"; +/** * When set to {@code false}, loaded pages implementation is switched to previous version of implementation, * FullPageIdTable. {@code True} value enables 'Robin Hood hashing: backward shift deletion'. * Default is {@code true}. http://git-wip-us.apache.org/repos/asf/ignite/blob/7eee6e24/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/client/C
ignite git commit: IGNITE-8221: Security for thin clients.
Repository: ignite Updated Branches: refs/heads/master 747e6c5f9 -> 5a2927635 IGNITE-8221: Security for thin clients. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a292763 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a292763 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a292763 Branch: refs/heads/master Commit: 5a29276355c4eb8966e5825883e1232ee2a80509 Parents: 747e6c5 Author: Alexey Kukushkin Authored: Wed Apr 11 16:29:07 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:38:12 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 6 +++ .../client/ClientAuthenticationException.java | 2 +- .../client/ClientAuthorizationException.java| 46 .../internal/client/thin/ClientChannel.java | 3 +- .../internal/client/thin/TcpClientChannel.java | 39 - .../IgniteAuthenticationProcessor.java | 5 ++- .../processors/cache/GridCacheProcessor.java| 32 ++ .../processors/cache/GridCacheUtils.java| 5 +++ .../client/ClientConnectionContext.java | 45 ++- .../platform/client/ClientRequest.java | 29 .../platform/client/ClientStatus.java | 3 ++ .../cache/ClientCacheClearKeyRequest.java | 3 ++ .../cache/ClientCacheClearKeysRequest.java | 3 ++ .../client/cache/ClientCacheClearRequest.java | 3 ++ .../cache/ClientCacheContainsKeyRequest.java| 3 ++ .../cache/ClientCacheContainsKeysRequest.java | 3 ++ ...ientCacheCreateWithConfigurationRequest.java | 6 ++- .../cache/ClientCacheCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheDestroyRequest.java | 3 ++ .../client/cache/ClientCacheGetAllRequest.java | 3 ++ .../ClientCacheGetAndPutIfAbsentRequest.java| 3 ++ .../cache/ClientCacheGetAndPutRequest.java | 3 ++ .../cache/ClientCacheGetAndRemoveRequest.java | 3 ++ .../cache/ClientCacheGetAndReplaceRequest.java | 3 ++ ...acheGetOrCreateWithConfigurationRequest.java | 6 ++- .../ClientCacheGetOrCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheGetRequest.java | 3 ++ .../client/cache/ClientCacheGetSizeRequest.java | 3 ++ .../client/cache/ClientCachePutAllRequest.java | 3 ++ .../cache/ClientCachePutIfAbsentRequest.java| 3 ++ .../client/cache/ClientCachePutRequest.java | 3 ++ .../cache/ClientCacheRemoveAllRequest.java | 3 ++ .../cache/ClientCacheRemoveIfEqualsRequest.java | 3 ++ .../cache/ClientCacheRemoveKeyRequest.java | 3 ++ .../cache/ClientCacheRemoveKeysRequest.java | 3 ++ .../ClientCacheReplaceIfEqualsRequest.java | 3 ++ .../client/cache/ClientCacheReplaceRequest.java | 3 ++ .../client/cache/ClientCacheRequest.java| 32 ++ .../cache/ClientCacheScanQueryRequest.java | 3 ++ .../cache/ClientCacheSqlFieldsQueryRequest.java | 1 + .../cache/ClientCacheSqlQueryRequest.java | 1 + .../plugin/security/AuthenticationContext.java | 40 + .../plugin/security/SecurityPermission.java | 11 - .../ignite/spi/discovery/tcp/ServerImpl.java| 12 - 44 files changed, 371 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/5a292763/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 04eb425..662338c 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -835,6 +835,12 @@ public final class IgniteSystemProperties { public static final String IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER = "IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER"; /** + * When set to {@code true}, on-heap cache cannot be enabled - see + * {@link CacheConfiguration#setOnheapCacheEnabled(boolean)}. + * Default is {@code false}. + */ +public static final String IGNITE_DISABLE_ONHEAP_CACHE = "IGNITE_DISABLE_ONHEAP_CACHE"; +/** * When set to {@code false}, loaded pages implementation is switched to previous version of implementation, * FullPageIdTable. {@code True} value enables 'Robin Hood hashing: backward shift deletion'. * Default is {@code true}. http://git-wip-us.apache.org/repos/asf/ignite/blob/5a292763/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAut
ignite git commit: IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794.
Repository: ignite Updated Branches: refs/heads/master 5a2927635 -> 14402e403 IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/14402e40 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/14402e40 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/14402e40 Branch: refs/heads/master Commit: 14402e4030cf0257b72c636894f140f346266299 Parents: 5a29276 Author: devozerov Authored: Wed Apr 11 16:44:33 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:44:33 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSelfTest.java | 233 +++ .../jdbc/thin/ConnectionPropertiesImpl.java | 161 + 2 files changed, 300 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/14402e40/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java index 14b91b2..ed0b324 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java @@ -185,86 +185,136 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { } /** + * Test invalid socket buffer sizes with semicolon. + * + * @throws Exception If failed. + */ +public void testSocketBuffersSemicolon() throws Exception { +final int dfltDufSize = 64 * 1024; + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=-1", +"Property cannot be lower than 0 [name=socketSendBuffer, value=-1]"); + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=-1", +"Property cannot be lower than 0 [name=socketReceiveBuffer, value=-1]"); + +// Note that SO_* options are hints, so we check that value is equals to either what we set or to default. +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=1024")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=1024")) { +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(1024, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;" + +"socketSendBuffer=1024;socketReceiveBuffer=2048")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(2048, io(conn).connectionProperties().getSocketReceiveBuffer()); +} +} + +/** * Test SQL hints. * * @throws Exception If failed. */ public void testSqlHints() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) { -assertFalse(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, false, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?distributedJoins=true")) { -assertTrue(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, true, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?enforceJoinOrder=true")) { -
ignite git commit: IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 7eee6e247 -> b6ad3705c IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b6ad3705 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b6ad3705 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b6ad3705 Branch: refs/heads/ignite-2.5 Commit: b6ad3705c1e68683b72d2237037af66fea23a7ae Parents: 7eee6e2 Author: devozerov Authored: Wed Apr 11 16:44:33 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:45:22 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSelfTest.java | 233 +++ .../jdbc/thin/ConnectionPropertiesImpl.java | 161 + 2 files changed, 300 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b6ad3705/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java index 14b91b2..ed0b324 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java @@ -185,86 +185,136 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { } /** + * Test invalid socket buffer sizes with semicolon. + * + * @throws Exception If failed. + */ +public void testSocketBuffersSemicolon() throws Exception { +final int dfltDufSize = 64 * 1024; + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=-1", +"Property cannot be lower than 0 [name=socketSendBuffer, value=-1]"); + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=-1", +"Property cannot be lower than 0 [name=socketReceiveBuffer, value=-1]"); + +// Note that SO_* options are hints, so we check that value is equals to either what we set or to default. +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=1024")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=1024")) { +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(1024, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;" + +"socketSendBuffer=1024;socketReceiveBuffer=2048")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(2048, io(conn).connectionProperties().getSocketReceiveBuffer()); +} +} + +/** * Test SQL hints. * * @throws Exception If failed. */ public void testSqlHints() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) { -assertFalse(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, false, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?distributedJoins=true")) { -assertTrue(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, true, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?enforceJoinOrder=true")) {
ignite git commit: IGNITE-6679 Clean up some deprecated cache metrics
Repository: ignite Updated Branches: refs/heads/master 14402e403 -> 32fc6c3c1 IGNITE-6679 Clean up some deprecated cache metrics Signed-off-by: Anton Vinogradov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/32fc6c3c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/32fc6c3c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/32fc6c3c Branch: refs/heads/master Commit: 32fc6c3c1b013c8477acb9cf51d8326a13307c64 Parents: 14402e4 Author: NSAmelchev Authored: Wed Apr 11 16:59:59 2018 +0300 Committer: Anton Vinogradov Committed: Wed Apr 11 16:59:59 2018 +0300 -- .../src/main/java/org/apache/ignite/cache/CacheMetrics.java | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/32fc6c3c/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java index 0b1cb87..c466bee 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java @@ -262,6 +262,7 @@ public interface CacheMetrics { * * @return Current size of evict queue. */ +@Deprecated public int getDhtEvictQueueCurrentSize(); /** @@ -283,6 +284,7 @@ public interface CacheMetrics { * * @return Committed transaction queue size. */ +@Deprecated public int getTxCommitQueueSize(); /** @@ -290,6 +292,7 @@ public interface CacheMetrics { * * @return Prepared transaction queue size. */ +@Deprecated public int getTxPrepareQueueSize(); /** @@ -297,6 +300,7 @@ public interface CacheMetrics { * * @return Start version counts map size. */ +@Deprecated public int getTxStartVersionCountsSize(); /** @@ -332,6 +336,7 @@ public interface CacheMetrics { * * @return Committed DHT transaction queue size. */ +@Deprecated public int getTxDhtCommitQueueSize(); /** @@ -339,6 +344,7 @@ public interface CacheMetrics { * * @return Prepared DHT transaction queue size. */ +@Deprecated public int getTxDhtPrepareQueueSize(); /** @@ -346,6 +352,7 @@ public interface CacheMetrics { * * @return DHT start version counts map size. */ +@Deprecated public int getTxDhtStartVersionCountsSize(); /**
ignite git commit: IGNITE-6892 OOM should be covered by failure handling
Repository: ignite Updated Branches: refs/heads/master 32fc6c3c1 -> d1be9b855 IGNITE-6892 OOM should be covered by failure handling Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d1be9b85 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d1be9b85 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d1be9b85 Branch: refs/heads/master Commit: d1be9b85507eb3358327e93b81031f92e660531b Parents: 32fc6c3 Author: Aleksey Plekhanov Authored: Wed Apr 11 18:24:51 2018 +0300 Committer: Andrey Gura Committed: Wed Apr 11 18:24:51 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 8 + .../org/apache/ignite/internal/IgnitionEx.java | 50 +++- .../discovery/GridDiscoveryManager.java | 3 + .../processors/cache/WalStateManager.java | 8 +- .../continuous/GridContinuousProcessor.java | 3 + .../datastreamer/DataStreamProcessor.java | 3 + .../processors/failure/FailureProcessor.java| 11 + .../internal/processors/job/GridJobWorker.java | 8 +- .../service/GridServiceProcessor.java | 15 +- .../thread/IgniteStripedThreadPoolExecutor.java | 8 +- .../ignite/thread/IgniteThreadFactory.java | 30 ++- .../ignite/thread/IgniteThreadPoolExecutor.java | 12 +- .../ignite/thread/OomExceptionHandler.java | 44 .../ignite/failure/OomFailureHandlerTest.java | 255 +++ .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + 15 files changed, 430 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d1be9b85/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 662338c..437f49f 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -863,6 +863,14 @@ public final class IgniteSystemProperties { public static final String IGNITE_BPLUS_TREE_LOCK_RETRIES = "IGNITE_BPLUS_TREE_LOCK_RETRIES"; /** + * Amount of memory reserved in the heap at node start, which can be dropped to increase the chances of success when + * handling OutOfMemoryError. + * + * Default is {@code 64kb}. + */ +public static final String IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE = "IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE"; + +/** * The threshold of uneven distribution above which partition distribution will be logged. * * The default is '50', that means: warn about nodes with 50+% difference. http://git-wip-us.apache.org/repos/asf/ignite/blob/d1be9b85/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index 10a0752..b3c3ee8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.lang.Thread.UncaughtExceptionHandler; import java.lang.management.ManagementFactory; import java.lang.reflect.Constructor; import java.net.MalformedURLException; @@ -88,6 +89,7 @@ import org.apache.ignite.internal.util.typedef.CA; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.internal.util.typedef.T2; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; @@ -1764,6 +1766,13 @@ public class IgnitionEx { validateThreadPoolSize(cfg.getPublicThreadPoolSize(), "public"); +UncaughtExceptionHandler oomeHnd = new UncaughtExceptionHandler() { +@Override public void uncaughtException(Thread t, Throwable e) { +if (grid != null && X.hasCause(e, OutOfMemoryError.class)) +grid.context().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); +} +}; + execSvc = new IgniteThreadPoolExecutor( "pub", cfg.getIgniteInstanceName(), @@ -1771,7 +1780,8 @@ public class IgnitionEx
ignite git commit: IGNITE-7871 Check local join future on error. - Fixes #3793.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 b6ad3705c -> e6c30e17c IGNITE-7871 Check local join future on error. - Fixes #3793. Signed-off-by: dpavlov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e6c30e17 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e6c30e17 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e6c30e17 Branch: refs/heads/ignite-2.5 Commit: e6c30e17c6f0f1852fa781078ee54ccf8c654846 Parents: b6ad370 Author: Pavel Kovalenko Authored: Wed Apr 11 14:12:50 2018 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 11 18:51:52 2018 +0300 -- .../distributed/dht/preloader/latch/ExchangeLatchManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e6c30e17/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java index c205cb1..404f88f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java @@ -104,7 +104,8 @@ public class ExchangeLatchManager { // First coordinator initialization. ctx.discovery().localJoinFuture().listen(f -> { -this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); +if (f.error() == null) +this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); }); ctx.event().addDiscoveryEventListener((e, cache) -> {
ignite git commit: IGNITE-6892 OOM should be covered by failure handling
Repository: ignite Updated Branches: refs/heads/ignite-2.5 e6c30e17c -> 2769981a5 IGNITE-6892 OOM should be covered by failure handling Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2769981a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2769981a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2769981a Branch: refs/heads/ignite-2.5 Commit: 2769981a5df64f3cd0c38b7599c49580c66192fa Parents: e6c30e1 Author: Aleksey Plekhanov Authored: Wed Apr 11 18:24:51 2018 +0300 Committer: Andrey Gura Committed: Wed Apr 11 19:17:11 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 15 ++ .../org/apache/ignite/internal/IgnitionEx.java | 50 +++- .../discovery/GridDiscoveryManager.java | 3 + .../processors/cache/WalStateManager.java | 8 +- .../continuous/GridContinuousProcessor.java | 3 + .../datastreamer/DataStreamProcessor.java | 3 + .../processors/failure/FailureProcessor.java| 11 + .../internal/processors/job/GridJobWorker.java | 8 +- .../service/GridServiceProcessor.java | 15 +- .../thread/IgniteStripedThreadPoolExecutor.java | 8 +- .../ignite/thread/IgniteThreadFactory.java | 30 ++- .../ignite/thread/IgniteThreadPoolExecutor.java | 12 +- .../ignite/thread/OomExceptionHandler.java | 44 .../ignite/failure/OomFailureHandlerTest.java | 255 +++ .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + 15 files changed, 437 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2769981a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index ac7947b..437f49f 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -863,6 +863,21 @@ public final class IgniteSystemProperties { public static final String IGNITE_BPLUS_TREE_LOCK_RETRIES = "IGNITE_BPLUS_TREE_LOCK_RETRIES"; /** + * Amount of memory reserved in the heap at node start, which can be dropped to increase the chances of success when + * handling OutOfMemoryError. + * + * Default is {@code 64kb}. + */ +public static final String IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE = "IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE"; + +/** + * The threshold of uneven distribution above which partition distribution will be logged. + * + * The default is '50', that means: warn about nodes with 50+% difference. + */ +public static final String IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD = "IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD"; + +/** * Enforces singleton. */ private IgniteSystemProperties() { http://git-wip-us.apache.org/repos/asf/ignite/blob/2769981a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index c0de080..e140609 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.lang.Thread.UncaughtExceptionHandler; import java.lang.management.ManagementFactory; import java.lang.reflect.Constructor; import java.net.MalformedURLException; @@ -88,6 +89,7 @@ import org.apache.ignite.internal.util.typedef.CA; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.internal.util.typedef.T2; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; @@ -1764,6 +1766,13 @@ public class IgnitionEx { validateThreadPoolSize(cfg.getPublicThreadPoolSize(), "public"); +UncaughtExceptionHandler oomeHnd = new UncaughtExceptionHandler() { +@Override public void uncaughtException(Thread t, Throwable e) { +if (grid != null && X.hasCause(e, OutOfMemoryError.class)) +grid.context().failure().process(new FailureContext(FailureType.CR
ignite git commit: IGNITE-8201 Fixed tests.
Repository: ignite Updated Branches: refs/heads/ignite-8201 3780ac0a0 -> 6c01882d7 IGNITE-8201 Fixed tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6c01882d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6c01882d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6c01882d Branch: refs/heads/ignite-8201 Commit: 6c01882d7ef6a94bbb0b6f10d5290cb1a1e4a04f Parents: 3780ac0 Author: Alexey Kuznetsov Authored: Thu Apr 12 00:29:56 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 00:29:56 2018 +0700 -- .../JettyRestProcessorAbstractSelfTest.java | 29 ++-- ...ettyRestProcessorAuthenticationSelfTest.java | 27 -- .../processors/rest/GridRestProcessor.java | 15 ++ 3 files changed, 61 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6c01882d/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java index 38f22ba..e36447b 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java @@ -302,7 +302,11 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro JsonNode node = JSON_MAPPER.readTree(content); -assertEquals(bulk, node.get("affinityNodeId").isNull()); +JsonNode affNode = node.get("affinityNodeId"); + +if (affNode != null) +assertEquals(bulk, affNode.isNull()); + assertEquals(STATUS_SUCCESS, node.get("successStatus").asInt()); assertTrue(node.get("error").isNull()); @@ -350,7 +354,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro JsonNode node = JSON_MAPPER.readTree(content); -assertEquals(0, node.get("successStatus").asInt()); +assertEquals(STATUS_SUCCESS, node.get("successStatus").asInt()); assertTrue(node.get("error").isNull()); assertNotSame(securityEnabled(), node.get("sessionToken").isNull()); @@ -368,7 +372,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro JsonNode node = JSON_MAPPER.readTree(content); -assertEquals(0, node.get("successStatus").asInt()); +assertEquals(STATUS_SUCCESS, node.get("successStatus").asInt()); assertTrue(node.get("error").isNull()); assertFalse(node.get("response").isNull()); @@ -974,10 +978,25 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro assertCacheOperation(ret, true); } +/** */ +private void failIgnite_5874() { +DataStorageConfiguration dsCfg = ignite(0).configuration().getDataStorageConfiguration(); + +if (dsCfg.getDefaultDataRegionConfiguration().isPersistenceEnabled()) +fail("IGNITE-5874"); + +for (DataRegionConfiguration dataRegCfg : dsCfg.getDataRegionConfigurations()) { +if (dataRegCfg.isPersistenceEnabled()) +fail("IGNITE-5874"); +} +} + /** * @throws Exception If failed. */ public void testPutWithExpiration() throws Exception { +failIgnite_5874(); + String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_PUT, "key", "putKey", "val", "putVal", @@ -1014,6 +1033,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @throws Exception If failed. */ public void testAddWithExpiration() throws Exception { +failIgnite_5874(); + String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_ADD, "key", "addKey", "val", "addVal", @@ -1153,6 +1174,8 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro * @throws Exception If failed. */ public void testReplaceWithExpiration() throws Exception { +failIgnite_5874(); + jcache().put("replaceKey", "replaceVal"); assertEquals("replaceVal", jcache().get("replaceKey")); http://git-wip-us.apache.org/repos/asf/ignite/blob/6c01882d/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationSelfTest.java -- di
[4/9] ignite git commit: IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785.
IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/747e6c5f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/747e6c5f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/747e6c5f Branch: refs/heads/ignite-8201 Commit: 747e6c5f9c635a5b9c6856efd2b94b05297b7f25 Parents: 98ef925 Author: Alexander Paschenko Authored: Wed Apr 11 16:20:16 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:20:16 2018 +0300 -- .../query/h2/twostep/GridMapQueryExecutor.java | 7 +++ .../query/h2/twostep/MapQueryLazyWorker.java | 13 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/747e6c5f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java index 9b1e4fa..930ada2 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java @@ -234,6 +234,13 @@ public class GridMapQueryExecutor { } /** + * @return Busy lock for lazy workers to guard their operations with. + */ +GridSpinBusyLock busyLock() { +return busyLock; +} + +/** * @param node Node. * @param msg Message. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/747e6c5f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java index 59c050f..98f3df9 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java @@ -80,8 +80,17 @@ public class MapQueryLazyWorker extends GridWorker { while (!isCancelled()) { Runnable task = tasks.take(); -if (task != null) -task.run(); +if (task != null) { +if (!exec.busyLock().enterBusy()) +return; + +try { +task.run(); +} +finally { +exec.busyLock().leaveBusy(); +} +} } } finally {
[8/9] ignite git commit: IGNITE-6892 OOM should be covered by failure handling
IGNITE-6892 OOM should be covered by failure handling Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d1be9b85 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d1be9b85 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d1be9b85 Branch: refs/heads/ignite-8201 Commit: d1be9b85507eb3358327e93b81031f92e660531b Parents: 32fc6c3 Author: Aleksey Plekhanov Authored: Wed Apr 11 18:24:51 2018 +0300 Committer: Andrey Gura Committed: Wed Apr 11 18:24:51 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 8 + .../org/apache/ignite/internal/IgnitionEx.java | 50 +++- .../discovery/GridDiscoveryManager.java | 3 + .../processors/cache/WalStateManager.java | 8 +- .../continuous/GridContinuousProcessor.java | 3 + .../datastreamer/DataStreamProcessor.java | 3 + .../processors/failure/FailureProcessor.java| 11 + .../internal/processors/job/GridJobWorker.java | 8 +- .../service/GridServiceProcessor.java | 15 +- .../thread/IgniteStripedThreadPoolExecutor.java | 8 +- .../ignite/thread/IgniteThreadFactory.java | 30 ++- .../ignite/thread/IgniteThreadPoolExecutor.java | 12 +- .../ignite/thread/OomExceptionHandler.java | 44 .../ignite/failure/OomFailureHandlerTest.java | 255 +++ .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + 15 files changed, 430 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d1be9b85/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 662338c..437f49f 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -863,6 +863,14 @@ public final class IgniteSystemProperties { public static final String IGNITE_BPLUS_TREE_LOCK_RETRIES = "IGNITE_BPLUS_TREE_LOCK_RETRIES"; /** + * Amount of memory reserved in the heap at node start, which can be dropped to increase the chances of success when + * handling OutOfMemoryError. + * + * Default is {@code 64kb}. + */ +public static final String IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE = "IGNITE_FAILURE_HANDLER_RESERVE_BUFFER_SIZE"; + +/** * The threshold of uneven distribution above which partition distribution will be logged. * * The default is '50', that means: warn about nodes with 50+% difference. http://git-wip-us.apache.org/repos/asf/ignite/blob/d1be9b85/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index 10a0752..b3c3ee8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.lang.Thread.UncaughtExceptionHandler; import java.lang.management.ManagementFactory; import java.lang.reflect.Constructor; import java.net.MalformedURLException; @@ -88,6 +89,7 @@ import org.apache.ignite.internal.util.typedef.CA; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.internal.util.typedef.T2; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; @@ -1764,6 +1766,13 @@ public class IgnitionEx { validateThreadPoolSize(cfg.getPublicThreadPoolSize(), "public"); +UncaughtExceptionHandler oomeHnd = new UncaughtExceptionHandler() { +@Override public void uncaughtException(Thread t, Throwable e) { +if (grid != null && X.hasCause(e, OutOfMemoryError.class)) +grid.context().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); +} +}; + execSvc = new IgniteThreadPoolExecutor( "pub", cfg.getIgniteInstanceName(), @@ -1771,7 +1780,8 @@ public class IgnitionEx { cfg.getPublicThreadPoolSize(), DFLT_THRE
[3/9] ignite git commit: IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735.
IGNITE-8106 Collect suppressed exceptions from causes. - Fixes #3735. Signed-off-by: Alexey Kuznetsov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/98ef9259 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/98ef9259 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/98ef9259 Branch: refs/heads/ignite-8201 Commit: 98ef925933f392d419f70b2fcf51e3655b08b290 Parents: a3eb1f5 Author: Ilya Kasnacheev Authored: Wed Apr 11 19:32:52 2018 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 11 19:32:52 2018 +0700 -- .../cluster/GridChangeStateCommandHandler.java | 3 +- .../apache/ignite/internal/util/typedef/X.java | 37 +++- .../visor/util/VisorExceptionWrapper.java | 11 +++--- .../communication/tcp/TcpCommunicationSpi.java | 2 +- .../ignite/GridSuppressedExceptionSelfTest.java | 23 +++- 5 files changed, 59 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef9259/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java index 7bb13d9..619be34 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java @@ -27,6 +27,7 @@ import org.apache.ignite.internal.processors.rest.handlers.GridRestCommandHandle import org.apache.ignite.internal.processors.rest.request.GridRestChangeStateRequest; import org.apache.ignite.internal.processors.rest.request.GridRestRequest; import org.apache.ignite.internal.util.future.GridFutureAdapter; +import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.internal.util.typedef.internal.U; @@ -78,7 +79,7 @@ public class GridChangeStateCommandHandler extends GridRestCommandHandlerAdapter sb.a(e.getMessage()).a("\n").a("suppressed: \n"); -for (Throwable t:e.getSuppressed()) +for (Throwable t : X.getSuppressedList(e)) sb.a(t.getMessage()).a("\n"); res.setError(sb.toString()); http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef9259/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java index 395de23..1a43daa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java @@ -469,14 +469,12 @@ public final class X { if (t == null || cls == null) return false; -if (t.getSuppressed() != null) { -for (Throwable th : t.getSuppressed()) { -if (cls.isAssignableFrom(th.getClass())) -return true; +for (Throwable th : t.getSuppressed()) { +if (cls.isAssignableFrom(th.getClass())) +return true; -if (hasSuppressed(th, cls)) -return true; -} +if (hasSuppressed(th, cls)) +return true; } return false; @@ -749,6 +747,29 @@ public final class X { } /** + * Collects suppressed exceptions from throwable and all it causes. + * + * @param t Throwable. + * @return List of suppressed throwables. + */ +public static List getSuppressedList(@Nullable Throwable t) { +List result = new ArrayList<>(); + +if (t == null) +return result; + +do { +for (Throwable suppressed : t.getSuppressed()) { +result.add(suppressed); + +result.addAll(getSuppressedList(suppressed)); +} +} while ((t = t.getCause()) != null); + +return result; +} + +/** * A way to get the entire nested stack-trace of an throwable. * * The result of this method is highly dependent on the JDK version @@ -889,4 +910,4 @@ public final class X { return dflt; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef9259/mo
[9/9] ignite git commit: Merge branches 'ignite-8201' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201
Merge branches 'ignite-8201' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-8201 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4ba2436f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4ba2436f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4ba2436f Branch: refs/heads/ignite-8201 Commit: 4ba2436f6d01007e939a6ca409ee3cb1aa85af50 Parents: 6c01882 d1be9b8 Author: Alexey Kuznetsov Authored: Thu Apr 12 00:32:20 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 00:32:20 2018 +0700 -- .../jdbc/thin/JdbcThinConnectionSelfTest.java | 233 .../apache/ignite/IgniteSystemProperties.java | 21 ++ .../org/apache/ignite/cache/CacheMetrics.java | 7 + .../client/ClientAuthenticationException.java | 2 +- .../client/ClientAuthorizationException.java| 46 .../org/apache/ignite/internal/IgnitionEx.java | 50 +++- .../internal/client/thin/ClientChannel.java | 3 +- .../internal/client/thin/TcpClientChannel.java | 39 ++- .../jdbc/thin/ConnectionPropertiesImpl.java | 161 +++ .../discovery/GridDiscoveryManager.java | 3 + .../affinity/GridAffinityAssignmentCache.java | 50 +++- .../IgniteAuthenticationProcessor.java | 5 +- .../processors/cache/GridCacheProcessor.java| 32 +++ .../processors/cache/GridCacheUtils.java| 5 + .../processors/cache/WalStateManager.java | 8 +- .../preloader/latch/ExchangeLatchManager.java | 3 +- .../continuous/GridContinuousProcessor.java | 3 + .../datastreamer/DataStreamProcessor.java | 3 + .../processors/failure/FailureProcessor.java| 11 + .../internal/processors/job/GridJobWorker.java | 8 +- .../client/ClientConnectionContext.java | 45 +++- .../platform/client/ClientRequest.java | 29 ++ .../platform/client/ClientStatus.java | 3 + .../cache/ClientCacheClearKeyRequest.java | 3 + .../cache/ClientCacheClearKeysRequest.java | 3 + .../client/cache/ClientCacheClearRequest.java | 3 + .../cache/ClientCacheContainsKeyRequest.java| 3 + .../cache/ClientCacheContainsKeysRequest.java | 3 + ...ientCacheCreateWithConfigurationRequest.java | 6 +- .../cache/ClientCacheCreateWithNameRequest.java | 3 + .../client/cache/ClientCacheDestroyRequest.java | 3 + .../client/cache/ClientCacheGetAllRequest.java | 3 + .../ClientCacheGetAndPutIfAbsentRequest.java| 3 + .../cache/ClientCacheGetAndPutRequest.java | 3 + .../cache/ClientCacheGetAndRemoveRequest.java | 3 + .../cache/ClientCacheGetAndReplaceRequest.java | 3 + ...acheGetOrCreateWithConfigurationRequest.java | 6 +- .../ClientCacheGetOrCreateWithNameRequest.java | 3 + .../client/cache/ClientCacheGetRequest.java | 3 + .../client/cache/ClientCacheGetSizeRequest.java | 3 + .../client/cache/ClientCachePutAllRequest.java | 3 + .../cache/ClientCachePutIfAbsentRequest.java| 3 + .../client/cache/ClientCachePutRequest.java | 3 + .../cache/ClientCacheRemoveAllRequest.java | 3 + .../cache/ClientCacheRemoveIfEqualsRequest.java | 3 + .../cache/ClientCacheRemoveKeyRequest.java | 3 + .../cache/ClientCacheRemoveKeysRequest.java | 3 + .../ClientCacheReplaceIfEqualsRequest.java | 3 + .../client/cache/ClientCacheReplaceRequest.java | 3 + .../client/cache/ClientCacheRequest.java| 32 +++ .../cache/ClientCacheScanQueryRequest.java | 3 + .../cache/ClientCacheSqlFieldsQueryRequest.java | 1 + .../cache/ClientCacheSqlQueryRequest.java | 1 + .../cluster/GridChangeStateCommandHandler.java | 3 +- .../service/GridServiceProcessor.java | 15 +- .../apache/ignite/internal/util/typedef/X.java | 37 ++- .../visor/util/VisorExceptionWrapper.java | 11 +- .../plugin/security/AuthenticationContext.java | 40 +++ .../plugin/security/SecurityPermission.java | 11 +- .../communication/tcp/TcpCommunicationSpi.java | 2 +- .../ignite/spi/discovery/tcp/ServerImpl.java| 12 +- .../thread/IgniteStripedThreadPoolExecutor.java | 8 +- .../ignite/thread/IgniteThreadFactory.java | 30 ++- .../ignite/thread/IgniteThreadPoolExecutor.java | 12 +- .../ignite/thread/OomExceptionHandler.java | 44 +++ .../ignite/GridSuppressedExceptionSelfTest.java | 23 +- .../AffinityDistributionLoggingTest.java| 268 +++ .../ignite/failure/OomFailureHandlerTest.java | 255 ++ .../ignite/testsuites/IgniteBasicTestSuite.java | 2 + .../testsuites/IgniteCacheTestSuite5.java | 9 +- .../query/h2/twostep/GridMapQueryExecutor.java | 7 + .../query/h2/twostep/MapQueryLazyWorker.java| 13 +- 72 files changed, 1514 insertions(+), 179 deletions(-) --
[5/9] ignite git commit: IGNITE-8221: Security for thin clients.
IGNITE-8221: Security for thin clients. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a292763 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a292763 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a292763 Branch: refs/heads/ignite-8201 Commit: 5a29276355c4eb8966e5825883e1232ee2a80509 Parents: 747e6c5 Author: Alexey Kukushkin Authored: Wed Apr 11 16:29:07 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:38:12 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 6 +++ .../client/ClientAuthenticationException.java | 2 +- .../client/ClientAuthorizationException.java| 46 .../internal/client/thin/ClientChannel.java | 3 +- .../internal/client/thin/TcpClientChannel.java | 39 - .../IgniteAuthenticationProcessor.java | 5 ++- .../processors/cache/GridCacheProcessor.java| 32 ++ .../processors/cache/GridCacheUtils.java| 5 +++ .../client/ClientConnectionContext.java | 45 ++- .../platform/client/ClientRequest.java | 29 .../platform/client/ClientStatus.java | 3 ++ .../cache/ClientCacheClearKeyRequest.java | 3 ++ .../cache/ClientCacheClearKeysRequest.java | 3 ++ .../client/cache/ClientCacheClearRequest.java | 3 ++ .../cache/ClientCacheContainsKeyRequest.java| 3 ++ .../cache/ClientCacheContainsKeysRequest.java | 3 ++ ...ientCacheCreateWithConfigurationRequest.java | 6 ++- .../cache/ClientCacheCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheDestroyRequest.java | 3 ++ .../client/cache/ClientCacheGetAllRequest.java | 3 ++ .../ClientCacheGetAndPutIfAbsentRequest.java| 3 ++ .../cache/ClientCacheGetAndPutRequest.java | 3 ++ .../cache/ClientCacheGetAndRemoveRequest.java | 3 ++ .../cache/ClientCacheGetAndReplaceRequest.java | 3 ++ ...acheGetOrCreateWithConfigurationRequest.java | 6 ++- .../ClientCacheGetOrCreateWithNameRequest.java | 3 ++ .../client/cache/ClientCacheGetRequest.java | 3 ++ .../client/cache/ClientCacheGetSizeRequest.java | 3 ++ .../client/cache/ClientCachePutAllRequest.java | 3 ++ .../cache/ClientCachePutIfAbsentRequest.java| 3 ++ .../client/cache/ClientCachePutRequest.java | 3 ++ .../cache/ClientCacheRemoveAllRequest.java | 3 ++ .../cache/ClientCacheRemoveIfEqualsRequest.java | 3 ++ .../cache/ClientCacheRemoveKeyRequest.java | 3 ++ .../cache/ClientCacheRemoveKeysRequest.java | 3 ++ .../ClientCacheReplaceIfEqualsRequest.java | 3 ++ .../client/cache/ClientCacheReplaceRequest.java | 3 ++ .../client/cache/ClientCacheRequest.java| 32 ++ .../cache/ClientCacheScanQueryRequest.java | 3 ++ .../cache/ClientCacheSqlFieldsQueryRequest.java | 1 + .../cache/ClientCacheSqlQueryRequest.java | 1 + .../plugin/security/AuthenticationContext.java | 40 + .../plugin/security/SecurityPermission.java | 11 - .../ignite/spi/discovery/tcp/ServerImpl.java| 12 - 44 files changed, 371 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/5a292763/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 04eb425..662338c 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -835,6 +835,12 @@ public final class IgniteSystemProperties { public static final String IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER = "IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER"; /** + * When set to {@code true}, on-heap cache cannot be enabled - see + * {@link CacheConfiguration#setOnheapCacheEnabled(boolean)}. + * Default is {@code false}. + */ +public static final String IGNITE_DISABLE_ONHEAP_CACHE = "IGNITE_DISABLE_ONHEAP_CACHE"; +/** * When set to {@code false}, loaded pages implementation is switched to previous version of implementation, * FullPageIdTable. {@code True} value enables 'Robin Hood hashing: backward shift deletion'. * Default is {@code true}. http://git-wip-us.apache.org/repos/asf/ignite/blob/5a292763/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java b/modules/core/src/main/java/org/apache/ignite/cl
[7/9] ignite git commit: IGNITE-6679 Clean up some deprecated cache metrics
IGNITE-6679 Clean up some deprecated cache metrics Signed-off-by: Anton Vinogradov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/32fc6c3c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/32fc6c3c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/32fc6c3c Branch: refs/heads/ignite-8201 Commit: 32fc6c3c1b013c8477acb9cf51d8326a13307c64 Parents: 14402e4 Author: NSAmelchev Authored: Wed Apr 11 16:59:59 2018 +0300 Committer: Anton Vinogradov Committed: Wed Apr 11 16:59:59 2018 +0300 -- .../src/main/java/org/apache/ignite/cache/CacheMetrics.java | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/32fc6c3c/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java index 0b1cb87..c466bee 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java @@ -262,6 +262,7 @@ public interface CacheMetrics { * * @return Current size of evict queue. */ +@Deprecated public int getDhtEvictQueueCurrentSize(); /** @@ -283,6 +284,7 @@ public interface CacheMetrics { * * @return Committed transaction queue size. */ +@Deprecated public int getTxCommitQueueSize(); /** @@ -290,6 +292,7 @@ public interface CacheMetrics { * * @return Prepared transaction queue size. */ +@Deprecated public int getTxPrepareQueueSize(); /** @@ -297,6 +300,7 @@ public interface CacheMetrics { * * @return Start version counts map size. */ +@Deprecated public int getTxStartVersionCountsSize(); /** @@ -332,6 +336,7 @@ public interface CacheMetrics { * * @return Committed DHT transaction queue size. */ +@Deprecated public int getTxDhtCommitQueueSize(); /** @@ -339,6 +344,7 @@ public interface CacheMetrics { * * @return Prepared DHT transaction queue size. */ +@Deprecated public int getTxDhtPrepareQueueSize(); /** @@ -346,6 +352,7 @@ public interface CacheMetrics { * * @return DHT start version counts map size. */ +@Deprecated public int getTxDhtStartVersionCountsSize(); /**
[1/9] ignite git commit: IGNITE-7871 Check local join future on error. - Fixes #3793.
Repository: ignite Updated Branches: refs/heads/ignite-8201 6c01882d7 -> 4ba2436f6 IGNITE-7871 Check local join future on error. - Fixes #3793. Signed-off-by: dpavlov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0e73fa2c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e73fa2c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e73fa2c Branch: refs/heads/ignite-8201 Commit: 0e73fa2c10dcd96ff98279018bdd3f8b36568008 Parents: 74d2545 Author: Pavel Kovalenko Authored: Wed Apr 11 14:12:50 2018 +0300 Committer: dpavlov Committed: Wed Apr 11 14:12:50 2018 +0300 -- .../distributed/dht/preloader/latch/ExchangeLatchManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0e73fa2c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java index c205cb1..404f88f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java @@ -104,7 +104,8 @@ public class ExchangeLatchManager { // First coordinator initialization. ctx.discovery().localJoinFuture().listen(f -> { -this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); +if (f.error() == null) +this.coordinator = getLatchCoordinator(AffinityTopologyVersion.NONE); }); ctx.event().addDiscoveryEventListener((e, cache) -> {
[6/9] ignite git commit: IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794.
IGNITE-8148: JDBC thin: semicolon as delimiter for properties. This closes #3794. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/14402e40 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/14402e40 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/14402e40 Branch: refs/heads/ignite-8201 Commit: 14402e4030cf0257b72c636894f140f346266299 Parents: 5a29276 Author: devozerov Authored: Wed Apr 11 16:44:33 2018 +0300 Committer: devozerov Committed: Wed Apr 11 16:44:33 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSelfTest.java | 233 +++ .../jdbc/thin/ConnectionPropertiesImpl.java | 161 + 2 files changed, 300 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/14402e40/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java index 14b91b2..ed0b324 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java @@ -185,86 +185,136 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest { } /** + * Test invalid socket buffer sizes with semicolon. + * + * @throws Exception If failed. + */ +public void testSocketBuffersSemicolon() throws Exception { +final int dfltDufSize = 64 * 1024; + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=-1", +"Property cannot be lower than 0 [name=socketSendBuffer, value=-1]"); + +assertInvalid("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=-1", +"Property cannot be lower than 0 [name=socketReceiveBuffer, value=-1]"); + +// Note that SO_* options are hints, so we check that value is equals to either what we set or to default. +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketSendBuffer=1024")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;socketReceiveBuffer=1024")) { +assertEquals(dfltDufSize, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(1024, io(conn).connectionProperties().getSocketReceiveBuffer()); +} + +try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1;" + +"socketSendBuffer=1024;socketReceiveBuffer=2048")) { +assertEquals(1024, io(conn).connectionProperties().getSocketSendBuffer()); +assertEquals(2048, io(conn).connectionProperties().getSocketReceiveBuffer()); +} +} + +/** * Test SQL hints. * * @throws Exception If failed. */ public void testSqlHints() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) { -assertFalse(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, false, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?distributedJoins=true")) { -assertTrue(io(conn).connectionProperties().isDistributedJoins()); -assertFalse(io(conn).connectionProperties().isEnforceJoinOrder()); -assertFalse(io(conn).connectionProperties().isCollocated()); -assertFalse(io(conn).connectionProperties().isReplicatedOnly()); -assertFalse(io(conn).connectionProperties().isLazy()); - assertFalse(io(conn).connectionProperties().isSkipReducerOnUpdate()); +assertHints(conn, true, false, false, false, false, false); } try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?enforceJoinOrder=true")) { -assertFalse(io(conn).connectionProperties().isDistributedJoins()); -
[2/9] ignite git commit: IGNITE-4756 Print info about partition distribution to log
IGNITE-4756 Print info about partition distribution to log Signed-off-by: Anton Vinogradov Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a3eb1f5d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a3eb1f5d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a3eb1f5d Branch: refs/heads/ignite-8201 Commit: a3eb1f5d753a38c4019440e1bf39d00bc6136455 Parents: 0e73fa2 Author: Vyacheslav Daradur Authored: Wed Apr 11 14:41:29 2018 +0300 Committer: Anton Vinogradov Committed: Wed Apr 11 14:41:29 2018 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 7 + .../affinity/GridAffinityAssignmentCache.java | 50 +++- .../AffinityDistributionLoggingTest.java| 268 +++ .../testsuites/IgniteCacheTestSuite5.java | 9 +- 4 files changed, 327 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a3eb1f5d/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 9da123e..04eb425 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -857,6 +857,13 @@ public final class IgniteSystemProperties { public static final String IGNITE_BPLUS_TREE_LOCK_RETRIES = "IGNITE_BPLUS_TREE_LOCK_RETRIES"; /** + * The threshold of uneven distribution above which partition distribution will be logged. + * + * The default is '50', that means: warn about nodes with 50+% difference. + */ +public static final String IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD = "IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD"; + +/** * Enforces singleton. */ private IgniteSystemProperties() { http://git-wip-us.apache.org/repos/asf/ignite/blob/a3eb1f5d/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java index 18edd02..b1899e3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java @@ -34,13 +34,14 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; +import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.AffinityCentralizedFunction; import org.apache.ignite.cache.affinity.AffinityFunction; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.internal.GridKernalContext; -import org.apache.ignite.internal.cluster.NodeOrderComparator; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.cluster.NodeOrderComparator; import org.apache.ignite.internal.managers.discovery.DiscoCache; import org.apache.ignite.internal.processors.cache.ExchangeDiscoveryEvents; import org.apache.ignite.internal.processors.cluster.BaselineTopology; @@ -53,7 +54,10 @@ import org.apache.ignite.lang.IgnitePredicate; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.IgniteSystemProperties.IGNITE_AFFINITY_HISTORY_SIZE; +import static org.apache.ignite.IgniteSystemProperties.IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD; +import static org.apache.ignite.IgniteSystemProperties.getFloat; import static org.apache.ignite.IgniteSystemProperties.getInteger; +import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT; /** @@ -63,6 +67,9 @@ public class GridAffinityAssignmentCache { /** Cleanup history size. */ private final int MAX_HIST_SIZE = getInteger(IGNITE_AFFINITY_HISTORY_SIZE, 500); +/** Partition distribution. */ +private final float partDistribution = getFloat(IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD, 50f); + /** Group name if specified or cache name. */ private final String cacheOrGrpName; @@ -367,6 +374,9 @@ public class GridAffinityAssignmentCache { idealAssignment = assignment; +if (ctx.cache().cacheMode(cacheOr
ignite git commit: IGNITE-8201 Fixed tests.
Repository: ignite Updated Branches: refs/heads/ignite-8201 4ba2436f6 -> 3316080a6 IGNITE-8201 Fixed tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3316080a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3316080a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3316080a Branch: refs/heads/ignite-8201 Commit: 3316080a67edb27a7ee6c35dcd2579be8ecc8dcb Parents: 4ba2436 Author: Alexey Kuznetsov Authored: Thu Apr 12 10:32:31 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 10:32:31 2018 +0700 -- .../processors/rest/GridRestProcessor.java | 9 +++-- .../auth/AuthenticationCommandHandler.java | 2 -- .../protocols/http/jetty/GridJettyRestHandler.java | 17 +++-- 3 files changed, 10 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java index c7a74c5..205fb73 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java @@ -344,7 +344,7 @@ public class GridRestProcessor extends GridProcessorAdapter { assert res != null; -if ((ctx.authentication().enabled() || ctx.security().enabled()) && !failed) +if ((authenticationEnabled || securityEnabled) && !failed) res.sessionTokenBytes(req.sessionToken()); interceptResponse(res, req); @@ -457,10 +457,7 @@ public class GridRestProcessor extends GridProcessorAdapter { try { sesExpTime = System.getProperty(IgniteSystemProperties.IGNITE_REST_SESSION_TIMEOUT); -if (sesExpTime != null) -sesExpTime0 = Long.valueOf(sesExpTime) * 1000; -else -sesExpTime0 = DEFAULT_SES_TIMEOUT; +sesExpTime0 = sesExpTime != null ? Long.valueOf(sesExpTime) * 1000 : DEFAULT_SES_TIMEOUT; } catch (NumberFormatException ignore) { U.warn(log, "Failed parsing IGNITE_REST_SESSION_TIMEOUT system variable [IGNITE_REST_SESSION_TIMEOUT=" @@ -510,8 +507,8 @@ public class GridRestProcessor extends GridProcessorAdapter { addHandler(new QueryCommandHandler(ctx)); addHandler(new GridLogCommandHandler(ctx)); addHandler(new GridChangeStateCommandHandler(ctx)); -addHandler(new UserActionCommandHandler(ctx)); addHandler(new AuthenticationCommandHandler(ctx)); +addHandler(new UserActionCommandHandler(ctx)); // Start protocols. startTcpProtocol(); http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java index 0cecf3d..6016338 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/auth/AuthenticationCommandHandler.java @@ -57,8 +57,6 @@ public class AuthenticationCommandHandler extends GridRestCommandHandlerAdapter log.debug("Handling topology REST request: " + req); try { -GridRestCommand cmd = req.command(); - if (log.isDebugEnabled()) log.debug("Handled topology REST request [req=" + req + ']'); http://git-wip-us.apache.org/repos/asf/ignite/blob/3316080a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java -- diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java index 7f20dca..1afdae1 100644 --- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors
[13/17] ignite git commit: IGNITE-7996 Move config state module index.
IGNITE-7996 Move config state module index. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d5e0be03 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d5e0be03 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d5e0be03 Branch: refs/heads/master Commit: d5e0be034df0a5f8f8cd8402707f9dc773e1d209 Parents: c2c03a9 Author: Ilya Borisov Authored: Fri Apr 6 11:19:07 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:19:07 2018 +0700 -- .../page-configure/configuration.state.js | 297 +++ .../app/modules/states/configuration.state.js | 297 --- 2 files changed, 297 insertions(+), 297 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d5e0be03/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js new file mode 100644 index 000..1a0a598 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/configuration.state.js @@ -0,0 +1,297 @@ +/* + * 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 {default as ActivitiesData} from 'app/core/activities/Activities.data'; + +// Common directives. +import previewPanel from './configuration/preview-panel.directive.js'; + +// Summary screen. +import ConfigurationResource from './configuration/Configuration.resource'; +import IgniteSummaryZipper from './configuration/summary/summary-zipper.service'; + +import base2 from 'views/base2.pug'; +import pageConfigureAdvancedClusterComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-cluster/component'; +import pageConfigureAdvancedModelsComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-models/component'; +import pageConfigureAdvancedCachesComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-caches/component'; +import pageConfigureAdvancedIGFSComponent from 'app/components/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(); +}]; + +/** + * @param {ActivitiesData} ActivitiesData + * @param {uirouter.UIRouter} $uiRouter + */ +function initConfiguration(ActivitiesData, $uiRouter) { +$uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => { +ActivitiesData.post({group: 'configuration', action: transition.targetState().name()}); +}); +} + +initConfiguration.$inject = ['IgniteActivitiesData', '$uiRouter']; + +angular.module('ignite-console.states.configuration', ['ui.router']) +.directive(...previewPanel) +// Services. +.service('IgniteSummaryZipper', IgniteSummaryZipper) +.service('IgniteConfigurationResource', ConfigurationResource) +.run(initConfiguration) +// Configure state provider. +.config(['$stateProvider', ($stateProvider) => { +// Setup the states. +$stateProvider +.state('base.configuration', { +abstract: true, +permission: 'configuration', +url: '/configuration', +
[02/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug b/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug deleted file mode 100644 index b9eb8fc..000 --- a/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug +++ /dev/null @@ -1,72 +0,0 @@ -//- -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 = 'general' --var model = 'backupItem' - -panel-collapsible(opened=`::true` ng-form=form) -panel-title General -panel-description -| General IGFS configuration. - a.link-success(href="https://apacheignite-fs.readme.io/docs/in-memory-file-system"; target="_blank") More info -panel-content.pca-form-row -.pca-form-column-6.pc-form-grid-row -.pc-form-grid-col-60 -+sane-ignite-form-field-text({ -label: 'Name:', -model: `${model}.name`, -name: '"igfsName"', -placeholder: 'Input name', -required: true -})( -ignite-unique='$ctrl.igfss' -ignite-unique-property='name' -ignite-unique-skip=`["_id", ${model}]` -) -+unique-feedback(`${model}.name`, 'IGFS name should be unique.') -.pc-form-grid-col-30 -+sane-ignite-form-field-dropdown({ -label: 'IGFS mode:', -model: `${model}.defaultMode`, -name: '"defaultMode"', -placeholder: '{{::$ctrl.IGFSs.defaultMode.default}}', -options: '{{::$ctrl.IGFSs.defaultMode.values}}', -tip: ` -Mode to specify how IGFS interacts with Hadoop file system - -PRIMARY - in this mode IGFS will not delegate to secondary Hadoop file system and will cache all the files in memory only -PROXY - in this mode IGFS will not cache any files in memory and will only pass them through to secondary file system -DUAL_SYNC - in this mode IGFS will cache files locally and also synchronously write them through to secondary file system -DUAL_ASYNC - in this mode IGFS will cache files locally and also asynchronously write them through to secondary file system - -` -}) -.pc-form-grid-col-30 -+sane-ignite-form-field-number({ -label: 'Group size:', -model: `${model}.affinnityGroupSize`, -name: '"affinnityGroupSize"', -placeholder: '{{::$ctrl.IGFSs.affinnityGroupSize.default}}', -min: '{{::$ctrl.IGFSs.affinnityGroupSize.min}}', -tip: ` -Size of the group in blocks -Required for construction of affinity mapper in IGFS data cache -` -}) -.pca-form-column-6 -+preview-xml-java(model, 'igfsGeneral') http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug b/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug deleted file mode 100644 index ef024b4..000 --- a/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug +++ /dev/null @@ -1,55 +0,0 @@ -//- -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
[15/17] ignite git commit: IGNITE-7996 Rename configuration.state to states.
IGNITE-7996 Rename configuration.state to states. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/14dd2df1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/14dd2df1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/14dd2df1 Branch: refs/heads/master Commit: 14dd2df15361de1fbcf2dbe2451a90f95567ab41 Parents: 2800ef0 Author: Ilya Borisov Authored: Fri Apr 6 11:20:39 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:20:39 2018 +0700 -- .../page-configure/configuration.state.js | 273 --- .../app/components/page-configure/states.js | 273 +++ 2 files changed, 273 insertions(+), 273 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/14dd2df1/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js deleted file mode 100644 index f8bb4dc..000 --- a/modules/web-console/frontend/app/components/page-configure/configuration.state.js +++ /dev/null @@ -1,273 +0,0 @@ -/* - * 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}); -}); -}] -},
[11/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug index 4dd0e17..c2bfd68 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug @@ -18,57 +18,57 @@ include /app/helpers/jade/mixins form(id='cluster' name='ui.inputForm' novalidate ng-submit='$ctrl.save()') .panel-group -include /app/modules/states/configuration/clusters/general +include ./templates/general -include /app/modules/states/configuration/clusters/atomic -include /app/modules/states/configuration/clusters/binary -include /app/modules/states/configuration/clusters/cache-key-cfg -include /app/modules/states/configuration/clusters/checkpoint +include ./templates/atomic +include ./templates/binary +include ./templates/cache-key-cfg +include ./templates/checkpoint //- Since ignite 2.3 -include /app/modules/states/configuration/clusters/client-connector +include ./templates/client-connector -include /app/modules/states/configuration/clusters/collision -include /app/modules/states/configuration/clusters/communication -include /app/modules/states/configuration/clusters/connector -include /app/modules/states/configuration/clusters/deployment +include ./templates/collision +include ./templates/communication +include ./templates/connector +include ./templates/deployment //- Since ignite 2.3 -include /app/modules/states/configuration/clusters/data-storage +include ./templates/data-storage -include /app/modules/states/configuration/clusters/discovery -include /app/modules/states/configuration/clusters/events -include /app/modules/states/configuration/clusters/failover -include /app/modules/states/configuration/clusters/hadoop -include /app/modules/states/configuration/clusters/load-balancing -include /app/modules/states/configuration/clusters/logger -include /app/modules/states/configuration/clusters/marshaller +include ./templates/discovery +include ./templates/events +include ./templates/failover +include ./templates/hadoop +include ./templates/load-balancing +include ./templates/logger +include ./templates/marshaller //- Since ignite 2.0, deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/memory +include ./templates/memory -include /app/modules/states/configuration/clusters/misc -include /app/modules/states/configuration/clusters/metrics +include ./templates/misc +include ./templates/metrics //- Deprecated in ignite 2.1 -include /app/modules/states/configuration/clusters/odbc +include ./templates/odbc //- Since ignite 2.1, deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/persistence +include ./templates/persistence //- Deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/sql-connector +include ./templates/sql-connector -include /app/modules/states/configuration/clusters/service -include /app/modules/states/configuration/clusters/ssl +include ./templates/service +include ./templates/ssl //- Removed in ignite 2.0 -include /app/modules/states/configuration/clusters/swap +include ./templates/swap -include /app/modules/states/configuration/clusters/thread -include /app/modules/states/configuration/clusters/time -include /app/modules/states/configuration/clusters/transactions -include /app/modules/states/configuration/clusters/attributes +include ./templates/thread +include ./templates/time +include ./templates/transactions +include ./templates/attributes .pc-form-actions-panel(n_g-show='$ctrl.$scope.selectedItem') button-preview-project(cluster='$ctrl.cluster' ng-hide='$ctrl.isNew') http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug -- diff --git a/modules/web-console/frontend/app
[17/17] ignite git commit: IGNITE-7996 Merge with master.
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 Authored: Thu Apr 12 11:07:02 2018 +0700 Committer: Alexey Kuznetsov 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/i
[05/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug deleted file mode 100644 index bd8971a..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug +++ /dev/null @@ -1,134 +0,0 @@ -//- -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', '6', '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\ -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 connectionsIf set to -1 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 c
[09/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug new file mode 100644 index 000..83e8f2a --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug @@ -0,0 +1,24 @@ +//- +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 + +mixin discovery-shared(modelAt = '$ctrl.clonedCluster') +-const model = `${modelAt}.discovery.SharedFs` + +.pc-form-grid-row&attributes(attributes=attributes) +.pc-form-grid-col-60 ++text('File path:', `${model}.path`, '"path"', 'false', 'disco/tcp', 'Shared path') http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug new file mode 100644 index 000..1266f86 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug @@ -0,0 +1,55 @@ +//- +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 + +//- Static discovery +mixin discovery-vm(modelAt = '$ctrl.clonedCluster') +-const model = `${modelAt}.discovery.Vm` +-const addresses = `${model}.addresses` + +.pc-form-grid-row&attributes(attributes=attributes) +.pc-form-grid-col-60 +.ignite-form-field +.ignite-form-field__control ++list-addresses({ +items: addresses, +name: 'vmAddresses', +tip: `Addresses may be represented as follows: + +IP address (e.g. 127.0.0.1, 9.9.9.9, etc) +IP address and port (e.g. 127.0.0.1:47500, 9.9.9.9:47501, etc) +IP address and port range (e.g. 127.0.0.1:47500..47510, 9.9.9.9:47501..47504, etc) +Hostname (e.g. host1.com, host2, etc) +Hostname and port (e.g. host1.com:47500, host2:47502, etc) +Hostname and port range (e.g. host1.com:47500..47510, host2:47502..47508, etc) + +If port is 0 or not provided then default port will be used (depends on discovery SPI configuration) +If port range is provided (e.g. host:port1..port2) the following should be considered: + +
[03/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug deleted file mode 100644 index cdc7258..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug +++ /dev/null @@ -1,58 +0,0 @@ -//- -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 = 'misc' --var model = '$ctrl.clonedCluster' - -panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) -panel-title Miscellaneous -panel-description Various miscellaneous cluster settings. -panel-content.pca-form-row(ng-if=`ui.isPanelLoaded('${form}')`) -.pca-form-column-6.pc-form-grid-row -.pc-form-grid-col-60 -+text('Work directory:', model + '.workDirectory', '"workDirectory"', 'false', 'Input work directory', -'Ignite work directory.\ -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.') - -//- Since ignite 2.0 -.pc-form-grid-col-60(ng-if-start='$ctrl.available("2.0.0")') -+text('Consistent ID:', model + '.consistentId', '"ConsistentId"', 'false', 'Input consistent ID', 'Consistent globally unique node ID which survives node restarts') -.pc-form-grid-col-60 -+java-class('Warmup closure:', model + '.warmupClosure', '"warmupClosure"', 'true', 'false', 'This closure will be executed before actual grid instance start') -.pc-form-grid-col-60 -+checkbox('Active on start', model + '.activeOnStart', '"activeOnStart"', -'If cluster is not active on start, there will be no cache partition map exchanges performed until the cluster is activated') -.pc-form-grid-col-60(ng-if-end) -+checkbox('Cache sanity check enabled', model + '.cacheSanityCheckEnabled', '"cacheSanityCheckEnabled"', -'If enabled, then Ignite will perform the following checks and throw an exception if check fails\ -\ -Cache entry is not externally locked with lock or lockAsync methods when entry is enlisted to transaction\ -Each entry in affinity group - lock transaction has the same affinity key as was specified on affinity transaction start\ -Each entry in partition group - lock transaction belongs to the same partition as was specified on partition transaction start\ -') - -.pc-form-grid-col-60(ng-if='$ctrl.available(["1.0.0", "2.1.0"])') -+checkbox('Late affinity assignment', model + '.lateAffinityAssignment', '"lateAffinityAssignment"', -'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")') -+number('Long query timeout:', `${model}.longQueryWarningTimeout`, '"LongQueryWarningTimeout"', 'true', '3000', '0', -'Timeout in milliseconds after which long query warning will be printed') -.pca-form-column-6 -+preview-xml-java(model, 'clusterMisc', 'caches') http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug deleted file mode 100644 index 74b1f02..000 --- a/modules/web-console/frontend/app/modules/s
[07/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug new file mode 100644 index 000..ed91ec4 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug @@ -0,0 +1,255 @@ +//- +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 = 'query' +-var model = 'backupItem' +-var queryKeyFields = `${model}.queryKeyFields` +-var queryFields = `${model}.fields` +-var queryAliases = `${model}.aliases` +-var queryIndexes = `${model}.indexes` + +panel-collapsible(ng-form=form opened=`!!${model}.queryMetadata`) +panel-title#query-title Domain model for SQL query +panel-description +| Domain model properties for fields queries. + a.link-success(href='https://apacheignite.readme.io/docs/cache-queries' target='_blank') More info +panel-content.pca-form-row +.pca-form-column-6.pc-form-grid-row +.content-not-available( +ng-if=`${model}.queryMetadata === 'Annotations'` +style='margin-top: 10px' +) +label Not available for annotated types + +.pc-form-grid-col-60(ng-if-start=`${model}.queryMetadata === 'Configuration'`) ++text('Table name:', `${model}.tableName`, '"tableName"', 'false', 'Enter table name') + +.pc-form-grid-col-30(ng-if-start='$ctrl.available("2.0.0")') ++text('Key field name:', `${model}.keyFieldName`, '"keyFieldName"', 'false', 'Enter key field name', +'Key name.' + +'Can be used in field list to denote the key as a whole') +.pc-form-grid-col-30(ng-if-end) ++text('Value field name:', `${model}.valueFieldName`, '"valueFieldName"', 'false', 'Enter value field name', +'Value name.' + +'Can be used in field list to denote the entire value') + +.pc-form-grid-col-60 +mixin domains-query-fields +.ignite-form-field ++ignite-form-field__label('Fields:', '"fields"') ++tooltip(`Collection of name-to-type mappings to be queried, in addition to indexed fields`) +.ignite-form-field__control +-let items = queryFields +list-editable( +ng-model=items +name='queryFields' +ng-change=`$ctrl.onQueryFieldsChange(${model})` +) +list-editable-item-view +| {{ $item.name}} / {{ $item.className}} + +list-editable-item-edit +- form = '$parent.form' +.pc-form-grid-row +.pc-form-grid-col-30(divider='/') ++ignite-form-field-text('Field name:', '$item.name', '"name"', false, true, 'Enter field name')( +data-ignite-unique=items + data-ignite-unique-property='name' +ignite-auto-focus +) ++unique-feedback('"name"', 'Property with such name already exists!') +.pc-form-grid-col-30 ++java-class-typeahead('Field full class name:', `$item.className`, '"className"', '$ctrl.queryFieldTypes', true, true,
[14/17] ignite git commit: IGNITE-7996 Use configuration.state for state registration only.
IGNITE-7996 Use configuration.state for state registration only. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2800ef08 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2800ef08 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2800ef08 Branch: refs/heads/master Commit: 2800ef084fe480224fcb14f12a73ccb24007edb0 Parents: d5e0be0 Author: Ilya Borisov Authored: Fri Apr 6 11:20:13 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:20:13 2018 +0700 -- .../page-configure/configuration.state.js | 490 +-- 1 file changed, 233 insertions(+), 257 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2800ef08/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js index 1a0a598..f8bb4dc 100644 --- a/modules/web-console/frontend/app/components/page-configure/configuration.state.js +++ b/modules/web-console/frontend/app/components/page-configure/configuration.state.js @@ -17,20 +17,11 @@ import angular from 'angular'; -import {default as ActivitiesData} from 'app/core/activities/Activities.data'; - -// Common directives. -import previewPanel from './configuration/preview-panel.directive.js'; - -// Summary screen. -import ConfigurationResource from './configuration/Configuration.resource'; -import IgniteSummaryZipper from './configuration/summary/summary-zipper.service'; - import base2 from 'views/base2.pug'; -import pageConfigureAdvancedClusterComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-cluster/component'; -import pageConfigureAdvancedModelsComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-models/component'; -import pageConfigureAdvancedCachesComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-caches/component'; -import pageConfigureAdvancedIGFSComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-igfs/component'; +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'; @@ -47,251 +38,236 @@ const shortCachesResolve = ['ConfigSelectors', 'ConfigureState', 'ConfigEffects' .toPromise(); }]; -/** - * @param {ActivitiesData} ActivitiesData - * @param {uirouter.UIRouter} $uiRouter - */ -function initConfiguration(ActivitiesData, $uiRouter) { -$uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => { -ActivitiesData.post({group: 'configuration', action: transition.targetState().name()}); +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: 'b
[08/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug new file mode 100644 index 000..74b1f02 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug @@ -0,0 +1,70 @@ +//- +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 = 'odbcConfiguration' +-var model = '$ctrl.clonedCluster.odbc' +-var enabled = model + '.odbcEnabled' + +panel-collapsible( +ng-form=form +on-open=`ui.loadPanel('${form}')` +ng-show='$ctrl.available(["1.0.0", "2.1.0"])' +) +panel-title ODBC configuration +panel-description +| ODBC server configuration. +| #[a.link-success(href="https://apacheignite.readme.io/docs/odbc-driver"; target="_blank") More info] +panel-content.pca-form-row(ng-if=`$ctrl.available(["1.0.0", "2.1.0"]) && ui.isPanelLoaded('${form}')`) +.pca-form-column-6 +.settings-row ++sane-form-field-checkbox({ +label: 'Enabled', +model: enabled, +name: '"odbcEnabled"', +tip: 'Flag indicating whether to configure ODBC configuration' +})( +ui-validate=`{ +correctMarshaller: '$ctrl.Clusters.odbc.odbcEnabled.correctMarshaller($ctrl.clonedCluster, $value)' +}` + ui-validate-watch='$ctrl.Clusters.odbc.odbcEnabled.correctMarshallerWatch("$ctrl.clonedCluster")' +) ++form-field-feedback(null, 'correctMarshaller', 'ODBC can only be used with BinaryMarshaller') +.settings-row ++text-ip-address-with-port-range('ODBC endpoint address:', `${model}.endpointAddress`, '"endpointAddress"', enabled, '0.0.0.0:10800..10810', +'ODBC endpoint address. \ +The following address formats are permitted:\ +\ +hostname - will use provided hostname and default port range\ +hostname:port - will use provided hostname and port\ +hostname:port_from..port_to - will use provided hostname and port range\ +') +.settings-row ++number('Send buffer size:', `${model}.socketSendBufferSize`, '"ODBCSocketSendBufferSize"', enabled, '0', '0', +'Socket send buffer size.\ +When set to 0, operation system default will be used') +.settings-row ++number('Socket receive buffer size:', `${model}.socketReceiveBufferSize`, '"ODBCSocketReceiveBufferSize"', enabled, '0', '0', +'Socket receive buffer size.\ +When set to 0, operation system default will be used') +.settings-row ++number('Maximum open cursors', `${model}.maxOpenCursors`, '"maxOpenCursors"', enabled, '128', '1', 'Maximum number of opened cursors per connection') +.settings-row ++number('Pool size:', `${model}.threadPoolSize`, '"ODBCThreadPoolSize"', enabled, 'max(8, availableProcessors)', '1', +'Size of thread pool that is in charge of processing ODBC tasks') +.pca-form-column-6 ++preview-xml-java(model, 'clusterODBC') http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persist
[04/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug deleted file mode 100644 index 639a374..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug +++ /dev/null @@ -1,63 +0,0 @@ -//- -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 - -mixin discovery-multicast(modelAt = '$ctrl.clonedCluster') --const model = `${modelAt}.discovery.Multicast` --const addresses = `${model}.addresses` - -.pc-form-grid-row&attributes(attributes=attributes) -.pc-form-grid-col-30 -+text-ip-address('IP address:', `${model}.multicastGroup`, '"multicastGroup"', 'true', '228.1.2.4', 'IP address of multicast group') -.pc-form-grid-col-30 -+number-min-max('Port number:', `${model}.multicastPort`, '"multicastPort"', 'true', '47400', '0', '65535', 'Port number which multicast messages are sent to') -.pc-form-grid-col-20 -+number('Waits for reply:', `${model}.responseWaitTime`, '"responseWaitTime"', 'true', '500', '0', -'Time in milliseconds IP finder waits for reply to multicast address request') -.pc-form-grid-col-20 -+number('Attempts count:', `${model}.addressRequestAttempts`, '"addressRequestAttempts"', 'true', '2', '0', -'Number of attempts to send multicast address request\ -IP finder re - sends request only in case if no reply for previous request is received') -.pc-form-grid-col-20 -+text-ip-address('Local address:', `${model}.localAddress`, '"localAddress"', 'true', '0.0.0.0', -'Local host address used by this IP finder\ -If provided address is non - loopback then multicast socket is bound to this interface\ -If local address is not set or is any local address then IP finder creates multicast sockets for all found non - loopback addresses') -.pc-form-grid-col-60 -.ignite-form-field -.ignite-form-field__control -+list-addresses({ -items: addresses, -name: 'multicastAddresses', -tip: `Addresses may be represented as follows: - -IP address (e.g. 127.0.0.1, 9.9.9.9, etc) -IP address and port (e.g. 127.0.0.1:47500, 9.9.9.9:47501, etc) -IP address and port range (e.g. 127.0.0.1:47500..47510, 9.9.9.9:47501..47504, etc) -Hostname (e.g. host1.com, host2, etc) -Hostname and port (e.g. host1.com:47500, host2:47502, etc) -Hostname and port range (e.g. host1.com:47500..47510, host2:47502..47508, etc) - -If port is 0 or not provided then default port will be used (depends on discovery SPI configuration) -If port range is provided (e.g. host:port1..port2) the following should be considered: - - - port1 < port2 should be true - Both port1 and port2 should be greater than 0 -` -}) - http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug deleted file m
[12/17] ignite git commit: IGNITE-7996 Move configuration form templates.
IGNITE-7996 Move configuration form templates. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c2c03a92 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c2c03a92 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c2c03a92 Branch: refs/heads/master Commit: c2c03a92e80ee64f9be14d4978c61dd090643f3c Parents: 538e13a Author: Ilya Borisov Authored: Fri Apr 6 11:17:05 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:17:05 2018 +0700 -- .../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-for
[16/17] ignite git commit: IGNITE-7996 Move configuration assets into page-configure module.
IGNITE-7996 Move configuration assets into page-configure module. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d02e87b9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d02e87b9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d02e87b9 Branch: refs/heads/master Commit: d02e87b9dafd95bf13fa52b7d7e5bc75bec3303b Parents: 14dd2df Author: Ilya Borisov Authored: Fri Apr 6 11:22:20 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:22:20 2018 +0700 -- modules/web-console/frontend/app/app.js | 2 - .../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 +++ .../configuration/Configuration.resource.js | 42 .../configuration/preview-panel.directive.js| 239 -- .../summary/summary-zipper.service.js | 39 --- .../configuration/summary/summary.worker.js | 147 --- 11 files changed, 533 insertions(+), 470 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d02e87b9/modules/web-console/frontend/app/app.js -- diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js index 757be22..692acc5 100644 --- a/modules/web-console/frontend/app/app.js +++ b/modules/web-console/frontend/app/app.js @@ -27,7 +27,6 @@ import './modules/nodes/nodes.module'; import './modules/demo/Demo.module'; import './modules/states/logout.state'; -import './modules/states/configuration.state'; import './modules/states/admin.state'; import './modules/states/errors.state'; @@ -192,7 +191,6 @@ angular.module('ignite-console', [ 'ignite-console.demo', // States. 'ignite-console.states.logout', -'ignite-console.states.configuration', 'ignite-console.states.admin', 'ignite-console.states.errors', // Common modules. http://git-wip-us.apache.org/repos/asf/ignite/blob/d02e87b9/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js b/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js new file mode 100644 index 000..b7519ce --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js @@ -0,0 +1,246 @@ +/* + * 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 ace from 'brace'; +import _ from 'lodash'; + +/** + * @param {ng.IIntervalService} $interval + * @param {ng.ITimeoutService} $timeout + */ +export default function previewPanelDirective($interval, $timeout) { +let animation = {editor: null, stage: 0, start: 0, stop: 0}; +let prevContent = []; + +const Range = ace.acequire('ace/range').Range; + +const _clearSelection = (editor) => { +_.forEach(editor.session.getMarkers(false), (marker) => { +editor.session.removeMarker(marker.id); +}); +}; + +/** + * Switch to next stage of animation. + */ +const _animate = () => { +animation.stage += animation.step; + +const stage = animation.stage; +const editor = animation.editor; + +_clearSelection(editor); + +animation.selections.forEach((selection) => { +editor.session.addMarker(new Range(selection.start, 0, selection.stop, 0), +'preview-highlight-' + stage, 'line', false); +}); + +if (stage === animation.finalStage) { +editor.animatePromise = null; + +if (animation.clearOnFinal) +
[10/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug new file mode 100644 index 000..76c5016 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug @@ -0,0 +1,100 @@ +//- +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 = 'connector' +-var model = '$ctrl.clonedCluster.connector' +-var enabled = model + '.enabled' +-var sslEnabled = enabled + ' && ' + model + '.sslEnabled' + +panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) +panel-title Connector configuration +panel-description +| Configure HTTP REST configuration to enable HTTP server features. +| #[a.link-success(href="https://apacheignite.readme.io/docs/rest-api#general-configuration"; 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-60 ++checkbox('Enabled', enabled, '"restEnabled"', 'Flag indicating whether to configure connector configuration') +.pc-form-grid-col-60 ++text-enabled('Jetty configuration path:', `${model}.jettyPath`, '"connectorJettyPath"', enabled, 'false', 'Input path to Jetty configuration', +'Path, either absolute or relative to IGNITE_HOME, to Jetty XML configuration file\ +Jetty is used to support REST over HTTP protocol for accessing Ignite APIs remotely\ +If not provided, Jetty instance with default configuration will be started picking IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT as host and port respectively') +.pc-form-grid-col-20 ++text-ip-address('TCP host:', `${model}.host`, '"connectorHost"', enabled, 'IgniteConfiguration#getLocalHost()', +'Host for TCP binary protocol server\ +This can be either an IP address or a domain name\ +If not defined, system - wide local address will be used IgniteConfiguration#getLocalHost()\ +You can also use "0.0.0.0" value to bind to all locally - available IP addresses') +.pc-form-grid-col-20 ++number-min-max('TCP port:', `${model}.port`, '"connectorPort"', enabled, '11211', '1024', '65535', 'Port for TCP binary protocol server') +.pc-form-grid-col-20 ++number('TCP port range:', `${model}.portRange`, '"connectorPortRange"', enabled, '100', '1', 'Number of ports for TCP binary protocol server to try if configured port is already in use') +.pc-form-grid-col-60 ++number('Idle query cursor timeout:', `${model}.idleQueryCursorTimeout`, '"connectorIdleQueryCursorTimeout"', enabled, '60', '0', +'Reject open query cursors that is not used timeout\ +If no fetch query request come within idle timeout, it will be removed on next check for old query cursors') +.pc-form-grid-col-60 ++number('Idle query cursor check frequency:', `${model}.idleQueryCursorCheckFrequency`, '"connectorIdleQueryCursorCheckFrequency"', enabled, '6', '0', +'Idle query cursors check frequency\ +This setting is used to reject open query cursors that is not used') +.pc-form-grid-col-30 ++number('Idle timeout:', `${model}.idleTimeout`, '"connectorIdleTimeout"', enabled, '7000', '0', +'Idle timeout for REST server\ +This setting is used to reject half - opened sockets\ +If no
[06/17] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2c03a92/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug b/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug deleted file mode 100644 index 32d966a..000 --- a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug +++ /dev/null @@ -1,310 +0,0 @@ -//- -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 = 'store' --var model = '$ctrl.clonedCache' - -mixin hibernateField(name, model, items, valid, save, newItem) --var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)' --var onEnter = `${valid} && (${save}); ${valid} && ${resetOnEnter};` - --var onEscape = newItem ? 'group.add = []' : 'field.edit = false' - --var resetOnBlur = newItem ? '!stopblur && (group.add = [])' : 'field.edit = false' --var onBlur = `${valid} && (${save}); ${resetOnBlur};` - -div(ignite-on-focus-out=onBlur) -if block -block - -.input-tip -+ignite-form-field-input(name, model, false, 'true', 'key=value')( -data-ignite-property-unique=items -data-ignite-property-value-specified -data-ignite-form-field-input-autofocus='true' - -ignite-on-enter=onEnter -ignite-on-escape=onEscape -) - -panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) -panel-title Store -panel-description -| Cache store settings. -| #[a.link-success(href="https://apacheignite.readme.io/docs/3rd-party-store"; target="_blank") More info] -panel-content.pca-form-row(ng-if=`ui.isPanelLoaded('${form}')`) -.pca-form-column-6.pc-form-grid-row --var storeFactory = `${model}.cacheStoreFactory`; --var storeFactoryKind = `${storeFactory}.kind`; -.pc-form-grid-col-60 -+sane-ignite-form-field-dropdown({ -label: 'Store factory:', -model: storeFactoryKind, -name: '"cacheStoreFactory"', -placeholder: '{{ ::$ctrl.Caches.cacheStoreFactory.kind.default }}', -options: '::$ctrl.Caches.cacheStoreFactory.values', -tip: `Factory for persistent storage for cache data - -JDBC POJO store factory - Objects are stored in underlying database by using java beans mapping description via reflection backed by JDBC -JDBC BLOB store factory - Objects are stored in underlying database in BLOB format backed by JDBC -Hibernate BLOB store factory - Objects are stored in underlying database in BLOB format backed by Hibernate -` -})( -ui-validate=`{ -writeThroughOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.writeThrough)', -readThroughOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.readThrough)', -writeBehindOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.writeBehindEnabled)' -}` -ui-validate-watch-collection=`"[${model}.readThrough, ${model}.writeThrough, ${model}.writeBehindEnabled]"` -ng-model-options='{allowInvalid: true}' -) -+form-field-feedback(null, 'writeThroughOn', 'Write through is enabled but store is not set') -+form-field-feedback(null, 'readThroughOn', 'Read through is enabled but store is not set') -+form-field-feedback(null, 'writeBehindOn', 'Write-behind is enabled but store is not set') -.pc-form-group(ng-if=storeFactoryKind) -.pc-form-grid-row(ng-if=`${storeFactoryKind} === 'CacheJdbcPojoStoreFactory
[01/17] ignite git commit: IGNITE-7996 Update lockfile.
Repository: ignite Updated Branches: refs/heads/master d1be9b855 -> e333f306d IGNITE-7996 Update lockfile. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/538e13a6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/538e13a6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/538e13a6 Branch: refs/heads/master Commit: 538e13a6c0c264b8bc203d4f4d32f153e5cf5c56 Parents: a064702 Author: Ilya Borisov Authored: Fri Apr 6 11:15:56 2018 +0700 Committer: Ilya Borisov Committed: Fri Apr 6 11:15:56 2018 +0700 -- modules/web-console/frontend/package-lock.json | 877 +++- 1 file changed, 854 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/538e13a6/modules/web-console/frontend/package-lock.json -- diff --git a/modules/web-console/frontend/package-lock.json b/modules/web-console/frontend/package-lock.json index 071dec0..39b2826 100644 --- a/modules/web-console/frontend/package-lock.json +++ b/modules/web-console/frontend/package-lock.json @@ -205,6 +205,16 @@ "preact": "7.2.1" } }, +"JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz";, + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { +"jsonparse": "1.3.1", +"through": "2.3.8" + } +}, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz";, @@ -1848,6 +1858,15 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz";, "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" }, +"bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz";, + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { +"tweetnacl": "0.14.5" + } +}, "better-assert": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz";, @@ -1992,9 +2011,9 @@ "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dev": true, "requires": { +"JSONStream": "1.3.2", "combine-source-map": "0.8.0", "defined": "1.0.0", -"JSONStream": "1.3.2", "safe-buffer": "5.1.1", "through2": "2.0.3", "umd": "3.0.3" @@ -2034,6 +2053,7 @@ "integrity": "sha512-gKfOsNQv/toWz+60nSPfYzuwSEdzvV2WdxrVPUbPD/qui44rAkB3t3muNtmmGYHqrG56FGwX9SUEQmzNLAeS7g==", "dev": true, "requires": { +"JSONStream": "1.3.2", "assert": "1.4.1", "browser-pack": "6.1.0", "browser-resolve": "1.11.2", @@ -2055,7 +2075,6 @@ "https-browserify": "1.0.0", "inherits": "2.0.3", "insert-module-globals": "7.0.5", -"JSONStream": "1.3.2", "labeled-stream-splicer": "2.0.1", "module-deps": "4.1.1", "os-browserify": "0.3.0", @@ -2547,6 +2566,7 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.1", +"fsevents": "1.1.3", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -3964,6 +3984,15 @@ "stream-shift": "1.0.0" } }, +"ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz";, + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { +"jsbn": "0.1.1" + } +}, "editions": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz";, @@ -5202,6 +5231,795 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz";, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, +"fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz";, + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "optional": true, + "requires": { +"nan": "2.10.0", +"node-pre-gyp": "0.6.39" + }, + "dependencies": { +"abbrev": { + "version": "1.1.0", + "bundled": true, + "optional": true +}, +"ajv": { + "version": "4.11.8", + "bundled": true, + "optional": true, + "requires": { +"co": "4.6.0", +"json-stable-stringify": "1.0.1" + } +}, +
[15/16] ignite git commit: IGNITE-7996 Move configuration assets into page-configure module.
IGNITE-7996 Move configuration assets into page-configure module. (cherry picked from commit d02e87b) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1d5f45b4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1d5f45b4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1d5f45b4 Branch: refs/heads/ignite-2.5 Commit: 1d5f45b4eb900a3c4cc0bedb8919b35f2a0032c8 Parents: a2d9f97 Author: Ilya Borisov Authored: Fri Apr 6 11:22:20 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:18:18 2018 +0700 -- modules/web-console/frontend/app/app.js | 2 - .../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 +++ .../configuration/Configuration.resource.js | 42 .../configuration/preview-panel.directive.js| 239 -- .../summary/summary-zipper.service.js | 39 --- .../configuration/summary/summary.worker.js | 147 --- 11 files changed, 533 insertions(+), 470 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1d5f45b4/modules/web-console/frontend/app/app.js -- diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js index 757be22..692acc5 100644 --- a/modules/web-console/frontend/app/app.js +++ b/modules/web-console/frontend/app/app.js @@ -27,7 +27,6 @@ import './modules/nodes/nodes.module'; import './modules/demo/Demo.module'; import './modules/states/logout.state'; -import './modules/states/configuration.state'; import './modules/states/admin.state'; import './modules/states/errors.state'; @@ -192,7 +191,6 @@ angular.module('ignite-console', [ 'ignite-console.demo', // States. 'ignite-console.states.logout', -'ignite-console.states.configuration', 'ignite-console.states.admin', 'ignite-console.states.errors', // Common modules. http://git-wip-us.apache.org/repos/asf/ignite/blob/1d5f45b4/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js b/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js new file mode 100644 index 000..b7519ce --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/components/preview-panel/directive.js @@ -0,0 +1,246 @@ +/* + * 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 ace from 'brace'; +import _ from 'lodash'; + +/** + * @param {ng.IIntervalService} $interval + * @param {ng.ITimeoutService} $timeout + */ +export default function previewPanelDirective($interval, $timeout) { +let animation = {editor: null, stage: 0, start: 0, stop: 0}; +let prevContent = []; + +const Range = ace.acequire('ace/range').Range; + +const _clearSelection = (editor) => { +_.forEach(editor.session.getMarkers(false), (marker) => { +editor.session.removeMarker(marker.id); +}); +}; + +/** + * Switch to next stage of animation. + */ +const _animate = () => { +animation.stage += animation.step; + +const stage = animation.stage; +const editor = animation.editor; + +_clearSelection(editor); + +animation.selections.forEach((selection) => { +editor.session.addMarker(new Range(selection.start, 0, selection.stop, 0), +'preview-highlight-' + stage, 'line', false); +}); + +if (stage === animation.finalStage) { +editor.animatePromise = null; + +
[16/16] ignite git commit: IGNITE-7996 Merge with master.
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/a5a83d21 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5a83d21 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5a83d21 Branch: refs/heads/ignite-2.5 Commit: a5a83d211a572b8419866fabbc31975168157729 Parents: 1d5f45b Author: Alexey Kuznetsov Authored: Thu Apr 12 11:21:23 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:21:23 2018 +0700 -- .../web-console/frontend/app/components/page-configure/states.js | 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a5a83d21/modules/web-console/frontend/app/components/page-configure/states.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/states.js b/modules/web-console/frontend/app/components/page-configure/states.js index f8bb4dc..a75e851 100644 --- a/modules/web-console/frontend/app/components/page-configure/states.js +++ b/modules/web-console/frontend/app/components/page-configure/states.js @@ -15,15 +15,12 @@ * 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]+`;
[08/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug new file mode 100644 index 000..83e8f2a --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug @@ -0,0 +1,24 @@ +//- +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 + +mixin discovery-shared(modelAt = '$ctrl.clonedCluster') +-const model = `${modelAt}.discovery.SharedFs` + +.pc-form-grid-row&attributes(attributes=attributes) +.pc-form-grid-col-60 ++text('File path:', `${model}.path`, '"path"', 'false', 'disco/tcp', 'Shared path') http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug new file mode 100644 index 000..1266f86 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug @@ -0,0 +1,55 @@ +//- +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 + +//- Static discovery +mixin discovery-vm(modelAt = '$ctrl.clonedCluster') +-const model = `${modelAt}.discovery.Vm` +-const addresses = `${model}.addresses` + +.pc-form-grid-row&attributes(attributes=attributes) +.pc-form-grid-col-60 +.ignite-form-field +.ignite-form-field__control ++list-addresses({ +items: addresses, +name: 'vmAddresses', +tip: `Addresses may be represented as follows: + +IP address (e.g. 127.0.0.1, 9.9.9.9, etc) +IP address and port (e.g. 127.0.0.1:47500, 9.9.9.9:47501, etc) +IP address and port range (e.g. 127.0.0.1:47500..47510, 9.9.9.9:47501..47504, etc) +Hostname (e.g. host1.com, host2, etc) +Hostname and port (e.g. host1.com:47500, host2:47502, etc) +Hostname and port range (e.g. host1.com:47500..47510, host2:47502..47508, etc) + +If port is 0 or not provided then default port will be used (depends on discovery SPI configuration) +If port range is provided (e.g. host:port1..port2) the following should be considered: + +
[10/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug index 4dd0e17..c2bfd68 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug @@ -18,57 +18,57 @@ include /app/helpers/jade/mixins form(id='cluster' name='ui.inputForm' novalidate ng-submit='$ctrl.save()') .panel-group -include /app/modules/states/configuration/clusters/general +include ./templates/general -include /app/modules/states/configuration/clusters/atomic -include /app/modules/states/configuration/clusters/binary -include /app/modules/states/configuration/clusters/cache-key-cfg -include /app/modules/states/configuration/clusters/checkpoint +include ./templates/atomic +include ./templates/binary +include ./templates/cache-key-cfg +include ./templates/checkpoint //- Since ignite 2.3 -include /app/modules/states/configuration/clusters/client-connector +include ./templates/client-connector -include /app/modules/states/configuration/clusters/collision -include /app/modules/states/configuration/clusters/communication -include /app/modules/states/configuration/clusters/connector -include /app/modules/states/configuration/clusters/deployment +include ./templates/collision +include ./templates/communication +include ./templates/connector +include ./templates/deployment //- Since ignite 2.3 -include /app/modules/states/configuration/clusters/data-storage +include ./templates/data-storage -include /app/modules/states/configuration/clusters/discovery -include /app/modules/states/configuration/clusters/events -include /app/modules/states/configuration/clusters/failover -include /app/modules/states/configuration/clusters/hadoop -include /app/modules/states/configuration/clusters/load-balancing -include /app/modules/states/configuration/clusters/logger -include /app/modules/states/configuration/clusters/marshaller +include ./templates/discovery +include ./templates/events +include ./templates/failover +include ./templates/hadoop +include ./templates/load-balancing +include ./templates/logger +include ./templates/marshaller //- Since ignite 2.0, deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/memory +include ./templates/memory -include /app/modules/states/configuration/clusters/misc -include /app/modules/states/configuration/clusters/metrics +include ./templates/misc +include ./templates/metrics //- Deprecated in ignite 2.1 -include /app/modules/states/configuration/clusters/odbc +include ./templates/odbc //- Since ignite 2.1, deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/persistence +include ./templates/persistence //- Deprecated in ignite 2.3 -include /app/modules/states/configuration/clusters/sql-connector +include ./templates/sql-connector -include /app/modules/states/configuration/clusters/service -include /app/modules/states/configuration/clusters/ssl +include ./templates/service +include ./templates/ssl //- Removed in ignite 2.0 -include /app/modules/states/configuration/clusters/swap +include ./templates/swap -include /app/modules/states/configuration/clusters/thread -include /app/modules/states/configuration/clusters/time -include /app/modules/states/configuration/clusters/transactions -include /app/modules/states/configuration/clusters/attributes +include ./templates/thread +include ./templates/time +include ./templates/transactions +include ./templates/attributes .pc-form-actions-panel(n_g-show='$ctrl.$scope.selectedItem') button-preview-project(cluster='$ctrl.cluster' ng-hide='$ctrl.isNew') http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug -- diff --git a/modules/web-console/frontend/app
[05/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug b/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug deleted file mode 100644 index 32d966a..000 --- a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug +++ /dev/null @@ -1,310 +0,0 @@ -//- -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 = 'store' --var model = '$ctrl.clonedCache' - -mixin hibernateField(name, model, items, valid, save, newItem) --var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)' --var onEnter = `${valid} && (${save}); ${valid} && ${resetOnEnter};` - --var onEscape = newItem ? 'group.add = []' : 'field.edit = false' - --var resetOnBlur = newItem ? '!stopblur && (group.add = [])' : 'field.edit = false' --var onBlur = `${valid} && (${save}); ${resetOnBlur};` - -div(ignite-on-focus-out=onBlur) -if block -block - -.input-tip -+ignite-form-field-input(name, model, false, 'true', 'key=value')( -data-ignite-property-unique=items -data-ignite-property-value-specified -data-ignite-form-field-input-autofocus='true' - -ignite-on-enter=onEnter -ignite-on-escape=onEscape -) - -panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) -panel-title Store -panel-description -| Cache store settings. -| #[a.link-success(href="https://apacheignite.readme.io/docs/3rd-party-store"; target="_blank") More info] -panel-content.pca-form-row(ng-if=`ui.isPanelLoaded('${form}')`) -.pca-form-column-6.pc-form-grid-row --var storeFactory = `${model}.cacheStoreFactory`; --var storeFactoryKind = `${storeFactory}.kind`; -.pc-form-grid-col-60 -+sane-ignite-form-field-dropdown({ -label: 'Store factory:', -model: storeFactoryKind, -name: '"cacheStoreFactory"', -placeholder: '{{ ::$ctrl.Caches.cacheStoreFactory.kind.default }}', -options: '::$ctrl.Caches.cacheStoreFactory.values', -tip: `Factory for persistent storage for cache data - -JDBC POJO store factory - Objects are stored in underlying database by using java beans mapping description via reflection backed by JDBC -JDBC BLOB store factory - Objects are stored in underlying database in BLOB format backed by JDBC -Hibernate BLOB store factory - Objects are stored in underlying database in BLOB format backed by Hibernate -` -})( -ui-validate=`{ -writeThroughOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.writeThrough)', -readThroughOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.readThrough)', -writeBehindOn: '$ctrl.Caches.cacheStoreFactory.storeDisabledValueOff(${model}, ${model}.writeBehindEnabled)' -}` -ui-validate-watch-collection=`"[${model}.readThrough, ${model}.writeThrough, ${model}.writeBehindEnabled]"` -ng-model-options='{allowInvalid: true}' -) -+form-field-feedback(null, 'writeThroughOn', 'Write through is enabled but store is not set') -+form-field-feedback(null, 'readThroughOn', 'Read through is enabled but store is not set') -+form-field-feedback(null, 'writeBehindOn', 'Write-behind is enabled but store is not set') -.pc-form-group(ng-if=storeFactoryKind) -.pc-form-grid-row(ng-if=`${storeFactoryKind} === 'CacheJdbcPojoStoreFactory
[06/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug new file mode 100644 index 000..ed91ec4 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug @@ -0,0 +1,255 @@ +//- +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 = 'query' +-var model = 'backupItem' +-var queryKeyFields = `${model}.queryKeyFields` +-var queryFields = `${model}.fields` +-var queryAliases = `${model}.aliases` +-var queryIndexes = `${model}.indexes` + +panel-collapsible(ng-form=form opened=`!!${model}.queryMetadata`) +panel-title#query-title Domain model for SQL query +panel-description +| Domain model properties for fields queries. + a.link-success(href='https://apacheignite.readme.io/docs/cache-queries' target='_blank') More info +panel-content.pca-form-row +.pca-form-column-6.pc-form-grid-row +.content-not-available( +ng-if=`${model}.queryMetadata === 'Annotations'` +style='margin-top: 10px' +) +label Not available for annotated types + +.pc-form-grid-col-60(ng-if-start=`${model}.queryMetadata === 'Configuration'`) ++text('Table name:', `${model}.tableName`, '"tableName"', 'false', 'Enter table name') + +.pc-form-grid-col-30(ng-if-start='$ctrl.available("2.0.0")') ++text('Key field name:', `${model}.keyFieldName`, '"keyFieldName"', 'false', 'Enter key field name', +'Key name.' + +'Can be used in field list to denote the key as a whole') +.pc-form-grid-col-30(ng-if-end) ++text('Value field name:', `${model}.valueFieldName`, '"valueFieldName"', 'false', 'Enter value field name', +'Value name.' + +'Can be used in field list to denote the entire value') + +.pc-form-grid-col-60 +mixin domains-query-fields +.ignite-form-field ++ignite-form-field__label('Fields:', '"fields"') ++tooltip(`Collection of name-to-type mappings to be queried, in addition to indexed fields`) +.ignite-form-field__control +-let items = queryFields +list-editable( +ng-model=items +name='queryFields' +ng-change=`$ctrl.onQueryFieldsChange(${model})` +) +list-editable-item-view +| {{ $item.name}} / {{ $item.className}} + +list-editable-item-edit +- form = '$parent.form' +.pc-form-grid-row +.pc-form-grid-col-30(divider='/') ++ignite-form-field-text('Field name:', '$item.name', '"name"', false, true, 'Enter field name')( +data-ignite-unique=items + data-ignite-unique-property='name' +ignite-auto-focus +) ++unique-feedback('"name"', 'Property with such name already exists!') +.pc-form-grid-col-30 ++java-class-typeahead('Field full class name:', `$item.className`, '"className"', '$ctrl.queryFieldTypes', true, true,
[13/16] ignite git commit: IGNITE-7996 Use configuration.state for state registration only.
IGNITE-7996 Use configuration.state for state registration only. (cherry picked from commit 2800ef0) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/536d8b20 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/536d8b20 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/536d8b20 Branch: refs/heads/ignite-2.5 Commit: 536d8b2080b93505e67206a240385baced150674 Parents: 9955728 Author: Ilya Borisov Authored: Fri Apr 6 11:20:13 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:17:56 2018 +0700 -- .../page-configure/configuration.state.js | 490 +-- 1 file changed, 233 insertions(+), 257 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/536d8b20/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js index 1a0a598..f8bb4dc 100644 --- a/modules/web-console/frontend/app/components/page-configure/configuration.state.js +++ b/modules/web-console/frontend/app/components/page-configure/configuration.state.js @@ -17,20 +17,11 @@ import angular from 'angular'; -import {default as ActivitiesData} from 'app/core/activities/Activities.data'; - -// Common directives. -import previewPanel from './configuration/preview-panel.directive.js'; - -// Summary screen. -import ConfigurationResource from './configuration/Configuration.resource'; -import IgniteSummaryZipper from './configuration/summary/summary-zipper.service'; - import base2 from 'views/base2.pug'; -import pageConfigureAdvancedClusterComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-cluster/component'; -import pageConfigureAdvancedModelsComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-models/component'; -import pageConfigureAdvancedCachesComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-caches/component'; -import pageConfigureAdvancedIGFSComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-igfs/component'; +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'; @@ -47,251 +38,236 @@ const shortCachesResolve = ['ConfigSelectors', 'ConfigureState', 'ConfigEffects' .toPromise(); }]; -/** - * @param {ActivitiesData} ActivitiesData - * @param {uirouter.UIRouter} $uiRouter - */ -function initConfiguration(ActivitiesData, $uiRouter) { -$uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => { -ActivitiesData.post({group: 'configuration', action: transition.targetState().name()}); +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}); +}); +}] +}
[14/16] ignite git commit: IGNITE-7996 Rename configuration.state to states.
IGNITE-7996 Rename configuration.state to states. (cherry picked from commit 14dd2df) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a2d9f97c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a2d9f97c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a2d9f97c Branch: refs/heads/ignite-2.5 Commit: a2d9f97c0ae77e81344849bc2c3cba2d3964cf01 Parents: 536d8b2 Author: Ilya Borisov Authored: Fri Apr 6 11:20:39 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:18:06 2018 +0700 -- .../page-configure/configuration.state.js | 273 --- .../app/components/page-configure/states.js | 273 +++ 2 files changed, 273 insertions(+), 273 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a2d9f97c/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js deleted file mode 100644 index f8bb4dc..000 --- a/modules/web-console/frontend/app/components/page-configure/configuration.state.js +++ /dev/null @@ -1,273 +0,0 @@ -/* - * 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}); -
[03/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug deleted file mode 100644 index 639a374..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/multicast.pug +++ /dev/null @@ -1,63 +0,0 @@ -//- -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 - -mixin discovery-multicast(modelAt = '$ctrl.clonedCluster') --const model = `${modelAt}.discovery.Multicast` --const addresses = `${model}.addresses` - -.pc-form-grid-row&attributes(attributes=attributes) -.pc-form-grid-col-30 -+text-ip-address('IP address:', `${model}.multicastGroup`, '"multicastGroup"', 'true', '228.1.2.4', 'IP address of multicast group') -.pc-form-grid-col-30 -+number-min-max('Port number:', `${model}.multicastPort`, '"multicastPort"', 'true', '47400', '0', '65535', 'Port number which multicast messages are sent to') -.pc-form-grid-col-20 -+number('Waits for reply:', `${model}.responseWaitTime`, '"responseWaitTime"', 'true', '500', '0', -'Time in milliseconds IP finder waits for reply to multicast address request') -.pc-form-grid-col-20 -+number('Attempts count:', `${model}.addressRequestAttempts`, '"addressRequestAttempts"', 'true', '2', '0', -'Number of attempts to send multicast address request\ -IP finder re - sends request only in case if no reply for previous request is received') -.pc-form-grid-col-20 -+text-ip-address('Local address:', `${model}.localAddress`, '"localAddress"', 'true', '0.0.0.0', -'Local host address used by this IP finder\ -If provided address is non - loopback then multicast socket is bound to this interface\ -If local address is not set or is any local address then IP finder creates multicast sockets for all found non - loopback addresses') -.pc-form-grid-col-60 -.ignite-form-field -.ignite-form-field__control -+list-addresses({ -items: addresses, -name: 'multicastAddresses', -tip: `Addresses may be represented as follows: - -IP address (e.g. 127.0.0.1, 9.9.9.9, etc) -IP address and port (e.g. 127.0.0.1:47500, 9.9.9.9:47501, etc) -IP address and port range (e.g. 127.0.0.1:47500..47510, 9.9.9.9:47501..47504, etc) -Hostname (e.g. host1.com, host2, etc) -Hostname and port (e.g. host1.com:47500, host2:47502, etc) -Hostname and port range (e.g. host1.com:47500..47510, host2:47502..47508, etc) - -If port is 0 or not provided then default port will be used (depends on discovery SPI configuration) -If port range is provided (e.g. host:port1..port2) the following should be considered: - - - port1 < port2 should be true - Both port1 and port2 should be greater than 0 -` -}) - http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/s3.pug deleted file m
[12/16] ignite git commit: IGNITE-7996 Move config state module index.
IGNITE-7996 Move config state module index. (cherry picked from commit d5e0be0) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9955728a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9955728a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9955728a Branch: refs/heads/ignite-2.5 Commit: 9955728a72e0f9c11faa313a521d4566b5a93dc1 Parents: 6871944 Author: Ilya Borisov Authored: Fri Apr 6 11:19:07 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:17:47 2018 +0700 -- .../page-configure/configuration.state.js | 297 +++ .../app/modules/states/configuration.state.js | 297 --- 2 files changed, 297 insertions(+), 297 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9955728a/modules/web-console/frontend/app/components/page-configure/configuration.state.js -- diff --git a/modules/web-console/frontend/app/components/page-configure/configuration.state.js b/modules/web-console/frontend/app/components/page-configure/configuration.state.js new file mode 100644 index 000..1a0a598 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/configuration.state.js @@ -0,0 +1,297 @@ +/* + * 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 {default as ActivitiesData} from 'app/core/activities/Activities.data'; + +// Common directives. +import previewPanel from './configuration/preview-panel.directive.js'; + +// Summary screen. +import ConfigurationResource from './configuration/Configuration.resource'; +import IgniteSummaryZipper from './configuration/summary/summary-zipper.service'; + +import base2 from 'views/base2.pug'; +import pageConfigureAdvancedClusterComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-cluster/component'; +import pageConfigureAdvancedModelsComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-models/component'; +import pageConfigureAdvancedCachesComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-caches/component'; +import pageConfigureAdvancedIGFSComponent from 'app/components/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(); +}]; + +/** + * @param {ActivitiesData} ActivitiesData + * @param {uirouter.UIRouter} $uiRouter + */ +function initConfiguration(ActivitiesData, $uiRouter) { +$uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => { +ActivitiesData.post({group: 'configuration', action: transition.targetState().name()}); +}); +} + +initConfiguration.$inject = ['IgniteActivitiesData', '$uiRouter']; + +angular.module('ignite-console.states.configuration', ['ui.router']) +.directive(...previewPanel) +// Services. +.service('IgniteSummaryZipper', IgniteSummaryZipper) +.service('IgniteConfigurationResource', ConfigurationResource) +.run(initConfiguration) +// Configure state provider. +.config(['$stateProvider', ($stateProvider) => { +// Setup the states. +$stateProvider +.state('base.configuration', { +abstract: true, +permission: 'configuration', +
[09/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug new file mode 100644 index 000..76c5016 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug @@ -0,0 +1,100 @@ +//- +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 = 'connector' +-var model = '$ctrl.clonedCluster.connector' +-var enabled = model + '.enabled' +-var sslEnabled = enabled + ' && ' + model + '.sslEnabled' + +panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) +panel-title Connector configuration +panel-description +| Configure HTTP REST configuration to enable HTTP server features. +| #[a.link-success(href="https://apacheignite.readme.io/docs/rest-api#general-configuration"; 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-60 ++checkbox('Enabled', enabled, '"restEnabled"', 'Flag indicating whether to configure connector configuration') +.pc-form-grid-col-60 ++text-enabled('Jetty configuration path:', `${model}.jettyPath`, '"connectorJettyPath"', enabled, 'false', 'Input path to Jetty configuration', +'Path, either absolute or relative to IGNITE_HOME, to Jetty XML configuration file\ +Jetty is used to support REST over HTTP protocol for accessing Ignite APIs remotely\ +If not provided, Jetty instance with default configuration will be started picking IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT as host and port respectively') +.pc-form-grid-col-20 ++text-ip-address('TCP host:', `${model}.host`, '"connectorHost"', enabled, 'IgniteConfiguration#getLocalHost()', +'Host for TCP binary protocol server\ +This can be either an IP address or a domain name\ +If not defined, system - wide local address will be used IgniteConfiguration#getLocalHost()\ +You can also use "0.0.0.0" value to bind to all locally - available IP addresses') +.pc-form-grid-col-20 ++number-min-max('TCP port:', `${model}.port`, '"connectorPort"', enabled, '11211', '1024', '65535', 'Port for TCP binary protocol server') +.pc-form-grid-col-20 ++number('TCP port range:', `${model}.portRange`, '"connectorPortRange"', enabled, '100', '1', 'Number of ports for TCP binary protocol server to try if configured port is already in use') +.pc-form-grid-col-60 ++number('Idle query cursor timeout:', `${model}.idleQueryCursorTimeout`, '"connectorIdleQueryCursorTimeout"', enabled, '60', '0', +'Reject open query cursors that is not used timeout\ +If no fetch query request come within idle timeout, it will be removed on next check for old query cursors') +.pc-form-grid-col-60 ++number('Idle query cursor check frequency:', `${model}.idleQueryCursorCheckFrequency`, '"connectorIdleQueryCursorCheckFrequency"', enabled, '6', '0', +'Idle query cursors check frequency\ +This setting is used to reject open query cursors that is not used') +.pc-form-grid-col-30 ++number('Idle timeout:', `${model}.idleTimeout`, '"connectorIdleTimeout"', enabled, '7000', '0', +'Idle timeout for REST server\ +This setting is used to reject half - opened sockets\ +If no
[07/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug new file mode 100644 index 000..74b1f02 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug @@ -0,0 +1,70 @@ +//- +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 = 'odbcConfiguration' +-var model = '$ctrl.clonedCluster.odbc' +-var enabled = model + '.odbcEnabled' + +panel-collapsible( +ng-form=form +on-open=`ui.loadPanel('${form}')` +ng-show='$ctrl.available(["1.0.0", "2.1.0"])' +) +panel-title ODBC configuration +panel-description +| ODBC server configuration. +| #[a.link-success(href="https://apacheignite.readme.io/docs/odbc-driver"; target="_blank") More info] +panel-content.pca-form-row(ng-if=`$ctrl.available(["1.0.0", "2.1.0"]) && ui.isPanelLoaded('${form}')`) +.pca-form-column-6 +.settings-row ++sane-form-field-checkbox({ +label: 'Enabled', +model: enabled, +name: '"odbcEnabled"', +tip: 'Flag indicating whether to configure ODBC configuration' +})( +ui-validate=`{ +correctMarshaller: '$ctrl.Clusters.odbc.odbcEnabled.correctMarshaller($ctrl.clonedCluster, $value)' +}` + ui-validate-watch='$ctrl.Clusters.odbc.odbcEnabled.correctMarshallerWatch("$ctrl.clonedCluster")' +) ++form-field-feedback(null, 'correctMarshaller', 'ODBC can only be used with BinaryMarshaller') +.settings-row ++text-ip-address-with-port-range('ODBC endpoint address:', `${model}.endpointAddress`, '"endpointAddress"', enabled, '0.0.0.0:10800..10810', +'ODBC endpoint address. \ +The following address formats are permitted:\ +\ +hostname - will use provided hostname and default port range\ +hostname:port - will use provided hostname and port\ +hostname:port_from..port_to - will use provided hostname and port range\ +') +.settings-row ++number('Send buffer size:', `${model}.socketSendBufferSize`, '"ODBCSocketSendBufferSize"', enabled, '0', '0', +'Socket send buffer size.\ +When set to 0, operation system default will be used') +.settings-row ++number('Socket receive buffer size:', `${model}.socketReceiveBufferSize`, '"ODBCSocketReceiveBufferSize"', enabled, '0', '0', +'Socket receive buffer size.\ +When set to 0, operation system default will be used') +.settings-row ++number('Maximum open cursors', `${model}.maxOpenCursors`, '"maxOpenCursors"', enabled, '128', '1', 'Maximum number of opened cursors per connection') +.settings-row ++number('Pool size:', `${model}.threadPoolSize`, '"ODBCThreadPoolSize"', enabled, 'max(8, availableProcessors)', '1', +'Size of thread pool that is in charge of processing ODBC tasks') +.pca-form-column-6 ++preview-xml-java(model, 'clusterODBC') http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug -- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persist
[11/16] ignite git commit: IGNITE-7996 Move configuration form templates.
IGNITE-7996 Move configuration form templates. (cherry picked from commit c2c03a9) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/68719446 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/68719446 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/68719446 Branch: refs/heads/ignite-2.5 Commit: 687194461f445be9902752f38f873d321cde1d85 Parents: 2769981 Author: Ilya Borisov Authored: Fri Apr 6 11:17:05 2018 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 12 11:17:35 2018 +0700 -- .../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
[04/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug deleted file mode 100644 index 8b43521..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/communication.pug +++ /dev/null @@ -1,134 +0,0 @@ -//- -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', '6', '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\ -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 connectionsIf set to -1 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 c
[02/16] ignite git commit: IGNITE-7996 Move configuration form templates.
http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug deleted file mode 100644 index cdc7258..000 --- a/modules/web-console/frontend/app/modules/states/configuration/clusters/misc.pug +++ /dev/null @@ -1,58 +0,0 @@ -//- -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 = 'misc' --var model = '$ctrl.clonedCluster' - -panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`) -panel-title Miscellaneous -panel-description Various miscellaneous cluster settings. -panel-content.pca-form-row(ng-if=`ui.isPanelLoaded('${form}')`) -.pca-form-column-6.pc-form-grid-row -.pc-form-grid-col-60 -+text('Work directory:', model + '.workDirectory', '"workDirectory"', 'false', 'Input work directory', -'Ignite work directory.\ -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.') - -//- Since ignite 2.0 -.pc-form-grid-col-60(ng-if-start='$ctrl.available("2.0.0")') -+text('Consistent ID:', model + '.consistentId', '"ConsistentId"', 'false', 'Input consistent ID', 'Consistent globally unique node ID which survives node restarts') -.pc-form-grid-col-60 -+java-class('Warmup closure:', model + '.warmupClosure', '"warmupClosure"', 'true', 'false', 'This closure will be executed before actual grid instance start') -.pc-form-grid-col-60 -+checkbox('Active on start', model + '.activeOnStart', '"activeOnStart"', -'If cluster is not active on start, there will be no cache partition map exchanges performed until the cluster is activated') -.pc-form-grid-col-60(ng-if-end) -+checkbox('Cache sanity check enabled', model + '.cacheSanityCheckEnabled', '"cacheSanityCheckEnabled"', -'If enabled, then Ignite will perform the following checks and throw an exception if check fails\ -\ -Cache entry is not externally locked with lock or lockAsync methods when entry is enlisted to transaction\ -Each entry in affinity group - lock transaction has the same affinity key as was specified on affinity transaction start\ -Each entry in partition group - lock transaction belongs to the same partition as was specified on partition transaction start\ -') - -.pc-form-grid-col-60(ng-if='$ctrl.available(["1.0.0", "2.1.0"])') -+checkbox('Late affinity assignment', model + '.lateAffinityAssignment', '"lateAffinityAssignment"', -'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")') -+number('Long query timeout:', `${model}.longQueryWarningTimeout`, '"LongQueryWarningTimeout"', 'true', '3000', '0', -'Timeout in milliseconds after which long query warning will be printed') -.pca-form-column-6 -+preview-xml-java(model, 'clusterMisc', 'caches') http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/odbc.pug deleted file mode 100644 index 74b1f02..000 --- a/modules/web-console/frontend/app/modules/s
[01/16] ignite git commit: IGNITE-7996 Move configuration form templates.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 2769981a5 -> a5a83d211 http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug b/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug deleted file mode 100644 index b9eb8fc..000 --- a/modules/web-console/frontend/app/modules/states/configuration/igfs/general.pug +++ /dev/null @@ -1,72 +0,0 @@ -//- -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 = 'general' --var model = 'backupItem' - -panel-collapsible(opened=`::true` ng-form=form) -panel-title General -panel-description -| General IGFS configuration. - a.link-success(href="https://apacheignite-fs.readme.io/docs/in-memory-file-system"; target="_blank") More info -panel-content.pca-form-row -.pca-form-column-6.pc-form-grid-row -.pc-form-grid-col-60 -+sane-ignite-form-field-text({ -label: 'Name:', -model: `${model}.name`, -name: '"igfsName"', -placeholder: 'Input name', -required: true -})( -ignite-unique='$ctrl.igfss' -ignite-unique-property='name' -ignite-unique-skip=`["_id", ${model}]` -) -+unique-feedback(`${model}.name`, 'IGFS name should be unique.') -.pc-form-grid-col-30 -+sane-ignite-form-field-dropdown({ -label: 'IGFS mode:', -model: `${model}.defaultMode`, -name: '"defaultMode"', -placeholder: '{{::$ctrl.IGFSs.defaultMode.default}}', -options: '{{::$ctrl.IGFSs.defaultMode.values}}', -tip: ` -Mode to specify how IGFS interacts with Hadoop file system - -PRIMARY - in this mode IGFS will not delegate to secondary Hadoop file system and will cache all the files in memory only -PROXY - in this mode IGFS will not cache any files in memory and will only pass them through to secondary file system -DUAL_SYNC - in this mode IGFS will cache files locally and also synchronously write them through to secondary file system -DUAL_ASYNC - in this mode IGFS will cache files locally and also asynchronously write them through to secondary file system - -` -}) -.pc-form-grid-col-30 -+sane-ignite-form-field-number({ -label: 'Group size:', -model: `${model}.affinnityGroupSize`, -name: '"affinnityGroupSize"', -placeholder: '{{::$ctrl.IGFSs.affinnityGroupSize.default}}', -min: '{{::$ctrl.IGFSs.affinnityGroupSize.min}}', -tip: ` -Size of the group in blocks -Required for construction of affinity mapper in IGFS data cache -` -}) -.pca-form-column-6 -+preview-xml-java(model, 'igfsGeneral') http://git-wip-us.apache.org/repos/asf/ignite/blob/68719446/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug -- diff --git a/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug b/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug deleted file mode 100644 index ef024b4..000 --- a/modules/web-console/frontend/app/modules/states/configuration/igfs/ipc.pug +++ /dev/null @@ -1,55 +0,0 @@ -//- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -thi