ignite git commit: IGNITE-8201 REST: Added AUTHENTICATE command. Fixed session tokens. Added new tests.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 7173b0c48 -> 6ee5e9fe8 IGNITE-8201 REST: Added AUTHENTICATE command. Fixed session tokens. Added new tests. (cherry picked from commit 1cfc989) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6ee5e9fe Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6ee5e9fe Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6ee5e9fe Branch: refs/heads/ignite-2.5 Commit: 6ee5e9fe8c07353a55a2a02b84f7b94c43b5c49f Parents: 7173b0c Author: Alexey KuznetsovAuthored: Tue Apr 17 11:46:45 2018 +0700 Committer: Alexey Kuznetsov Committed: Tue Apr 17 11:55:03 2018 +0700 -- .../client/suite/IgniteClientTestSuite.java | 6 +- .../JettyRestProcessorAbstractSelfTest.java | 60 ++- ...ettyRestProcessorAuthenticationSelfTest.java | 45 ++- ...rocessorAuthenticationWithCredsSelfTest.java | 32 ...rocessorAuthenticationWithTokenSelfTest.java | 80 .../processors/rest/GridRestCommand.java| 3 + .../processors/rest/GridRestProcessor.java | 26 --- .../auth/AuthenticationCommandHandler.java | 70 + .../rest/handlers/auth/package-info.java| 22 ++ .../http/jetty/GridJettyRestHandler.java| 55 +++--- 10 files changed, 322 insertions(+), 77 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6ee5e9fe/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java index 79fcf38..163f89a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java @@ -49,7 +49,8 @@ import org.apache.ignite.internal.client.util.ClientByteUtilsTest; import org.apache.ignite.internal.client.util.ClientConsistentHashSelfTest; import org.apache.ignite.internal.client.util.ClientJavaHasherSelfTest; import org.apache.ignite.internal.processors.rest.ClientMemcachedProtocolSelfTest; -import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationSelfTest; +import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationWithCredsSelfTest; +import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationWithTokenSelfTest; import org.apache.ignite.internal.processors.rest.JettyRestProcessorSignedSelfTest; import org.apache.ignite.internal.processors.rest.JettyRestProcessorUnsignedSelfTest; import org.apache.ignite.internal.processors.rest.RestBinaryProtocolSelfTest; @@ -87,7 +88,8 @@ public class IgniteClientTestSuite extends TestSuite { // Test jetty rest processor suite.addTestSuite(JettyRestProcessorSignedSelfTest.class); suite.addTestSuite(JettyRestProcessorUnsignedSelfTest.class); -suite.addTestSuite(JettyRestProcessorAuthenticationSelfTest.class); + suite.addTestSuite(JettyRestProcessorAuthenticationWithCredsSelfTest.class); + suite.addTestSuite(JettyRestProcessorAuthenticationWithTokenSelfTest.class); // Test TCP rest processor with original memcache client. suite.addTestSuite(ClientMemcachedProtocolSelfTest.class); http://git-wip-us.apache.org/repos/asf/ignite/blob/6ee5e9fe/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 5dc44c4..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 @@ -294,14 +294,19 @@ 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 {
[ignite] Git Push Summary
Repository: ignite Updated Branches: refs/heads/ignite-8201 [deleted] f31452dc8
ignite git commit: IGNITE-8201 REST: Added AUTHENTICATE command. Fixed session tokens. Added new tests.
Repository: ignite Updated Branches: refs/heads/master 737933e6d -> 1cfc9897f IGNITE-8201 REST: Added AUTHENTICATE command. Fixed session tokens. Added new tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1cfc9897 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1cfc9897 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1cfc9897 Branch: refs/heads/master Commit: 1cfc9897f41e8d8b48510029e7b650b2ed699c9a Parents: 737933e Author: Alexey KuznetsovAuthored: Tue Apr 17 11:46:45 2018 +0700 Committer: Alexey Kuznetsov Committed: Tue Apr 17 11:46:45 2018 +0700 -- .../client/suite/IgniteClientTestSuite.java | 6 +- .../JettyRestProcessorAbstractSelfTest.java | 60 ++- ...ettyRestProcessorAuthenticationSelfTest.java | 45 ++- ...rocessorAuthenticationWithCredsSelfTest.java | 32 ...rocessorAuthenticationWithTokenSelfTest.java | 80 .../processors/rest/GridRestCommand.java| 3 + .../processors/rest/GridRestProcessor.java | 26 --- .../auth/AuthenticationCommandHandler.java | 70 + .../rest/handlers/auth/package-info.java| 22 ++ .../http/jetty/GridJettyRestHandler.java| 55 +++--- 10 files changed, 322 insertions(+), 77 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1cfc9897/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java index 79fcf38..163f89a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java @@ -49,7 +49,8 @@ import org.apache.ignite.internal.client.util.ClientByteUtilsTest; import org.apache.ignite.internal.client.util.ClientConsistentHashSelfTest; import org.apache.ignite.internal.client.util.ClientJavaHasherSelfTest; import org.apache.ignite.internal.processors.rest.ClientMemcachedProtocolSelfTest; -import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationSelfTest; +import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationWithCredsSelfTest; +import org.apache.ignite.internal.processors.rest.JettyRestProcessorAuthenticationWithTokenSelfTest; import org.apache.ignite.internal.processors.rest.JettyRestProcessorSignedSelfTest; import org.apache.ignite.internal.processors.rest.JettyRestProcessorUnsignedSelfTest; import org.apache.ignite.internal.processors.rest.RestBinaryProtocolSelfTest; @@ -87,7 +88,8 @@ public class IgniteClientTestSuite extends TestSuite { // Test jetty rest processor suite.addTestSuite(JettyRestProcessorSignedSelfTest.class); suite.addTestSuite(JettyRestProcessorUnsignedSelfTest.class); -suite.addTestSuite(JettyRestProcessorAuthenticationSelfTest.class); + suite.addTestSuite(JettyRestProcessorAuthenticationWithCredsSelfTest.class); + suite.addTestSuite(JettyRestProcessorAuthenticationWithTokenSelfTest.class); // Test TCP rest processor with original memcache client. suite.addTestSuite(ClientMemcachedProtocolSelfTest.class); http://git-wip-us.apache.org/repos/asf/ignite/blob/1cfc9897/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 5dc44c4..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 @@ -294,14 +294,19 @@ 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());
ignite git commit: IGNITE-7972 Fixed NPE in TTL manager on unwindEvicts. - Fixes #3810.
Repository: ignite Updated Branches: refs/heads/master baaef2766 -> 737933e6d IGNITE-7972 Fixed NPE in TTL manager on unwindEvicts. - Fixes #3810. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/737933e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/737933e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/737933e6 Branch: refs/heads/master Commit: 737933e6db33f7f74005f3783d81d4bd7331c21d Parents: baaef27 Author: Andrey V. Mashenkov Authored: Mon Apr 16 20:43:36 2018 +0300 Committer: dpavlov Committed: Mon Apr 16 20:48:28 2018 +0300 -- .../internal/processors/cache/GridCacheTtlManager.java| 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/737933e6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java index b6f54a1..d36485a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java @@ -40,8 +40,8 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter { /** Entries pending removal. */ private GridConcurrentSkipListSetEx pendingEntries; -/** */ -private boolean eagerTtlEnabled; +/** See {@link CacheConfiguration#isEagerTtl()}. */ +private volatile boolean eagerTtlEnabled; /** */ private GridCacheContext dhtCtx; @@ -166,6 +166,12 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter { * @return {@code True} if unprocessed expired entries remains. */ public boolean expire(int amount) { +// TTL manager is not initialized or eagerTtl disabled for cache. +if (!eagerTtlEnabled) +return false; + +assert cctx != null; + long now = U.currentTimeMillis(); try {
ignite git commit: IGNITE-8242: Remove method GAGridUtils.getGenesForChromosome() as problematic when Chromosome contains duplicate genes. GAGridUtils.getGenesInOrderForChromosome() will be used inste
Repository: ignite Updated Branches: refs/heads/master 9e21cec02 -> baaef2766 IGNITE-8242: Remove method GAGridUtils.getGenesForChromosome() as problematic when Chromosome contains duplicate genes. GAGridUtils.getGenesInOrderForChromosome() will be used instead. this closes #3813 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/baaef276 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/baaef276 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/baaef276 Branch: refs/heads/master Commit: baaef27661971ff093d861d699e43167602e11cf Parents: 9e21cec Author: Turik CampbellAuthored: Mon Apr 16 20:43:49 2018 +0300 Committer: Yury Babak Committed: Mon Apr 16 20:43:49 2018 +0300 -- .../OptimizeMakeChangeTerminateCriteria.java| 2 +- .../genetic/movie/MovieTerminateCriteria.java | 2 +- .../ignite/ml/genetic/utils/GAGridUtils.java| 27 3 files changed, 2 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/baaef276/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeTerminateCriteria.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeTerminateCriteria.java b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeTerminateCriteria.java index a4ea263..ab3f462 100644 --- a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeTerminateCriteria.java +++ b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeTerminateCriteria.java @@ -58,7 +58,7 @@ public class OptimizeMakeChangeTerminateCriteria implements ITerminateCriteria { igniteLogger.info("Generation: " + currentGeneration); igniteLogger.info("Fittest is Chromosome Key: " + fittestChromosome); igniteLogger.info("Chromsome: " + fittestChromosome); -printCoins(GAGridUtils.getGenesForChromosome(ignite, fittestChromosome)); +printCoins(GAGridUtils.getGenesInOrderForChromosome(ignite, fittestChromosome)); igniteLogger.info("Avg Chromsome Fitness: " + averageFitnessScore); igniteLogger.info("##"); http://git-wip-us.apache.org/repos/asf/ignite/blob/baaef276/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieTerminateCriteria.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieTerminateCriteria.java b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieTerminateCriteria.java index 747d514..34a7331 100644 --- a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieTerminateCriteria.java +++ b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieTerminateCriteria.java @@ -61,7 +61,7 @@ public class MovieTerminateCriteria implements ITerminateCriteria { igniteLogger.info("Generation: " + currentGeneration); igniteLogger.info("Fittest is Chromosome Key: " + fittestChromosome); igniteLogger.info("Chromsome: " + fittestChromosome); -printMovies(GAGridUtils.getGenesForChromosome(ignite, fittestChromosome)); +printMovies(GAGridUtils.getGenesInOrderForChromosome(ignite, fittestChromosome)); igniteLogger.info("##"); if (!(fittestChromosome.getFitnessScore() > 32)) { http://git-wip-us.apache.org/repos/asf/ignite/blob/baaef276/modules/ml/src/main/java/org/apache/ignite/ml/genetic/utils/GAGridUtils.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/utils/GAGridUtils.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/utils/GAGridUtils.java index 326cdda..e27ddac 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/utils/GAGridUtils.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/utils/GAGridUtils.java @@ -60,33 +60,6 @@ public class GAGridUtils { } /** - * @param ignite Ignite - * @param chromosome Chromosome - * @return List of Genes - */ -public static List getGenesForChromosome(Ignite ignite, Chromosome chromosome) { -List genes = new ArrayList(); -IgniteCache cache = ignite.cache(GAGridConstants.GENE_CACHE); -StringBuffer sbSqlClause = new StringBuffer(); -sbSqlClause.append("_key IN
[1/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
Repository: ignite Updated Branches: refs/heads/ignite-2.5 b3f252666 -> 7173b0c48 http://git-wip-us.apache.org/repos/asf/ignite/blob/7173b0c4/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java b/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java deleted file mode 100644 index 705db7a..000 --- a/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java +++ /dev/null @@ -1,198 +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.clustering; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import org.apache.ignite.Ignite; -import org.apache.ignite.internal.util.IgniteUtils; -import org.apache.ignite.ml.math.StorageConstants; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.VectorUtils; -import org.apache.ignite.ml.math.distances.DistanceMeasure; -import org.apache.ignite.ml.math.distances.EuclideanDistance; -import org.apache.ignite.ml.math.functions.Functions; -import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix; -import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; -import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import org.junit.Assert; - -import static org.apache.ignite.ml.clustering.KMeansUtil.checkIsInEpsilonNeighbourhood; - -/** - * This test checks logic of clustering (checks for clusters structures). - */ -public class KMeansDistributedClustererTestSingleNode extends GridCommonAbstractTest { -/** - * Number of nodes in grid. We should use 1 in this test because otherwise algorithm will be unstable - * (We cannot guarantee the order in which results are returned from each node). - */ -private static final int NODE_COUNT = 1; - -/** Grid instance. */ -private Ignite ignite; - -/** - * Default constructor. - */ -public KMeansDistributedClustererTestSingleNode() { -super(false); -} - -/** - * {@inheritDoc} - */ -@Override protected void beforeTest() throws Exception { -ignite = grid(NODE_COUNT); -} - -/** {@inheritDoc} */ -@Override protected void beforeTestsStarted() throws Exception { -for (int i = 1; i <= NODE_COUNT; i++) -startGrid(i); -} - -/** {@inheritDoc} */ -@Override protected void afterTestsStopped() throws Exception { -stopAllGrids(); -} - -/** */ -public void testPerformClusterAnalysisDegenerate() { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -KMeansDistributedClusterer clusterer = new KMeansDistributedClusterer(new EuclideanDistance(), 1, 1, 1L); - -double[] v1 = new double[] {1959, 325100}; -double[] v2 = new double[] {1960, 373200}; - -SparseDistributedMatrix points = new SparseDistributedMatrix(2, 2, StorageConstants.ROW_STORAGE_MODE, -StorageConstants.RANDOM_ACCESS_MODE); - -points.setRow(0, v1); -points.setRow(1, v2); - -KMeansModel mdl = clusterer.cluster(points, 1); - -Assert.assertEquals(1, mdl.centers().length); -Assert.assertEquals(2, mdl.centers()[0].size()); -} - -/** */ -public void testClusterizationOnDatasetWithObviousStructure() throws IOException { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -int ptsCnt = 1; -int squareSideLen = 1; - -Random rnd = new Random(123456L); - -// Let centers be in the vertices of square. -Mapcenters = new HashMap<>(); -centers.put(100, new
[2/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
http://git-wip-us.apache.org/repos/asf/ignite/blob/7173b0c4/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java deleted file mode 100644 index 70009cb..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java +++ /dev/null @@ -1,88 +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.clustering; - -import java.util.Arrays; -import org.apache.ignite.ml.Exportable; -import org.apache.ignite.ml.Exporter; -import org.apache.ignite.ml.FuzzyCMeansModelFormat; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.distances.DistanceMeasure; - -/** This class incapsulates result of clusterization. */ -public class FuzzyCMeansModel implements ClusterizationModel, Exportable { -/** Centers of clusters. */ -private Vector[] centers; - -/** Distance measure. */ -private DistanceMeasure measure; - -/** - * Constructor that creates FCM model by centers and measure. - * - * @param centers Array of centers. - * @param measure Distance measure. - */ -public FuzzyCMeansModel(Vector[] centers, DistanceMeasure measure) { -this.centers = Arrays.copyOf(centers, centers.length); -this.measure = measure; -} - -/** Distance measure used while clusterization. */ -public DistanceMeasure distanceMeasure() { -return measure; -} - -/** @inheritDoc */ -@Override public int clustersCount() { -return centers.length; -} - -/** @inheritDoc */ -@Override public Vector[] centers() { -return Arrays.copyOf(centers, centers.length); -} - -/** - * Predict closest center index for a given vector. - * - * @param val Vector. - * @return Index of the closest center or -1 if it can't be found. - */ -@Override public Integer apply(Vector val) { -int idx = -1; -double minDistance = Double.POSITIVE_INFINITY; - -for (int i = 0; i < centers.length; i++) { -double currDistance = measure.compute(val, centers[i]); -if (currDistance < minDistance) { -minDistance = currDistance; -idx = i; -} -} - -return idx; -} - -/** {@inheritDoc} */ -@Override public void saveModel(Exporter exporter, P path) { -FuzzyCMeansModelFormat mdlData = new FuzzyCMeansModelFormat(centers, measure); - -exporter.save(mdlData, path); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/7173b0c4/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java deleted file mode 100644 index 5595b4c..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java +++ /dev/null @@ -1,306 +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
[3/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code this closes #3817 (cherry picked from commit 9e21cec) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7173b0c4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7173b0c4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7173b0c4 Branch: refs/heads/ignite-2.5 Commit: 7173b0c48dab05be0b8e7825ae527824fcdbbc83 Parents: b3f2526 Author: zaleslawAuthored: Mon Apr 16 20:20:49 2018 +0300 Committer: Yury Babak Committed: Mon Apr 16 20:21:26 2018 +0300 -- .../clustering/DatasetWithObviousStructure.java | 105 .../ml/clustering/FuzzyCMeansExample.java | 134 - .../ml/clustering/FuzzyCMeansLocalExample.java | 95 .../clustering/KMeansClusterizationExample.java | 226 .../KMeansDistributedClustererExample.java | 97 .../clustering/KMeansLocalClustererExample.java | 106 .../ignite/ml/FuzzyCMeansModelFormat.java | 76 --- .../org/apache/ignite/ml/KMeansModelFormat.java | 77 --- .../ml/clustering/BaseFuzzyCMeansClusterer.java | 90 .../ml/clustering/BaseKMeansClusterer.java | 96 .../apache/ignite/ml/clustering/Clusterer.java | 33 -- .../ml/clustering/ClusterizationModel.java | 29 -- .../FuzzyCMeansDistributedClusterer.java| 512 --- .../clustering/FuzzyCMeansLocalClusterer.java | 254 - .../ignite/ml/clustering/FuzzyCMeansModel.java | 88 .../clustering/KMeansDistributedClusterer.java | 306 --- .../ml/clustering/KMeansLocalClusterer.java | 177 --- .../ignite/ml/clustering/KMeansModel.java | 113 .../ignite/ml/clustering/WeightedClusterer.java | 38 -- .../ignite/ml/clustering/kmeans/Clusterer.java | 33 ++ .../clustering/kmeans/ClusterizationModel.java | 29 ++ .../ml/clustering/kmeans/KMeansModel.java | 112 .../ml/clustering/kmeans/KMeansModelFormat.java | 79 +++ .../ml/clustering/kmeans/KMeansTrainer.java | 320 .../ml/clustering/kmeans/package-info.java | 22 + .../preprocessing/LabellingMachine.java | 41 -- .../ml/structures/preprocessing/Normalizer.java | 80 --- .../org/apache/ignite/ml/LocalModelsTest.java | 26 +- .../ml/clustering/ClusteringTestSuite.java | 7 +- .../FuzzyCMeansDistributedClustererTest.java| 180 --- .../FuzzyCMeansLocalClustererTest.java | 202 ...KMeansDistributedClustererTestMultiNode.java | 138 - ...MeansDistributedClustererTestSingleNode.java | 198 --- .../ml/clustering/KMeansLocalClustererTest.java | 46 -- .../ignite/ml/clustering/KMeansModelTest.java | 63 +++ .../ignite/ml/clustering/KMeansTrainerTest.java | 73 +++ .../apache/ignite/ml/clustering/KMeansUtil.java | 33 -- 37 files changed, 977 insertions(+), 3357 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7173b0c4/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java b/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java deleted file mode 100644 index 5cd0e09..000 --- a/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java +++ /dev/null @@ -1,105 +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.examples.ml.clustering; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import org.apache.ignite.ml.math.Matrix; -import org.apache.ignite.ml.math.Vector; -import
[2/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e21cec0/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java deleted file mode 100644 index 70009cb..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/FuzzyCMeansModel.java +++ /dev/null @@ -1,88 +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.clustering; - -import java.util.Arrays; -import org.apache.ignite.ml.Exportable; -import org.apache.ignite.ml.Exporter; -import org.apache.ignite.ml.FuzzyCMeansModelFormat; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.distances.DistanceMeasure; - -/** This class incapsulates result of clusterization. */ -public class FuzzyCMeansModel implements ClusterizationModel, Exportable { -/** Centers of clusters. */ -private Vector[] centers; - -/** Distance measure. */ -private DistanceMeasure measure; - -/** - * Constructor that creates FCM model by centers and measure. - * - * @param centers Array of centers. - * @param measure Distance measure. - */ -public FuzzyCMeansModel(Vector[] centers, DistanceMeasure measure) { -this.centers = Arrays.copyOf(centers, centers.length); -this.measure = measure; -} - -/** Distance measure used while clusterization. */ -public DistanceMeasure distanceMeasure() { -return measure; -} - -/** @inheritDoc */ -@Override public int clustersCount() { -return centers.length; -} - -/** @inheritDoc */ -@Override public Vector[] centers() { -return Arrays.copyOf(centers, centers.length); -} - -/** - * Predict closest center index for a given vector. - * - * @param val Vector. - * @return Index of the closest center or -1 if it can't be found. - */ -@Override public Integer apply(Vector val) { -int idx = -1; -double minDistance = Double.POSITIVE_INFINITY; - -for (int i = 0; i < centers.length; i++) { -double currDistance = measure.compute(val, centers[i]); -if (currDistance < minDistance) { -minDistance = currDistance; -idx = i; -} -} - -return idx; -} - -/** {@inheritDoc} */ -@Override public void saveModel(Exporter exporter, P path) { -FuzzyCMeansModelFormat mdlData = new FuzzyCMeansModelFormat(centers, measure); - -exporter.save(mdlData, path); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/9e21cec0/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java deleted file mode 100644 index 5595b4c..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/KMeansDistributedClusterer.java +++ /dev/null @@ -1,306 +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
[1/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
Repository: ignite Updated Branches: refs/heads/master 228254ae3 -> 9e21cec02 http://git-wip-us.apache.org/repos/asf/ignite/blob/9e21cec0/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java b/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java deleted file mode 100644 index 705db7a..000 --- a/modules/ml/src/test/java/org/apache/ignite/ml/clustering/KMeansDistributedClustererTestSingleNode.java +++ /dev/null @@ -1,198 +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.clustering; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import org.apache.ignite.Ignite; -import org.apache.ignite.internal.util.IgniteUtils; -import org.apache.ignite.ml.math.StorageConstants; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.VectorUtils; -import org.apache.ignite.ml.math.distances.DistanceMeasure; -import org.apache.ignite.ml.math.distances.EuclideanDistance; -import org.apache.ignite.ml.math.functions.Functions; -import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix; -import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; -import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import org.junit.Assert; - -import static org.apache.ignite.ml.clustering.KMeansUtil.checkIsInEpsilonNeighbourhood; - -/** - * This test checks logic of clustering (checks for clusters structures). - */ -public class KMeansDistributedClustererTestSingleNode extends GridCommonAbstractTest { -/** - * Number of nodes in grid. We should use 1 in this test because otherwise algorithm will be unstable - * (We cannot guarantee the order in which results are returned from each node). - */ -private static final int NODE_COUNT = 1; - -/** Grid instance. */ -private Ignite ignite; - -/** - * Default constructor. - */ -public KMeansDistributedClustererTestSingleNode() { -super(false); -} - -/** - * {@inheritDoc} - */ -@Override protected void beforeTest() throws Exception { -ignite = grid(NODE_COUNT); -} - -/** {@inheritDoc} */ -@Override protected void beforeTestsStarted() throws Exception { -for (int i = 1; i <= NODE_COUNT; i++) -startGrid(i); -} - -/** {@inheritDoc} */ -@Override protected void afterTestsStopped() throws Exception { -stopAllGrids(); -} - -/** */ -public void testPerformClusterAnalysisDegenerate() { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -KMeansDistributedClusterer clusterer = new KMeansDistributedClusterer(new EuclideanDistance(), 1, 1, 1L); - -double[] v1 = new double[] {1959, 325100}; -double[] v2 = new double[] {1960, 373200}; - -SparseDistributedMatrix points = new SparseDistributedMatrix(2, 2, StorageConstants.ROW_STORAGE_MODE, -StorageConstants.RANDOM_ACCESS_MODE); - -points.setRow(0, v1); -points.setRow(1, v2); - -KMeansModel mdl = clusterer.cluster(points, 1); - -Assert.assertEquals(1, mdl.centers().length); -Assert.assertEquals(2, mdl.centers()[0].size()); -} - -/** */ -public void testClusterizationOnDatasetWithObviousStructure() throws IOException { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -int ptsCnt = 1; -int squareSideLen = 1; - -Random rnd = new Random(123456L); - -// Let centers be in the vertices of square. -Mapcenters = new HashMap<>(); -centers.put(100, new
[3/3] ignite git commit: IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code
IGNITE-8169: [ML] Adopt KMeans to the new Partitioned Dataset and cleanup old code this closes #3817 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e21cec0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e21cec0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e21cec0 Branch: refs/heads/master Commit: 9e21cec024168105fd30bfb3acecf9fd24a52e8c Parents: 228254a Author: zaleslawAuthored: Mon Apr 16 20:20:49 2018 +0300 Committer: Yury Babak Committed: Mon Apr 16 20:20:49 2018 +0300 -- .../clustering/DatasetWithObviousStructure.java | 105 .../ml/clustering/FuzzyCMeansExample.java | 134 - .../ml/clustering/FuzzyCMeansLocalExample.java | 95 .../clustering/KMeansClusterizationExample.java | 226 .../KMeansDistributedClustererExample.java | 97 .../clustering/KMeansLocalClustererExample.java | 106 .../ignite/ml/FuzzyCMeansModelFormat.java | 76 --- .../org/apache/ignite/ml/KMeansModelFormat.java | 77 --- .../ml/clustering/BaseFuzzyCMeansClusterer.java | 90 .../ml/clustering/BaseKMeansClusterer.java | 96 .../apache/ignite/ml/clustering/Clusterer.java | 33 -- .../ml/clustering/ClusterizationModel.java | 29 -- .../FuzzyCMeansDistributedClusterer.java| 512 --- .../clustering/FuzzyCMeansLocalClusterer.java | 254 - .../ignite/ml/clustering/FuzzyCMeansModel.java | 88 .../clustering/KMeansDistributedClusterer.java | 306 --- .../ml/clustering/KMeansLocalClusterer.java | 177 --- .../ignite/ml/clustering/KMeansModel.java | 113 .../ignite/ml/clustering/WeightedClusterer.java | 38 -- .../ignite/ml/clustering/kmeans/Clusterer.java | 33 ++ .../clustering/kmeans/ClusterizationModel.java | 29 ++ .../ml/clustering/kmeans/KMeansModel.java | 112 .../ml/clustering/kmeans/KMeansModelFormat.java | 79 +++ .../ml/clustering/kmeans/KMeansTrainer.java | 320 .../ml/clustering/kmeans/package-info.java | 22 + .../preprocessing/LabellingMachine.java | 41 -- .../ml/structures/preprocessing/Normalizer.java | 80 --- .../org/apache/ignite/ml/LocalModelsTest.java | 26 +- .../ml/clustering/ClusteringTestSuite.java | 7 +- .../FuzzyCMeansDistributedClustererTest.java| 180 --- .../FuzzyCMeansLocalClustererTest.java | 202 ...KMeansDistributedClustererTestMultiNode.java | 138 - ...MeansDistributedClustererTestSingleNode.java | 198 --- .../ml/clustering/KMeansLocalClustererTest.java | 46 -- .../ignite/ml/clustering/KMeansModelTest.java | 63 +++ .../ignite/ml/clustering/KMeansTrainerTest.java | 73 +++ .../apache/ignite/ml/clustering/KMeansUtil.java | 33 -- 37 files changed, 977 insertions(+), 3357 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9e21cec0/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java b/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java deleted file mode 100644 index 5cd0e09..000 --- a/examples/src/main/java/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java +++ /dev/null @@ -1,105 +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.examples.ml.clustering; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import org.apache.ignite.ml.math.Matrix; -import org.apache.ignite.ml.math.Vector; -import org.apache.ignite.ml.math.VectorUtils; -import
ignite git commit: IGNITE-8246 Fix for cast exception when using printPartitionState method - Fixes #3816.
Repository: ignite Updated Branches: refs/heads/master 9557f6dcb -> 228254ae3 IGNITE-8246 Fix for cast exception when using printPartitionState method - Fixes #3816. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/228254ae Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/228254ae Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/228254ae Branch: refs/heads/master Commit: 228254ae317a6a1eb8897ad78a5f55967407be58 Parents: 9557f6d Author: Maxim Muzafarov Authored: Mon Apr 16 19:13:28 2018 +0300 Committer: dpavlov Committed: Mon Apr 16 19:13:28 2018 +0300 -- .../ignite/testframework/junits/common/GridCommonAbstractTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/228254ae/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java index 71abb95..9f2f8c4 100755 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java @@ -866,7 +866,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest { .append(" res=").append(f.isDone() ? f.get() : "N/A") .append(" topVer=") .append((U.hasField(f, "topVer") ? -String.valueOf(U.field(f, "topVer")) : "[unknown] may be it is finished future")) +String.valueOf(U.field(f, "topVer")) : "[unknown] may be it is finished future")) .append("\n"); Map > remaining = U.field(f, "remaining");
ignite git commit: IGNITE-8280 Fix of NPE on some cases at the QueryEntity.getDecimalInfo - Fixes #3831.
Repository: ignite Updated Branches: refs/heads/master 7586cfd50 -> 9557f6dcb IGNITE-8280 Fix of NPE on some cases at the QueryEntity.getDecimalInfo - Fixes #3831. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9557f6dc Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9557f6dc Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9557f6dc Branch: refs/heads/master Commit: 9557f6dcbbe5d86d892ffaca5a9bb66cc5401e84 Parents: 7586cfd Author: tledkov-gridgain Authored: Mon Apr 16 18:45:11 2018 +0300 Committer: dpavlov Committed: Mon Apr 16 18:45:11 2018 +0300 -- .../core/src/main/java/org/apache/ignite/cache/QueryEntity.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9557f6dc/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java index aff3461..976bd67 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java @@ -405,7 +405,7 @@ public class QueryEntity implements Serializable { * @return Set of names of fields that must have non-null values. */ public Map > getDecimalInfo() { -return unmodifiableMap(decimalInfo); +return decimalInfo == null ? Collections.emptyMap() : unmodifiableMap(decimalInfo); } /**
[47/50] [abbrv] ignite git commit: IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822.
IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7586cfd5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7586cfd5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7586cfd5 Branch: refs/heads/ignite-7708 Commit: 7586cfd50e01fd7d781ad652df23734a7ebeb54d Parents: af2b742 Author: Alexey KukushkinAuthored: Mon Apr 16 11:47:19 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:47:19 2018 +0300 -- .../internal/client/thin/ReliableChannel.java | 2 ++ .../apache/ignite/client/FunctionalTest.java| 37 .../org/apache/ignite/client/SecurityTest.java | 22 ++-- 3 files changed, 42 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java index 392b8f8..dac4320 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java @@ -81,6 +81,8 @@ final class ReliableChannel implements AutoCloseable { primary = addrs.get(new Random().nextInt(addrs.size())); // we already verified there is at least one address +ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get(); + for (InetSocketAddress a : addrs) if (a != primary) this.backups.add(a); http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java index d69ac4d..b49f7e3 100644 --- a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java +++ b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java @@ -39,21 +39,16 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.client.ClientCache; -import org.apache.ignite.client.ClientCacheConfiguration; -import org.apache.ignite.client.Comparers; -import org.apache.ignite.client.Config; -import org.apache.ignite.client.IgniteClient; import org.apache.ignite.configuration.ClientConfiguration; -import org.apache.ignite.client.LocalIgniteCluster; -import org.apache.ignite.client.Person; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Thin client functional tests. @@ -380,6 +375,34 @@ public class FunctionalTest { } } +/** + * Test client fails on start if server is unavailable + */ +@Test +public void testClientFailsOnStart() { +ClientConnectionException expEx = null; + +try (IgniteClient ignored = Ignition.startClient(getClientConfiguration())) { +// No-op. +} +catch (ClientConnectionException connEx) { +expEx = connEx; +} +catch (Exception ex) { +fail(String.format( +"%s expected but %s was received: %s", +ClientConnectionException.class.getName(), +ex.getClass().getName(), +ex +)); +} + +assertNotNull( +String.format("%s expected but no exception was received", ClientConnectionException.class.getName()), +expEx +); +} + /** */ private static ClientConfiguration getClientConfiguration() { return new ClientConfiguration() http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java
[30/50] [abbrv] ignite git commit: IGNITE-8240 .NET: Use default scheduler when starting Tasks
IGNITE-8240 .NET: Use default scheduler when starting Tasks This closes #3812 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/44c4656c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/44c4656c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/44c4656c Branch: refs/heads/ignite-7708 Commit: 44c4656ce8cc304b0858a18438f57fd9daf9ecb0 Parents: 6df5f99 Author: Pavel TupitsynAuthored: Fri Apr 13 12:28:19 2018 +0300 Committer: Pavel Tupitsyn Committed: Fri Apr 13 12:28:19 2018 +0300 -- .gitignore | 1 + .../IgniteSessionStateStoreProviderTest.cs | 7 +- .../Apache.Ignite.Benchmarks/BenchmarkRunner.cs | 1 - .../Binary/BinaryDynamicRegistrationTest.cs | 2 +- .../Cache/CacheAbstractTransactionalTest.cs | 5 +- .../Client/ClientConnectionTest.cs | 3 +- .../Apache.Ignite.Core.Tests/EventsTest.cs | 9 +-- .../Apache.Ignite.Core.Tests/ExceptionsTest.cs | 3 +- .../IgniteStartStopTest.cs | 5 +- .../Apache.Ignite.Core.Tests/MessagingTest.cs | 5 +- .../Apache.Ignite.Core.csproj | 1 + .../Impl/Client/ClientSocket.cs | 6 +- .../Impl/Common/TaskRunner.cs | 70 .../Impl/Datastream/DataStreamerBatch.cs| 2 +- .../Impl/Datastream/DataStreamerImpl.cs | 2 +- .../Apache.Ignite.Core/Impl/Events/Events.cs| 2 +- .../Impl/Transactions/TransactionImpl.cs| 3 +- 17 files changed, 103 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/44c4656c/.gitignore -- diff --git a/.gitignore b/.gitignore index 535a8ff..47220b2 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ git-patch-prop-local.sh **/dotnet/libs/ *.classname* *.exe +.mvn/ #Visual Studio files *.[Oo]bj http://git-wip-us.apache.org/repos/asf/ignite/blob/44c4656c/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/IgniteSessionStateStoreProviderTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/IgniteSessionStateStoreProviderTest.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/IgniteSessionStateStoreProviderTest.cs index 25700c6..08c44a6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/IgniteSessionStateStoreProviderTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/IgniteSessionStateStoreProviderTest.cs @@ -28,6 +28,7 @@ namespace Apache.Ignite.AspNet.Tests using System.Web.SessionState; using Apache.Ignite.Core; using Apache.Ignite.Core.Common; +using Apache.Ignite.Core.Impl.Common; using Apache.Ignite.Core.Tests; using NUnit.Framework; @@ -265,7 +266,7 @@ namespace Apache.Ignite.AspNet.Tests Assert.AreEqual(SessionStateActions.None, actions); // Try to get it in a different thread. -Task.Factory.StartNew(() => +TaskRunner.Run(() => { object lockId1; // do not overwrite lockId res = provider.GetItem(HttpContext, Id, out locked, out lockAge, out lockId1, out actions); @@ -277,7 +278,7 @@ namespace Apache.Ignite.AspNet.Tests }).Wait(); // Try to get it in a different thread. -Task.Factory.StartNew(() => +TaskRunner.Run(() => { object lockId1; // do not overwrite lockId res = provider.GetItemExclusive(HttpContext, Id, out locked, out lockAge, out lockId1, out actions); @@ -292,7 +293,7 @@ namespace Apache.Ignite.AspNet.Tests provider.ReleaseItemExclusive(HttpContext, Id, lockId); // Make sure it is accessible in a different thread. -Task.Factory.StartNew(() => +TaskRunner.Run(() => { res = provider.GetItem(HttpContext, Id, out locked, out lockAge, out lockId, out actions); Assert.IsNotNull(res); http://git-wip-us.apache.org/repos/asf/ignite/blob/44c4656c/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs index e152ffb..fb2fbd2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/BenchmarkRunner.cs @@ -22,7 +22,6 @@ namespace Apache.Ignite.Benchmarks using System.IO; using
[49/50] [abbrv] ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-7708
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-7708 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ad805704 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ad805704 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ad805704 Branch: refs/heads/ignite-7708 Commit: ad80570425765fc930fd6774f123c176535d3d58 Parents: 83be65e 7586cfd Author: Alexey GoncharukAuthored: Mon Apr 16 15:37:13 2018 +0300 Committer: Alexey Goncharuk Committed: Mon Apr 16 15:37:13 2018 +0300 -- .gitignore | 1 + assembly/release-fabric-base.xml| 1 + examples/README-LGPL.txt| 1 + examples/README.txt | 1 + examples/pom.xml| 9 +- examples/sql/world.sql | 5354 ++ .../examples/client/ClientPutGetExample.java|69 + .../AlgorithmSpecificDatasetExample.java|12 +- .../ml/dataset/CacheBasedDatasetExample.java| 3 +- .../ml/dataset/LocalDatasetExample.java | 3 +- .../ignite/examples/ml/genetic/change/Coin.java |89 + .../OptimizeMakeChangeFitnessFunction.java | 105 + .../change/OptimizeMakeChangeGAExample.java | 218 + .../OptimizeMakeChangeTerminateCriteria.java|84 + .../helloworld/HelloWorldFitnessFunction.java |63 + .../genetic/helloworld/HelloWorldGAExample.java | 127 + .../helloworld/HelloWorldTerminateCriteria.java |89 + .../ignite/examples/ml/genetic/movie/Movie.java | 133 + .../ml/genetic/movie/MovieFitnessFunction.java | 104 + .../ml/genetic/movie/MovieGAExample.java| 274 + .../genetic/movie/MovieTerminateCriteria.java |88 + .../ml/knn/KNNClassificationExample.java| 273 + .../examples/ml/knn/KNNRegressionExample.java | 310 + .../KNNClassificationExample.java | 154 - .../ml/knn/classification/package-info.java |22 - .../ml/knn/regression/KNNRegressionExample.java | 155 - .../ml/knn/regression/package-info.java |22 - .../examples/ml/nn/MLPGroupTrainerExample.java | 140 - .../examples/ml/nn/MLPLocalTrainerExample.java | 161 - .../examples/ml/nn/MLPTrainerExample.java | 167 + .../ml/preprocessing/NormalizationExample.java |18 +- ...dLinearRegressionWithLSQRTrainerExample.java | 170 - ...tedLinearRegressionWithQRTrainerExample.java | 136 - ...edLinearRegressionWithSGDTrainerExample.java | 137 - .../LinearRegressionLSQRTrainerExample.java | 169 + ...sionLSQRTrainerWithNormalizationExample.java | 180 + .../LinearRegressionSGDTrainerExample.java | 176 + .../ml/svm/SVMBinaryClassificationExample.java | 131 - .../ml/svm/SVMMultiClassificationExample.java | 130 - .../binary/SVMBinaryClassificationExample.java | 233 + .../examples/ml/svm/binary/package-info.java|22 + .../SVMMultiClassClassificationExample.java | 289 + .../ml/svm/multiclass/package-info.java |22 + .../ignite/examples/ml/svm/package-info.java|22 + ...ecisionTreeClassificationTrainerExample.java | 148 + .../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 - .../ignite/examples/sql/SqlJdbcCopyExample.java |70 +- examples/src/main/resources/cityBulkLoad.csv| 3 - .../src/main/resources/datasets/titanic.txt | 1309 -- examples/src/main/resources/personBulkLoad.csv | 4 - examples/src/main/resources/sql/city.csv| 4079 + .../spark/IgniteDataFrameWriteExample.scala | 4 +- .../spark/examples/IgniteDataFrameSelfTest.java | 3 +- .../examples/SharedRDDExampleSelfTest.java | 3 +- .../IgniteExamplesSparkSelfTestSuite.java | 2 +- .../client/impl/ClientCacheFlagsCodecTest.java |35 +- .../client/suite/IgniteClientTestSuite.java | 2 + .../jdbc2/JdbcAbstractDmlStatementSelfTest.java | 6 +- .../internal/jdbc2/JdbcStreamingSelfTest.java | 2 + .../JettyRestProcessorAbstractSelfTest.java | 307 +- ...ettyRestProcessorAuthenticationSelfTest.java | 172 + .../internal/processors/rest/SimplePerson.java | 4 +- .../jdbc/suite/IgniteJdbcDriverTestSuite.java |12 +- .../JdbcThinAuthenticateConnectionSelfTest.java | 235 + .../thin/JdbcThinBulkLoadAbstractSelfTest.java | 207 +- ...JdbcThinConnectionMultipleAddressesTest.java | 424 + .../jdbc/thin/JdbcThinConnectionSSLTest.java|20 +- .../jdbc/thin/JdbcThinConnectionSelfTest.java | 265 +- .../jdbc/thin/JdbcThinErrorsSelfTest.java |
[18/50] [abbrv] 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/ignite-7708 Commit: e333f306d0f32d4c02057fff4238081f25775cf1 Parents: d1be9b8 d02e87b Author: Alexey KuznetsovAuthored: 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 +++
[31/50] [abbrv] ignite git commit: IGNITE-8042: .NET: Thin client: authentication support - fix naming and inspections
IGNITE-8042: .NET: Thin client: authentication support - fix naming and inspections Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9be3357c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9be3357c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9be3357c Branch: refs/heads/ignite-7708 Commit: 9be3357c427f7839ce347831517327a572c0c18d Parents: 44c4656 Author: Pavel TupitsynAuthored: Fri Apr 13 12:44:17 2018 +0300 Committer: Pavel Tupitsyn Committed: Fri Apr 13 12:44:17 2018 +0300 -- .../Client/ClientConnectionTest.cs| 12 ++-- .../Client/IgniteClientConfiguration.cs | 4 ++-- .../IgniteClientConfigurationSection.xsd | 2 +- .../Apache.Ignite.Core/Impl/Client/ClientSocket.cs| 14 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9be3357c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs index cb30f40..0a6b1a7 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs @@ -98,11 +98,11 @@ namespace Apache.Ignite.Core.Tests.Client cliCfg.Password = "ignite"; -cliCfg.Username = null; +cliCfg.UserName = null; ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); }); Assert.IsTrue(ex.Message.StartsWith("IgniteClientConfiguration.Username cannot be null")); -cliCfg.Username = ""; +cliCfg.UserName = ""; ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); }); Assert.IsTrue(ex.Message.StartsWith("IgniteClientConfiguration.Username cannot be empty")); } @@ -118,12 +118,12 @@ namespace Apache.Ignite.Core.Tests.Client { var cliCfg = SecureClientConfig(); -cliCfg.Username = "invalid"; +cliCfg.UserName = "invalid"; var ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); }); Assert.True(ex.StatusCode == ClientStatusCode.AuthenticationFailed); -cliCfg.Username = "ignite"; +cliCfg.UserName = "ignite"; cliCfg.Password = "invalid"; ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); }); @@ -165,7 +165,7 @@ namespace Apache.Ignite.Core.Tests.Client var cliCfg = SecureClientConfig(); -cliCfg.Username = "my_User"; +cliCfg.UserName = "my_User"; cliCfg.Password = "my_Password"; using (var cli = Ignition.StartClient(cliCfg)) @@ -532,7 +532,7 @@ namespace Apache.Ignite.Core.Tests.Client return new IgniteClientConfiguration() { Host = "localhost", -Username = "ignite", +UserName = "ignite", Password = "ignite" }; } http://git-wip-us.apache.org/repos/asf/ignite/blob/9be3357c/modules/platforms/dotnet/Apache.Ignite.Core/Client/IgniteClientConfiguration.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Client/IgniteClientConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Client/IgniteClientConfiguration.cs index 3252495..80f26cf 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Client/IgniteClientConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Client/IgniteClientConfiguration.cs @@ -91,7 +91,7 @@ namespace Apache.Ignite.Core.Client BinaryProcessor = cfg.BinaryProcessor; SslStreamFactory = cfg.SslStreamFactory; -Username = cfg.Username; +UserName = cfg.UserName; Password = cfg.Password; } @@ -151,7 +151,7 @@ namespace Apache.Ignite.Core.Client /// /// Username to be used to connect to secured cluster. /// -public string Username { get; set; } +public string UserName { get; set; } /// /// Password to be used to connect to secured cluster. http://git-wip-us.apache.org/repos/asf/ignite/blob/9be3357c/modules/platforms/dotnet/Apache.Ignite.Core/IgniteClientConfigurationSection.xsd
[48/50] [abbrv] ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-7708
http://git-wip-us.apache.org/repos/asf/ignite/blob/ad805704/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java --
[45/50] [abbrv] ignite git commit: IGNITE-7691 .NET: Add attribute-based Scale and Precision tests
IGNITE-7691 .NET: Add attribute-based Scale and Precision tests Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8cb69174 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8cb69174 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8cb69174 Branch: refs/heads/ignite-7708 Commit: 8cb69174338b3f62c11092ca89baa736f0b24989 Parents: 0991437 Author: Pavel TupitsynAuthored: Sun Apr 15 01:34:30 2018 +0300 Committer: Pavel Tupitsyn Committed: Sun Apr 15 01:34:30 2018 +0300 -- .../Cache/Query/CacheQueriesCodeConfigurationTest.cs| 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/8cb69174/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs index a05923d..1d03c68 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs @@ -118,6 +118,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query Assert.AreEqual(typeof(AttributeTest), qe.ValueType); var fields = qe.Fields.ToArray(); +var idxField = fields.Single(x => x.Name == "IndexedField1"); CollectionAssert.AreEquivalent(new[] { @@ -126,7 +127,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query }, fields.Select(x => x.Name)); Assert.IsTrue(fields.Single(x => x.Name == "SqlField").NotNull); -Assert.IsFalse(fields.Single(x => x.Name == "IndexedField1").NotNull); +Assert.IsFalse(idxField.NotNull); var idx = qe.Indexes.ToArray(); @@ -144,6 +145,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query Assert.AreEqual(-1, idx[1].InlineSize); Assert.AreEqual(513, idx[2].InlineSize); Assert.AreEqual(-1, idx[3].InlineSize); + +Assert.AreEqual(3, idxField.Precision); +Assert.AreEqual(4, idxField.Scale); } /// @@ -320,7 +324,8 @@ namespace Apache.Ignite.Core.Tests.Cache.Query [QuerySqlField(NotNull = true)] public double SqlField { get; set; } -[QuerySqlField(IsIndexed = true, Name = "IndexedField1", IsDescending = true, IndexInlineSize = 513)] +[QuerySqlField(IsIndexed = true, Name = "IndexedField1", IsDescending = true, IndexInlineSize = 513, +DefaultValue = 42, Precision = 3, Scale = 4)] public int IndexedField { get; set; } [QueryTextField]
[41/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/main/java/org/apache/ignite/ml/nn/UpdatesStrategy.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/nn/UpdatesStrategy.java b/modules/ml/src/main/java/org/apache/ignite/ml/nn/UpdatesStrategy.java new file mode 100644 index 000..e48d946 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/nn/UpdatesStrategy.java @@ -0,0 +1,95 @@ +/* + * 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.nn; + +import java.io.Serializable; +import java.util.List; +import org.apache.ignite.ml.math.functions.IgniteFunction; +import org.apache.ignite.ml.optimization.updatecalculators.ParameterUpdateCalculator; + +/** + * Class encapsulating update strategies for group trainers based on updates. + * + * @param Type of model to be optimized. + * @param Type of update. + */ +public class UpdatesStrategy{ +/** + * {@link ParameterUpdateCalculator}. + */ +private ParameterUpdateCalculator updatesCalculator; + +/** + * Function used to reduce updates in one training (for example, sum all sequential gradient updates to get one + * gradient update). + */ +private IgniteFunction locStepUpdatesReducer; + +/** + * Function used to reduce updates from different trainings (for example, averaging of gradients of all parallel trainings). + */ +private IgniteFunction
allUpdatesReducer; + +/** + * Construct instance of this class with given parameters. + * + * @param updatesCalculator Parameter update calculator. + * @param locStepUpdatesReducer Function used to reduce updates in one training + * (for example, sum all sequential gradient updates to get one gradient update). + * @param allUpdatesReducer Function used to reduce updates from different trainings + * (for example, averaging of gradients of all parallel trainings). + */ +public UpdatesStrategy( +ParameterUpdateCalculator
updatesCalculator, +IgniteFunction locStepUpdatesReducer, +IgniteFunction
allUpdatesReducer) { +this.updatesCalculator = updatesCalculator; +this.locStepUpdatesReducer = locStepUpdatesReducer; +this.allUpdatesReducer = allUpdatesReducer; +} + +/** + * Get parameter update calculator (see {@link ParameterUpdateCalculator}). + * + * @return Parameter update calculator. + */ +public ParameterUpdateCalculator
getUpdatesCalculator() { +return updatesCalculator; +} + +/** + * Get function used to reduce updates in one training + * (for example, sum all sequential gradient updates to get one gradient update). + * + * @return Function used to reduce updates in one training + * (for example, sum all sequential gradient updates to get on gradient update). + */ +public IgniteFunction locStepUpdatesReducer() { +return locStepUpdatesReducer; +} + +/** + * Get function used to reduce updates from different trainings + * (for example, averaging of gradients of all parallel trainings). + * + * @return Function used to reduce updates from different trainings. + */ +public IgniteFunction
allUpdatesReducer() { +return allUpdatesReducer; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/main/java/org/apache/ignite/ml/optimization/GradientDescent.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/optimization/GradientDescent.java b/modules/ml/src/main/java/org/apache/ignite/ml/optimization/GradientDescent.java deleted file mode 100644 index 15ed914..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/optimization/GradientDescent.java +++ /dev/null @@ -1,202 +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
[23/50] [abbrv] ignite git commit: IGNITE-7871 Fixed condition for cache partitions validation. - Fixes #3804.
IGNITE-7871 Fixed condition for cache partitions validation. - Fixes #3804. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7a1d0ea7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7a1d0ea7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7a1d0ea7 Branch: refs/heads/ignite-7708 Commit: 7a1d0ea70127f73409071d7f9581a8207be97491 Parents: 706e7f8 Author: Pavel Kovalenko Authored: Thu Apr 12 14:29:43 2018 +0300 Committer: dpavlov Committed: Thu Apr 12 14:29:43 2018 +0300 -- .../distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7a1d0ea7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index dd4a571..af5acd6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -2760,7 +2760,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte || grpCtx.config().isReadThrough() || grpCtx.config().isWriteThrough() || grpCtx.config().getCacheStoreFactory() != null -|| grpCtx.config().getRebalanceDelay() != -1 +|| grpCtx.config().getRebalanceDelay() == -1 || grpCtx.config().getRebalanceMode() == CacheRebalanceMode.NONE) continue;
[13/50] [abbrv] 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-7708 Commit: 747e6c5f9c635a5b9c6856efd2b94b05297b7f25 Parents: 98ef925 Author: Alexander PaschenkoAuthored: 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 {
[46/50] [abbrv] ignite git commit: IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795.
IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/af2b7421 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/af2b7421 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/af2b7421 Branch: refs/heads/ignite-7708 Commit: af2b74215e8b0fc119537c6ba0a35977e0579b24 Parents: 8cb6917 Author: tledkov-gridgainAuthored: Mon Apr 16 11:28:39 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:28:39 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSSLTest.java| 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/af2b7421/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java index cc71f51..355a198 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java @@ -164,7 +164,14 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ public void testDefaultContext() throws Exception { +// Store exists default SSL context to restore after test. +final SSLContext dfltSslCtx = SSLContext.getDefault(); + +// Setup default context +SSLContext.setDefault(getTestSslContextFactory().create()); + setSslCtxFactoryToCli = true; + // Factory return default SSL context sslCtxFactory = new Factory() { @Override public SSLContext create() { @@ -177,23 +184,16 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { } }; -System.setProperty("javax.net.ssl.keyStore", CLI_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.keyStorePassword", "123456"); -System.setProperty("javax.net.ssl.trustStore", TRUST_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.trustStorePassword", "123456"); - startGrids(1); try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/?sslMode=require")) { checkConnection(conn); } finally { -System.getProperties().remove("javax.net.ssl.keyStore"); -System.getProperties().remove("javax.net.ssl.keyStorePassword"); -System.getProperties().remove("javax.net.ssl.trustStore"); -System.getProperties().remove("javax.net.ssl.trustStorePassword"); - stopAllGrids(); + +// Restore SSL context. +SSLContext.setDefault(dfltSslCtx); } }
[14/50] [abbrv] 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-7708 Commit: 5a29276355c4eb8966e5825883e1232ee2a80509 Parents: 747e6c5 Author: Alexey KukushkinAuthored: 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
[25/50] [abbrv] ignite git commit: IGNITE-8230: SQL: Fixed backup number propagation in CREATE TABLE command. This closes #3803.
IGNITE-8230: SQL: Fixed backup number propagation in CREATE TABLE command. This closes #3803. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b93595cb Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b93595cb Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b93595cb Branch: refs/heads/ignite-7708 Commit: b93595cbe67bb3313d472db58b6d113e10a2f97e Parents: a57c9e1 Author: devozerovAuthored: Thu Apr 12 15:13:51 2018 +0300 Committer: devozerov Committed: Thu Apr 12 15:13:51 2018 +0300 -- .../processors/query/GridQueryProcessor.java| 7 ++-- .../query/h2/sql/GridSqlCreateTable.java| 7 ++-- .../cache/index/H2DynamicTableSelfTest.java | 37 3 files changed, 45 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b93595cb/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java index bde9427..03e5254 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java @@ -1483,10 +1483,10 @@ public class GridQueryProcessor extends GridProcessorAdapter { @SuppressWarnings("unchecked") public void dynamicTableCreate(String schemaName, QueryEntity entity, String templateName, String cacheName, String cacheGroup, @Nullable String dataRegion, String affinityKey, @Nullable CacheAtomicityMode atomicityMode, -@Nullable CacheWriteSynchronizationMode writeSyncMode, int backups, boolean ifNotExists) +@Nullable CacheWriteSynchronizationMode writeSyncMode, @Nullable Integer backups, boolean ifNotExists) throws IgniteCheckedException { assert !F.isEmpty(templateName); -assert backups >= 0; +assert backups == null || backups >= 0; CacheConfiguration ccfg = ctx.cache().getConfigFromTemplate(templateName); @@ -1525,7 +1525,8 @@ public class GridQueryProcessor extends GridProcessorAdapter { if (writeSyncMode != null) ccfg.setWriteSynchronizationMode(writeSyncMode); -ccfg.setBackups(backups); +if (backups != null) +ccfg.setBackups(backups); ccfg.setSqlSchema(schemaName); ccfg.setSqlEscapeAll(true); http://git-wip-us.apache.org/repos/asf/ignite/blob/b93595cb/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlCreateTable.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlCreateTable.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlCreateTable.java index 3608aed..de86d6a 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlCreateTable.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlCreateTable.java @@ -22,6 +22,7 @@ import java.util.LinkedHashSet; import java.util.List; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.jetbrains.annotations.Nullable; /** * CREATE TABLE statement. @@ -57,7 +58,7 @@ public class GridSqlCreateTable extends GridSqlStatement { private CacheWriteSynchronizationMode writeSyncMode; /** Backups number for new cache. */ -private int backups; +private Integer backups; /** Quietly ignore this command if table already exists. */ private boolean ifNotExists; @@ -184,14 +185,14 @@ public class GridSqlCreateTable extends GridSqlStatement { /** * @return Backups number for new cache. */ -public int backups() { +@Nullable public Integer backups() { return backups; } /** * @param backups Backups number for new cache. */ -public void backups(int backups) { +public void backups(Integer backups) { this.backups = backups; } http://git-wip-us.apache.org/repos/asf/ignite/blob/b93595cb/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java -- diff --git
[17/50] [abbrv] 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 GuraProject: 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-7708 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 {
[26/50] [abbrv] ignite git commit: IGNITE-8141 Acknowledge SWAPPINESS reduction using a range (<= 10). - Fixes #3727.
IGNITE-8141 Acknowledge SWAPPINESS reduction using a range (<= 10). - Fixes #3727. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/47ca3e0d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/47ca3e0d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/47ca3e0d Branch: refs/heads/ignite-7708 Commit: 47ca3e0da7fd7468d7ea96ff512c3d1f3ed5bf81 Parents: b93595c Author: Reed Sandberg Authored: Thu Apr 12 20:18:10 2018 +0300 Committer: dpavlov Committed: Thu Apr 12 20:18:10 2018 +0300 -- .../suggestions/OsConfigurationSuggestions.java | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/47ca3e0d/modules/core/src/main/java/org/apache/ignite/internal/suggestions/OsConfigurationSuggestions.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/suggestions/OsConfigurationSuggestions.java b/modules/core/src/main/java/org/apache/ignite/internal/suggestions/OsConfigurationSuggestions.java index e5b4c12..695b423 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/suggestions/OsConfigurationSuggestions.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/suggestions/OsConfigurationSuggestions.java @@ -76,8 +76,18 @@ public class OsConfigurationSuggestions { (dwcParamFlag && decParamFlag ? "s" : ""), expected)); -if ((value = readVmParam(SWAPPINESS)) != null && !value.equals(expected = "10")) -suggestions.add(String.format("Reduce pages swapping ratio (set vm.%s=%s)", SWAPPINESS, expected)); +if ((value = readVmParam(SWAPPINESS)) != null) { +try { +double maxSwappiness = 10.0; + +if (Float.parseFloat(value) > maxSwappiness) +suggestions.add(String.format("Reduce pages swapping ratio (set vm.%s=%f or less)", SWAPPINESS, + maxSwappiness)); +} +catch (NumberFormatException ignored) { +// OS param not parsable as a number +} +} if ((value = readVmParam(ZONE_RECLAIM_MODE)) != null && !value.equals(expected = "0")) suggestions.add(String.format("Disable NUMA memory reclaim (set vm.%s=%s)", ZONE_RECLAIM_MODE,
[27/50] [abbrv] ignite git commit: IGNITE-8110 GridCacheWriteBehindStore.Flusher thread uses the wrong transformation from milliseconds to nanoseconds. - Fixes #3742.
IGNITE-8110 GridCacheWriteBehindStore.Flusher thread uses the wrong transformation from milliseconds to nanoseconds. - Fixes #3742. Signed-off-by: dpavlovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/adaedb44 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/adaedb44 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/adaedb44 Branch: refs/heads/ignite-7708 Commit: adaedb44b767da49c4ec6c57c655b13caa3edd35 Parents: 47ca3e0 Author: Anton Kurbanov Authored: Thu Apr 12 20:31:50 2018 +0300 Committer: dpavlov Committed: Thu Apr 12 20:31:50 2018 +0300 -- .../cache/store/GridCacheWriteBehindStore.java | 2 +- .../GridCacheWriteBehindStoreSelfTest.java | 41 +++- 2 files changed, 40 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/adaedb44/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java index 44cadd6..82ff3aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java @@ -895,7 +895,7 @@ public class GridCacheWriteBehindStore implements CacheStore , Lifecy protected Thread thread; /** Cache flushing frequence in nanos. */ -protected long cacheFlushFreqNanos = cacheFlushFreq * 1000; +protected long cacheFlushFreqNanos = cacheFlushFreq * 1000 * 1000; /** Writer lock. */ private final Lock flusherWriterLock = new ReentrantLock(); http://git-wip-us.apache.org/repos/asf/ignite/blob/adaedb44/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStoreSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStoreSelfTest.java index 9a487a4..af21fc8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStoreSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStoreSelfTest.java @@ -107,6 +107,43 @@ public class GridCacheWriteBehindStoreSelfTest extends GridCacheWriteBehindStore } /** + * Checks that write behind cache flush frequency was correctly adjusted to nanos expecting putAllCnt to be + * less or equal than elapsed time divided by flush frequency. + * + * @throws Exception If failed. + */ +public void testSimpleStoreFlushFrequencyWithoutCoalescing() throws Exception { +initStore(1, false); + +long writeBehindFlushFreqNanos = FLUSH_FREQUENCY * 1000 * 1000; + +int threshold = store.getWriteBehindStoreBatchSize() / 10; + +try { +long start = System.nanoTime(); + +for (int i = 0; i < threshold / 2; i++) +store.write(new CacheEntryImpl<>(i, "v" + i)); + +U.sleep(FLUSH_FREQUENCY + 300); + +for (int i = threshold / 2; i < threshold; i++) +store.write(new CacheEntryImpl<>(i, "v" + i)); + +long elapsed = System.nanoTime() - start; + +U.sleep(FLUSH_FREQUENCY + 300); + +int expFlushOps = (int)(1 + elapsed / writeBehindFlushFreqNanos); + +assertTrue(delegate.getPutAllCount() <= expFlushOps); +} +finally { +shutdownStore(); +} +} + +/** * Simple store test. * * @param writeCoalescing Write coalescing flag. @@ -254,7 +291,6 @@ public class GridCacheWriteBehindStoreSelfTest extends GridCacheWriteBehindStore int delegatePutCnt = delegate.getPutAllCount(); - fut.get(); log().info(">>> [putCnt = " + actualPutCnt.get() + ", delegatePutCnt=" + delegatePutCnt + "]"); @@ -262,7 +298,8 @@ public class GridCacheWriteBehindStoreSelfTest extends GridCacheWriteBehindStore assertTrue("No puts were made to the underlying store", delegatePutCnt > 0); if (store.getWriteCoalescing()) { assertTrue("Too many puts were made to the underlying
[50/50] [abbrv] ignite git commit: IGNITE-7708 Debug
IGNITE-7708 Debug Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eced6a11 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eced6a11 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eced6a11 Branch: refs/heads/ignite-7708 Commit: eced6a11a759b822772e1de76420f957a6679e88 Parents: ad80570 Author: Alexey GoncharukAuthored: Mon Apr 16 16:56:49 2018 +0300 Committer: Alexey Goncharuk Committed: Mon Apr 16 16:56:49 2018 +0300 -- .../configvariations/ConfigVariationsTestSuiteBuilder.java | 9 - .../junits/IgniteConfigVariationsAbstractTest.java | 4 2 files changed, 12 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/eced6a11/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java index 4a60671..94e56c9 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java @@ -191,6 +191,8 @@ public class ConfigVariationsTestSuiteBuilder { + ", igniteCfg=" + factory.getIgniteConfigurationDescription() + ", cacheCfg=" + factory.getCacheConfigurationDescription() + "]"; +System.out.println("Building test suite [suffix=" + clsNameSuffix + ", stopNodes=" + stopNodes + ']'); + VariationsTestsConfig testCfg = new VariationsTestsConfig(factory, clsNameSuffix, stopNodes, cacheStartMode, gridsCnt, !skipWaitPartMapExchange); @@ -223,7 +225,12 @@ public class ConfigVariationsTestSuiteBuilder { boolean startCache = i == 0; boolean stopCache = i + 1 == testedNodeCnt; -VariationsTestsConfig cfg0 = new VariationsTestsConfig(cfg.configurationFactory(), cfg.description(), +System.out.println("Building multi-node test suite [clsSuffix=" + cfg.description() + +", testedNode=" + i + ", stopNodes=" + stopNodes + ']'); + +VariationsTestsConfig cfg0 = new VariationsTestsConfig( +cfg.configurationFactory(), +cfg.description() + "-node-" + i, stopNodes, startCache, stopCache, cfg.cacheStartMode(), cfg.gridCount(), i, withClients, !skipWaitParMapExchange); http://git-wip-us.apache.org/repos/asf/ignite/blob/eced6a11/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java index eba201a..2e6031c 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java @@ -132,6 +132,9 @@ public abstract class IgniteConfigVariationsAbstractTest extends GridCommonAbstr memoryUsage(); } +else { +info("Will NOT stop nodes: " + this); +} } /** @@ -246,6 +249,7 @@ public abstract class IgniteConfigVariationsAbstractTest extends GridCommonAbstr } info("Running test in data mode [dataMode=" + dataMode + +", igniteInstance=" + getTestIgniteInstanceName() + ", marshaller=" + getConfiguration().getMarshaller() + ']'); if (i != 0)
[02/50] [abbrv] 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 KulichenkoProject: 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-7708 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
[21/50] [abbrv] ignite git commit: IGNITE-8176: Integrate gradient descent linear regression with partition based dataset
IGNITE-8176: Integrate gradient descent linear regression with partition based dataset this closes #3787 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/df6356d5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/df6356d5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/df6356d5 Branch: refs/heads/ignite-7708 Commit: df6356d5d1470337a6ea705a332cf07f1dce Parents: 67023a8 Author: dmitrievanthonyAuthored: Thu Apr 12 11:16:22 2018 +0300 Committer: YuriBabak Committed: Thu Apr 12 11:16:22 2018 +0300 -- .../ml/knn/KNNClassificationExample.java| 11 +- .../examples/ml/nn/MLPTrainerExample.java | 4 +- .../ml/preprocessing/NormalizationExample.java | 17 +-- ...nWithLSQRTrainerAndNormalizationExample.java | 23 ++-- ...dLinearRegressionWithLSQRTrainerExample.java | 14 +-- ...tedLinearRegressionWithQRTrainerExample.java | 9 +- ...edLinearRegressionWithSGDTrainerExample.java | 78 +--- .../binary/SVMBinaryClassificationExample.java | 11 +- .../SVMMultiClassClassificationExample.java | 24 ++-- ...ecisionTreeClassificationTrainerExample.java | 7 +- .../DecisionTreeRegressionTrainerExample.java | 4 +- .../org/apache/ignite/ml/nn/Activators.java | 20 .../org/apache/ignite/ml/nn/MLPTrainer.java | 46 ++-- .../ml/preprocessing/PreprocessingTrainer.java | 41 ++- .../normalization/NormalizationTrainer.java | 35 -- .../linear/FeatureExtractorWrapper.java | 55 + .../linear/LinearRegressionLSQRTrainer.java | 38 +- .../linear/LinearRegressionSGDTrainer.java | 118 +-- .../ignite/ml/trainers/DatasetTrainer.java | 46 .../ignite/ml/knn/KNNClassificationTest.java| 20 ++-- .../ignite/ml/nn/MLPTrainerIntegrationTest.java | 14 +-- .../org/apache/ignite/ml/nn/MLPTrainerTest.java | 22 ++-- .../MLPTrainerMnistIntegrationTest.java | 7 +- .../ml/nn/performance/MLPTrainerMnistTest.java | 11 +- .../normalization/NormalizationTrainerTest.java | 10 +- .../ml/regressions/RegressionsTestSuite.java| 15 +-- ...stributedLinearRegressionSGDTrainerTest.java | 35 -- ...stributedLinearRegressionSGDTrainerTest.java | 35 -- ...wareAbstractLinearRegressionTrainerTest.java | 3 + .../linear/LinearRegressionLSQRTrainerTest.java | 14 ++- .../linear/LinearRegressionSGDTrainerTest.java | 94 +++ .../LocalLinearRegressionSGDTrainerTest.java| 35 -- .../ignite/ml/svm/SVMBinaryTrainerTest.java | 11 +- .../ignite/ml/svm/SVMMultiClassTrainerTest.java | 11 +- ...reeClassificationTrainerIntegrationTest.java | 9 +- .../DecisionTreeClassificationTrainerTest.java | 12 +- ...ionTreeRegressionTrainerIntegrationTest.java | 9 +- .../tree/DecisionTreeRegressionTrainerTest.java | 12 +- .../DecisionTreeMNISTIntegrationTest.java | 7 +- .../tree/performance/DecisionTreeMNISTTest.java | 11 +- 40 files changed, 612 insertions(+), 386 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/df6356d5/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java index f3cdbbe..39a8431 100644 --- a/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java @@ -17,9 +17,6 @@ package org.apache.ignite.examples.ml.knn; -import java.util.Arrays; -import java.util.UUID; -import javax.cache.Cache; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; @@ -27,7 +24,6 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.ml.dataset.impl.cache.CacheBasedDatasetBuilder; import org.apache.ignite.ml.knn.classification.KNNClassificationModel; import org.apache.ignite.ml.knn.classification.KNNClassificationTrainer; import org.apache.ignite.ml.knn.classification.KNNStrategy; @@ -35,6 +31,10 @@ import org.apache.ignite.ml.math.distances.EuclideanDistance; import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; import org.apache.ignite.thread.IgniteThread; +import javax.cache.Cache; +import java.util.Arrays; +import java.util.UUID; + /** * Run kNN multi-class
[15/50] [abbrv] 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-7708 Commit: 14402e4030cf0257b72c636894f140f346266299 Parents: 5a29276 Author: devozerovAuthored: 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")) { -
[04/50] [abbrv] 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-7708 Commit: da77b9818a70495b7afdf6899ebd9180dadd7f68 Parents: f4de6df Author: Pavel KovalenkoAuthored: 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
[36/50] [abbrv] ignite git commit: IGNITE-8256 Fixed simulated node failure in the test
IGNITE-8256 Fixed simulated node failure in the test Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/568c3e79 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/568c3e79 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/568c3e79 Branch: refs/heads/ignite-7708 Commit: 568c3e79ed474a9870685ab4b01454af1645866c Parents: 8a42f64 Author: Alexey GoncharukAuthored: Fri Apr 13 18:01:00 2018 +0300 Committer: Alexey Goncharuk Committed: Fri Apr 13 18:01:00 2018 +0300 -- .../cache/distributed/dht/TxRecoveryStoreEnabledTest.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/568c3e79/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/TxRecoveryStoreEnabledTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/TxRecoveryStoreEnabledTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/TxRecoveryStoreEnabledTest.java index 060af21..30ac83d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/TxRecoveryStoreEnabledTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/TxRecoveryStoreEnabledTest.java @@ -32,6 +32,7 @@ import org.apache.ignite.cache.store.CacheStoreAdapter; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.failure.StopNodeFailureHandler; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi; @@ -81,6 +82,8 @@ public class TxRecoveryStoreEnabledTest extends GridCommonAbstractTest { cfg.setCacheConfiguration(ccfg); +cfg.setFailureHandler(new StopNodeFailureHandler()); + return cfg; }
[22/50] [abbrv] ignite git commit: IGNITE-7824: Wrong warning message fixed. - Fixes #3788.
IGNITE-7824: Wrong warning message fixed. - Fixes #3788. Signed-off-by: Nikolay IzhikovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/706e7f81 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/706e7f81 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/706e7f81 Branch: refs/heads/ignite-7708 Commit: 706e7f81b44ca9b3a01ffd673e5db61578123b64 Parents: df6356d Author: NSAmelchev Authored: Thu Apr 12 13:21:15 2018 +0300 Committer: Nikolay Izhikov Committed: Thu Apr 12 13:21:15 2018 +0300 -- .../src/main/java/org/apache/ignite/internal/IgniteKernal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/706e7f81/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index 1cb07b9..795601e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -1439,7 +1439,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { long safeToUse = ram - Math.max(4L << 30, (long)(ram * 0.2)); if (total > safeToUse) { -U.quietAndWarn(log, "Nodes started on local machine require more than 20% of physical RAM what can " + +U.quietAndWarn(log, "Nodes started on local machine require more than 80% of physical RAM what can " + "lead to significant slowdown due to swapping (please decrease JVM heap size, data region " + "size or checkpoint buffer size) [required=" + (total >> 20) + "MB, available=" + (ram >> 20) + "MB]");
[06/50] [abbrv] 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-7708 Commit: 6557fe62696ac24c740e445b53482da298b59b27 Parents: 780fc07 Author: Sergey ChugunovAuthored: 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
[33/50] [abbrv] ignite git commit: IGNITE-8042: .NET: Thin client: authentication support - fix TestAuthenticationEmptyCredentials
IGNITE-8042: .NET: Thin client: authentication support - fix TestAuthenticationEmptyCredentials Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5fd5968e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5fd5968e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5fd5968e Branch: refs/heads/ignite-7708 Commit: 5fd5968e5e7119571ae315af66f5f23032ff96da Parents: 8550d61 Author: Pavel TupitsynAuthored: Fri Apr 13 13:36:20 2018 +0300 Committer: Pavel Tupitsyn Committed: Fri Apr 13 13:36:20 2018 +0300 -- .../dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/5fd5968e/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs index 0a6b1a7..67d1c52 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/ClientConnectionTest.cs @@ -100,7 +100,7 @@ namespace Apache.Ignite.Core.Tests.Client cliCfg.UserName = null; ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); }); - Assert.IsTrue(ex.Message.StartsWith("IgniteClientConfiguration.Username cannot be null")); + Assert.IsTrue(ex.Message.StartsWith("IgniteClientConfiguration.UserName cannot be null")); cliCfg.UserName = ""; ex = Assert.Throws(() => { Ignition.StartClient(cliCfg); });
[38/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java b/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java deleted file mode 100644 index caf92f6..000 --- a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java +++ /dev/null @@ -1,65 +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.trainers.group; - -import java.util.List; -import java.util.UUID; -import java.util.stream.Stream; -import org.apache.ignite.Ignition; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.functions.IgniteSupplier; -import org.apache.ignite.ml.trainers.group.chain.DistributedEntryProcessingStep; -import org.apache.ignite.ml.trainers.group.chain.EntryAndContext; - -/** */ -public class TestTrainingLoopStep implements DistributedEntryProcessingStep{ -/** {@inheritDoc} */ -@Override public IgniteSupplier remoteContextSupplier(Double input, TestGroupTrainerLocalContext locCtx) { -// No context is needed. -return () -> null; -} - -/** {@inheritDoc} */ -@Override public IgniteFunction , ResultAndUpdates> worker() { -return entryAndContext -> { -Integer oldVal = entryAndContext.entry().getValue(); -double v = oldVal * oldVal; -ResultAndUpdates res = ResultAndUpdates.of(v); - res.updateCache(TestGroupTrainingCache.getOrCreate(Ignition.localIgnite()), -entryAndContext.entry().getKey(), (int)v); -return res; -}; -} - -/** {@inheritDoc} */ -@Override public IgniteSupplier > keys(Double input, -TestGroupTrainerLocalContext locCtx) { -// Copying here because otherwise locCtx will be serialized with supplier returned in result. -int limit = locCtx.limit(); -int cnt = locCtx.eachNumberCnt(); -UUID uuid = locCtx.trainingUUID(); - -return () -> TestGroupTrainingCache.allKeys(limit, cnt, uuid); -} - -/** {@inheritDoc} */ -@Override public IgniteFunction reducer() { -return doubles -> doubles.stream().mapToDouble(x -> x).sum(); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java b/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java deleted file mode 100644 index 0ec5afb..000 --- a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java +++ /dev/null @@ -1,32 +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.trainers.group; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for group trainer tests. - */ -@RunWith(Suite.class)
[09/50] [abbrv] 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-7708 Commit: 74d254564a44a95db9945652c9b579ed6b431ee9 Parents: 9752466 Author: Alexander KalininAuthored: 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 +++
[39/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/test/java/org/apache/ignite/ml/regressions/linear/ArtificialRegressionDatasets.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/regressions/linear/ArtificialRegressionDatasets.java b/modules/ml/src/test/java/org/apache/ignite/ml/regressions/linear/ArtificialRegressionDatasets.java deleted file mode 100644 index ed6bf36..000 --- a/modules/ml/src/test/java/org/apache/ignite/ml/regressions/linear/ArtificialRegressionDatasets.java +++ /dev/null @@ -1,404 +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.regressions.linear; - -/** - * Artificial regression datasets to be used in regression trainers tests. These datasets were generated by scikit-learn - * tools, {@code sklearn.datasets.make_regression} procedure. - */ -public class ArtificialRegressionDatasets { -/** - * Artificial dataset with 10 observations described by 1 feature. - */ -public static final TestDataset regression10x1 = new TestDataset(new double[][] { -{1.97657990214, 0.197725444973}, -{-5.0835948878, -0.279921224228}, -{-5.09032600779, -0.352291245969}, -{9.67660993007, 0.755464872441}, -{4.95927629958, 0.451981771462}, -{29.2635107429, 2.2277440173}, -{-18.3122588459, -1.25363275369}, -{-3.61729307199, -0.273362913982}, -{-7.19042139249, -0.473846634967}, -{3.68008403347, 0.353883097536} -}, new double[] {13.554054703}, -0.808655936776); - -/** - * Artificial dataset with 10 observations described by 5 features. - */ -public static final TestDataset regression10x5 = new TestDataset(new double[][] { -{118.635647237, 0.687593385888, -1.18956185502, -0.305420702986, 1.98794097418, -0.776629036361}, -{-18.2808432286, -0.165921853684, -0.156162539573, 1.56284391134, -0.198876782109, -0.0921618505605}, -{22.6110523992, 0.0268106268606, 0.702141470035, -0.41503615392, -1.09726502337, 1.30830482813}, -{209.820435262, 0.379809113402, -0.192097238579, -1.27460497119, 2.48052002019, -0.57443065}, -{-253.750024054, -1.48044570917, -0.331747484523, 0.387993627712, 0.372583756237, -2.27404065923}, -{-24.6467766166, -0.66991474156, 0.269042238935, -0.271412703096, -0.561166818525, 1.37067541854}, -{-311.903650717, 0.268274438122, -1.10491275353, -1.06738703543, -2.24387799735, -0.207431467989}, -{74.2055323536, -0.329489531894, -0.493350762533, -0.644851462227, 0.661220945573, 1.65950140864}, -{57.0312289904, -1.07266578457, 0.80375035572, -0.45207210139, 1.69314420969, -1.10526080856}, -{12.149399645, 1.46504629281, -1.05843246079, 0.266225365277, -0.0113100353869, -0.983495425471} -}, new double[] {99.8393653561, 82.4948224094, 20.2087724072, 97.3306384162, 55.7502297387}, 3.98444039189); - -/** - * Artificial dataset with 100 observations described by 5 features. - */ -public static final TestDataset regression100x5 = new TestDataset(new double[][] { -{-44.2310642946, -0.0331360137605, -0.5290800706, -0.634340342338, -0.428433927151, 0.830582347183}, -{76.2539139721, -0.216200869652, 0.513212019048, -0.693404511747, 0.132995973133, 1.28470259833}, -{293.369799914, 2.90735870802, 0.457740818846, -0.490470696097, -0.442343455187, 0.584038258781}, -{124.258807314, 1.64158129148, 0.0616936820145, 1.24082841519, -1.20126518593, -0.542298907742}, -{13.6610807249, -1.10834821778, 0.545508208111, 1.81361288715, -0.786543112444, 0.250772626496}, -{101.924582305, -0.433526394969, 0.257594734335, 1.22333193911, 0.76626554927, -0.0400734567005}, -{25.5963186303, -0.202003301507, 0.717101151637, -0.486881225605, 1.15215024807, -0.921615554612}, -{75.7959681263, -0.604173187402, 0.0364386836472, 1.67544714536, 0.394743148877, 0.0237966550759}, -{-97.539357166, -0.774517689169, -0.0966902473883, -0.152250704254, -0.325472625458, 0.0720711851256}, -{0.394748999236, -0.559303402754,
[16/50] [abbrv] ignite git commit: IGNITE-6679 Clean up some deprecated cache metrics
IGNITE-6679 Clean up some deprecated cache metrics Signed-off-by: Anton VinogradovProject: 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-7708 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(); /**
[12/50] [abbrv] 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 KuznetsovProject: 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-7708 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
[32/50] [abbrv] ignite git commit: IGNITE-7829: Adopt kNN regression example to the new Partitioned Dataset
IGNITE-7829: Adopt kNN regression example to the new Partitioned Dataset this closes #3798 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8550d61b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8550d61b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8550d61b Branch: refs/heads/ignite-7708 Commit: 8550d61b6b39625579eb7f69f4d1218b78f7cc5b Parents: 9be3357 Author: zaleslawAuthored: Fri Apr 13 12:49:56 2018 +0300 Committer: YuriBabak Committed: Fri Apr 13 12:49:56 2018 +0300 -- .../ml/knn/KNNClassificationExample.java| 4 +- .../examples/ml/knn/KNNRegressionExample.java | 310 +++ .../java/org/apache/ignite/ml/knn/KNNUtils.java | 10 +- .../classification/KNNClassificationModel.java | 9 +- .../ml/knn/partitions/KNNPartitionContext.java | 28 -- .../ignite/ml/knn/partitions/package-info.java | 22 -- .../ml/knn/regression/KNNRegressionModel.java | 7 +- .../partition/LabelPartitionContext.java| 28 -- .../LabelPartitionDataBuilderOnHeap.java| 1 - .../svm/SVMLinearBinaryClassificationModel.java | 3 + .../SVMLinearBinaryClassificationTrainer.java | 9 +- .../SVMLinearMultiClassClassificationModel.java | 3 + ...VMLinearMultiClassClassificationTrainer.java | 8 +- .../ignite/ml/svm/SVMPartitionContext.java | 28 -- .../org/apache/ignite/ml/knn/BaseKNNTest.java | 89 -- .../ignite/ml/knn/KNNClassificationTest.java| 110 +++ .../apache/ignite/ml/knn/KNNRegressionTest.java | 104 +++ .../ignite/ml/knn/LabeledDatasetHelper.java | 87 ++ .../ignite/ml/knn/LabeledDatasetTest.java | 2 +- 19 files changed, 536 insertions(+), 326 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/8550d61b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java index 39a8431..15375a1 100644 --- a/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNClassificationExample.java @@ -80,7 +80,7 @@ public class KNNClassificationExample { double prediction = knnMdl.apply(new DenseLocalOnHeapVector(inputs)); totalAmount++; -if(groundTruth != prediction) +if (groundTruth != prediction) amountOfErrors++; System.out.printf(">>> | %.4f\t\t| %.4f\t\t|\n", prediction, groundTruth); @@ -89,7 +89,7 @@ public class KNNClassificationExample { System.out.println(">>> -"); System.out.println("\n>>> Absolute amount of errors " + amountOfErrors); -System.out.println("\n>>> Accuracy " + (1 - amountOfErrors / (double)totalAmount)); +System.out.println("\n>>> Accuracy " + (1 - amountOfErrors / (double) totalAmount)); } }); http://git-wip-us.apache.org/repos/asf/ignite/blob/8550d61b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNRegressionExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNRegressionExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNRegressionExample.java new file mode 100644 index 000..76a07cd --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/ml/knn/KNNRegressionExample.java @@ -0,0 +1,310 @@ +/* + * 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.examples.ml.knn; + +import java.util.Arrays; +import
[40/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/main/java/org/apache/ignite/ml/trainers/group/MetaoptimizerGroupTrainer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trainers/group/MetaoptimizerGroupTrainer.java b/modules/ml/src/main/java/org/apache/ignite/ml/trainers/group/MetaoptimizerGroupTrainer.java deleted file mode 100644 index bebfe3e..000 --- a/modules/ml/src/main/java/org/apache/ignite/ml/trainers/group/MetaoptimizerGroupTrainer.java +++ /dev/null @@ -1,132 +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.trainers.group; - -import java.io.Serializable; -import java.util.List; -import java.util.UUID; -import java.util.stream.Stream; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.ml.Model; -import org.apache.ignite.ml.math.functions.IgniteFunction; -import org.apache.ignite.ml.math.functions.IgniteSupplier; -import org.apache.ignite.ml.trainers.group.chain.Chains; -import org.apache.ignite.ml.trainers.group.chain.ComputationsChain; -import org.apache.ignite.ml.trainers.group.chain.EntryAndContext; -import org.apache.ignite.ml.trainers.group.chain.HasTrainingUUID; - -/** - * Group trainer using {@link Metaoptimizer}. - * Main purpose of this trainer is to extract various transformations (normalizations for example) of data which is processed - * in the training loop step into distinct entity called metaoptimizer and only fix the main part of logic in - * trainers extending this class. This way we'll be able to quickly switch between this transformations by using different metaoptimizers - * without touching main logic. - * - * @param Type of local context. - * @param Type of data in {@link GroupTrainerCacheKey} keys on which the training is done. - * @param Type of values of cache used in group training. - * @param Data type which is returned by distributed initializer. - * @param Type of final result returned by nodes on which training is done. - * @param Type of data which is fed into each training loop step and returned from it. - * @param Type of model returned after training. - * @param Type of input of this trainer. - * @param Type of distributed context which is needed for forming final result which is send from each node to trainer for final model creation. - * @param Type of output of postprocessor. - * @param Type of data which is processed by dataProcessor. - * @param Type of data which is returned by postprocessor. - */ -public abstract class MetaoptimizerGroupTrainer, -G, O extends Serializable, X, Y> extends -GroupTrainer{ -/** - * Metaoptimizer. - */ -private Metaoptimizer metaoptimizer; - -/** - * Construct instance of this class. - * - * @param cache Cache on which group trainer is done. - * @param ignite Ignite instance. - */ -public MetaoptimizerGroupTrainer(Metaoptimizer metaoptimizer, -IgniteCache cache, -Ignite ignite) { -super(cache, ignite); -this.metaoptimizer = metaoptimizer; -} - -/** - * Get function used to map EntryAndContext to type which is processed by dataProcessor. - * - * @return Function used to map EntryAndContext to type which is processed by dataProcessor. - */ -protected abstract IgniteFunction , X> trainingLoopStepDataExtractor(); - -/** - * Get supplier of keys which should be processed by training loop. - * - * @param locCtx Local text. - * @return Supplier of keys which should be processed by training loop. - */ -protected abstract IgniteSupplier > keysToProcessInTrainingLoop(LC locCtx); - -/** - * Get supplier of context used in training loop step. - * - * @param input Input. - * @param ctx Local context. - * @return Supplier of context used in training loop step. - */ -protected abstract IgniteSupplier remoteContextExtractor(I input, LC ctx); - -
[35/50] [abbrv] ignite git commit: IGNITE-8248 Fixed npe in Web Console agent int case of self-signed certificate.
IGNITE-8248 Fixed npe in Web Console agent int case of self-signed certificate. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8a42f64a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8a42f64a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8a42f64a Branch: refs/heads/ignite-7708 Commit: 8a42f64a38422304f62f263623c4517f469f8ddb Parents: 56e3f43 Author: Andrey NovikovAuthored: Fri Apr 13 18:08:35 2018 +0700 Committer: Andrey Novikov Committed: Fri Apr 13 18:08:35 2018 +0700 -- .../org/apache/ignite/console/agent/AgentLauncher.java | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/8a42f64a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/AgentLauncher.java -- diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/AgentLauncher.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/AgentLauncher.java index 4db26ba..385ce08 100644 --- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/AgentLauncher.java +++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/AgentLauncher.java @@ -32,6 +32,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.UnknownHostException; +import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -122,18 +123,16 @@ public class AgentLauncher { return new TrustManager[] { new X509TrustManager() { /** {@inheritDoc} */ -@Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { -return null; +@Override public X509Certificate[] getAcceptedIssuers() { +return new X509Certificate[0]; } /** {@inheritDoc} */ -@Override public void checkClientTrusted( -java.security.cert.X509Certificate[] certs, String authType) { +@Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } /** {@inheritDoc} */ -@Override public void checkServerTrusted( -java.security.cert.X509Certificate[] certs, String authType) { +@Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } }}; }
[05/50] [abbrv] 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-7708 Commit: 780fc07be0b257b578647682585c89548e6d695d Parents: da77b98 Author: Pavel TupitsynAuthored: 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. */
[28/50] [abbrv] ignite git commit: IGNITE-7983: NPE fixed in transactions
IGNITE-7983: NPE fixed in transactions Signed-off-by: Andrey GuraProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/08a700db Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/08a700db Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/08a700db Branch: refs/heads/ignite-7708 Commit: 08a700db31604d33959e3b5aa3f709dbf66a878b Parents: adaedb4 Author: Andrey Kuznetsov Authored: Thu Apr 12 21:23:28 2018 +0300 Committer: Andrey Gura Committed: Thu Apr 12 21:23:28 2018 +0300 -- .../processors/cache/distributed/near/GridNearTxLocal.java | 9 + 1 file changed, 9 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/08a700db/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java index 33f84f0..fc8a9a3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java @@ -3916,6 +3916,15 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter implements GridTimeou throw new GridClosureException(e); } +if (isRollbackOnly()) { +if (timedOut()) +throw new GridClosureException(new IgniteTxTimeoutCheckedException( +"Transaction has been timed out: " + GridNearTxLocal.this)); +else +throw new GridClosureException(new IgniteTxRollbackCheckedException( +"Transaction has been rolled back: " + GridNearTxLocal.this)); +} + return map; } },
[19/50] [abbrv] ignite git commit: IGNITE-8042: .NET thin client: authentication support. This closes #3790.
IGNITE-8042: .NET thin client: authentication support. This closes #3790. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/67023a88 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/67023a88 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/67023a88 Branch: refs/heads/ignite-7708 Commit: 67023a88b8c9cf647196b6deb1759b4d01e33890 Parents: e333f30 Author: devozerovAuthored: Thu Apr 12 10:37:36 2018 +0300 Committer: devozerov Committed: Thu Apr 12 10:37:36 2018 +0300 -- .../client/ClientAuthenticationException.java | 16 +- .../internal/client/thin/TcpClientChannel.java | 9 +- .../odbc/ClientListenerNioListener.java | 19 +++ .../client/ClientConnectionContext.java | 8 +- .../platform/client/ClientStatus.java | 5 +- .../Client/ClientConnectionTest.cs | 161 +++ .../Client/ClientStatusCode.cs | 12 +- .../Client/IgniteClientConfiguration.cs | 13 ++ .../IgniteClientConfigurationSection.xsd| 10 ++ .../Impl/Client/ClientProtocolVersion.cs| 22 ++- .../Impl/Client/ClientSocket.cs | 85 +- 11 files changed, 329 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/67023a88/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/client/ClientAuthenticationException.java index 0c24db8..526690a 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java +++ b/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java @@ -24,22 +24,10 @@ public class ClientAuthenticationException extends ClientException { /** Serial version uid. */ private static final long serialVersionUID = 0L; -/** Message. */ -private static final String MSG = "Invalid user name or password"; - /** * Default constructor. */ -public ClientAuthenticationException() { -super(MSG); -} - -/** - * Constructs a new exception with the specified cause. - * - * @param cause the cause. - */ -public ClientAuthenticationException(Throwable cause) { -super(MSG, cause); +public ClientAuthenticationException(String msg) { +super(msg); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/67023a88/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java index 8e8294f..10dc865 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java @@ -272,8 +272,13 @@ class TcpClientChannel implements ClientChannel { try (BinaryReaderExImpl r = new BinaryReaderExImpl(null, res, null, true)) { String err = r.readString(); -if (err != null && err.toUpperCase().matches(".*USER.*INCORRECT.*")) -throw new ClientAuthenticationException(); +int errCode = ClientStatus.FAILED; + +if (res.remaining() > 0) +errCode = r.readInt(); + +if (errCode == ClientStatus.AUTH_FAILED) +throw new ClientAuthenticationException(err); else if (ver.equals(srvVer)) throw new ClientProtocolError(err); else if (!supportedVers.contains(srvVer) || http://git-wip-us.apache.org/repos/asf/ignite/blob/67023a88/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java index 53b14d7..407c1a0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java @@ -26,9 +26,11 @@ import org.apache.ignite.internal.binary.BinaryWriterExImpl;
[34/50] [abbrv] ignite git commit: IGNITE-8245 Fixed input appearance position with error.
IGNITE-8245 Fixed input appearance position with error. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/56e3f43e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/56e3f43e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/56e3f43e Branch: refs/heads/ignite-7708 Commit: 56e3f43e8b31d13e3a7cc590208ffe92187ad00d Parents: 5fd5968 Author: Dmitriy ShabalinAuthored: Fri Apr 13 17:55:02 2018 +0700 Committer: Andrey Novikov Committed: Fri Apr 13 17:55:02 2018 +0700 -- .../frontend/app/primitives/form-field/index.scss | 12 1 file changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/56e3f43e/modules/web-console/frontend/app/primitives/form-field/index.scss -- diff --git a/modules/web-console/frontend/app/primitives/form-field/index.scss b/modules/web-console/frontend/app/primitives/form-field/index.scss index 7d9ea1f..1035ade 100644 --- a/modules/web-console/frontend/app/primitives/form-field/index.scss +++ b/modules/web-console/frontend/app/primitives/form-field/index.scss @@ -240,6 +240,18 @@ box-shadow: none; } } + +// Added right offset to appearance of input for invalid password +& > input[type='password'].ng-invalid.ng-touched { +padding-right: 36px; +} + +// Added right offset to appearance of dropdown for invalid data +& > button.select-toggle.ng-invalid.ng-touched { +&:after { +right: 36px; +} +} } &__errors {
[08/50] [abbrv] 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: dpavlovProject: 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-7708 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,
[42/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
IGNITE-8232: ML package cleanup for 2.5 release this closes #3806 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/47cfdc27 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/47cfdc27 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/47cfdc27 Branch: refs/heads/ignite-7708 Commit: 47cfdc27e5079ee0ec91de1539bff498ffc1edc2 Parents: ee9ca06 Author: dmitrievanthonyAuthored: Fri Apr 13 18:08:08 2018 +0300 Committer: Yury Babak Committed: Fri Apr 13 18:08:08 2018 +0300 -- .../examples/ml/nn/MLPTrainerExample.java | 2 +- ...nWithLSQRTrainerAndNormalizationExample.java | 180 - ...dLinearRegressionWithLSQRTrainerExample.java | 169 ...tedLinearRegressionWithQRTrainerExample.java | 137 --- ...edLinearRegressionWithSGDTrainerExample.java | 177 .../LinearRegressionLSQRTrainerExample.java | 169 ...sionLSQRTrainerWithNormalizationExample.java | 180 + .../LinearRegressionSGDTrainerExample.java | 176 .../main/java/org/apache/ignite/ml/Trainer.java | 36 -- .../apache/ignite/ml/estimators/Estimators.java | 50 --- .../ignite/ml/estimators/package-info.java | 22 - .../ml/math/functions/IgniteBiFunction.java | 8 +- .../LinSysPartitionDataBuilderOnHeap.java | 86 .../math/isolve/LinSysPartitionDataOnHeap.java | 65 --- .../ml/math/isolve/lsqr/AbstractLSQR.java | 3 +- .../ignite/ml/math/isolve/lsqr/LSQROnHeap.java | 27 +- .../org/apache/ignite/ml/nn/MLPTrainer.java | 1 - .../apache/ignite/ml/nn/UpdatesStrategy.java| 95 + .../ignite/ml/optimization/GradientDescent.java | 202 -- .../ml/optimization/GradientFunction.java | 31 -- .../LeastSquaresGradientFunction.java | 33 -- .../util/SparseDistributedMatrixMapReducer.java | 84 .../ml/optimization/util/package-info.java | 22 - .../linear/LinearRegressionLSQRTrainer.java | 10 +- .../linear/LinearRegressionQRTrainer.java | 72 .../linear/LinearRegressionSGDTrainer.java | 7 +- .../org/apache/ignite/ml/trainers/Trainer.java | 33 -- .../trainers/group/BaseLocalProcessorJob.java | 146 --- .../ignite/ml/trainers/group/ConstModel.java| 46 --- .../ignite/ml/trainers/group/GroupTrainer.java | 208 -- .../group/GroupTrainerBaseProcessorTask.java| 144 --- .../ml/trainers/group/GroupTrainerCacheKey.java | 125 -- .../group/GroupTrainerEntriesProcessorTask.java | 64 --- .../ml/trainers/group/GroupTrainerInput.java| 37 -- .../group/GroupTrainerKeysProcessorTask.java| 62 --- .../ml/trainers/group/GroupTrainingContext.java | 98 - .../group/LocalEntriesProcessorJob.java | 85 .../trainers/group/LocalKeysProcessorJob.java | 78 .../ignite/ml/trainers/group/Metaoptimizer.java | 93 - .../group/MetaoptimizerDistributedStep.java | 97 - .../group/MetaoptimizerGroupTrainer.java| 132 -- .../ml/trainers/group/ResultAndUpdates.java | 178 .../ml/trainers/group/UpdateStrategies.java | 47 --- .../ml/trainers/group/UpdatesStrategy.java | 95 - .../ignite/ml/trainers/group/chain/Chains.java | 56 --- .../trainers/group/chain/ComputationsChain.java | 246 --- .../chain/DistributedEntryProcessingStep.java | 34 -- .../chain/DistributedKeyProcessingStep.java | 33 -- .../trainers/group/chain/DistributedStep.java | 70 .../trainers/group/chain/EntryAndContext.java | 70 .../trainers/group/chain/HasTrainingUUID.java | 32 -- .../ml/trainers/group/chain/KeyAndContext.java | 67 --- .../ml/trainers/group/chain/package-info.java | 22 - .../ignite/ml/trainers/group/package-info.java | 22 - .../org/apache/ignite/ml/IgniteMLTestSuite.java | 4 - .../ml/math/isolve/lsqr/LSQROnHeapTest.java | 14 +- .../ignite/ml/nn/MLPTrainerIntegrationTest.java | 1 - .../org/apache/ignite/ml/nn/MLPTrainerTest.java | 1 - .../MLPTrainerMnistIntegrationTest.java | 2 +- .../ml/nn/performance/MLPTrainerMnistTest.java | 2 +- .../ml/optimization/GradientDescentTest.java| 64 --- .../ml/optimization/OptimizationTestSuite.java | 33 -- .../SparseDistributedMatrixMapReducerTest.java | 135 --- .../ml/regressions/RegressionsTestSuite.java| 3 - .../linear/ArtificialRegressionDatasets.java| 404 --- ...istributedLinearRegressionQRTrainerTest.java | 36 -- ...istributedLinearRegressionQRTrainerTest.java | 36 -- .../GenericLinearRegressionTrainerTest.java | 206 -- ...wareAbstractLinearRegressionTrainerTest.java | 127 -- .../linear/LinearRegressionSGDTrainerTest.java | 2 +- .../LocalLinearRegressionQRTrainerTest.java | 36 -- .../group/DistributedWorkersChainTest.java
[03/50] [abbrv] 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(); +
[01/50] [abbrv] ignite git commit: IGNITE-8101 Ability to terminate system workers by JMX for test purposes.
Repository: ignite Updated Branches: refs/heads/ignite-7708 83be65ea7 -> eced6a11a IGNITE-8101 Ability to terminate system workers by JMX for test purposes. Signed-off-by: Andrey GuraProject: 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-7708 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;
[43/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup for 2.5 release
IGNITE-8232: ML package cleanup for 2.5 release this closes #3823 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c6ab036d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c6ab036d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c6ab036d Branch: refs/heads/ignite-7708 Commit: c6ab036dcdb5a190b8577c938dbc420ec030c7ad Parents: 47cfdc2 Author: YuriBabakAuthored: Fri Apr 13 20:27:15 2018 +0300 Committer: Yury Babak Committed: Fri Apr 13 20:27:15 2018 +0300 -- .../java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c6ab036d/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java index 45fd035..560be4b 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/IgniteBiFunction.java @@ -27,7 +27,7 @@ import java.util.function.BiFunction; * @see java.util.function.BiFunction */ public interface IgniteBiFunction extends BiFunction , Serializable { -/** {@inheritDoc} */ +/** */ default IgniteBiFunction andThen(IgniteFunction after) { Objects.requireNonNull(after); return (T t, U u) -> after.apply(apply(t, u));
[10/50] [abbrv] ignite git commit: IGNITE-7871 Check local join future on error. - Fixes #3793.
IGNITE-7871 Check local join future on error. - Fixes #3793. Signed-off-by: dpavlovProject: 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-7708 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) -> {
[24/50] [abbrv] ignite git commit: IGNITE-8135: SQL: authentication for CREATE TABLE and DROP TABLE commands. This closes #3801.
IGNITE-8135: SQL: authentication for CREATE TABLE and DROP TABLE commands. This closes #3801. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a57c9e1f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a57c9e1f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a57c9e1f Branch: refs/heads/ignite-7708 Commit: a57c9e1f2a00fea310de5eabba92a642942b9796 Parents: 7a1d0ea Author: devozerovAuthored: Thu Apr 12 15:02:57 2018 +0300 Committer: devozerov Committed: Thu Apr 12 15:02:57 2018 +0300 -- .../apache/ignite/client/ClientException.java | 3 +- .../internal/client/thin/ClientQueryCursor.java | 6 ++- .../platform/client/ClientRequestHandler.java | 7 ++- .../cache/ClientCacheSqlFieldsQueryRequest.java | 19 +-- .../security/SecurityContextHolder.java | 53 .../query/h2/ddl/DdlStatementsProcessor.java| 9 6 files changed, 91 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a57c9e1f/modules/core/src/main/java/org/apache/ignite/client/ClientException.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientException.java b/modules/core/src/main/java/org/apache/ignite/client/ClientException.java index 0555635..b0d9f6c 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientException.java +++ b/modules/core/src/main/java/org/apache/ignite/client/ClientException.java @@ -20,7 +20,7 @@ package org.apache.ignite.client; /** * Common thin client checked exception. */ -public class ClientException extends Exception { +public class ClientException extends RuntimeException { /** Serial version uid. */ private static final long serialVersionUID = 0L; @@ -28,6 +28,7 @@ public class ClientException extends Exception { * Constructs a new exception with {@code null} as its detail message. */ public ClientException() { +// No-op. } /** http://git-wip-us.apache.org/repos/asf/ignite/blob/a57c9e1f/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java index 9367cfd..086fab8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java @@ -54,6 +54,7 @@ class ClientQueryCursor implements QueryCursor { pager.close(); } catch (Exception ignored) { +// No-op. } } @@ -76,7 +77,10 @@ class ClientQueryCursor implements QueryCursor { currPageIt = currPage.iterator(); } catch (ClientException e) { -throw new RuntimeException("Failed to retrieve query results", e); +throw e; +} +catch (Exception e) { +throw new ClientException("Failed to retrieve query results", e); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/a57c9e1f/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java index faa50bc..5ed0d38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java @@ -22,6 +22,7 @@ import org.apache.ignite.internal.processors.authentication.AuthorizationContext import org.apache.ignite.internal.processors.odbc.ClientListenerRequest; import org.apache.ignite.internal.processors.odbc.ClientListenerRequestHandler; import org.apache.ignite.internal.processors.odbc.ClientListenerResponse; +import org.apache.ignite.internal.processors.security.SecurityContextHolder; /** * Thin client request handler. @@ -47,8 +48,10 @@ public class ClientRequestHandler implements ClientListenerRequestHandler { /** {@inheritDoc} */ @Override public ClientListenerResponse handle(ClientListenerRequest req)
[44/50] [abbrv] ignite git commit: IGNITE-2766 - Opportunistically reopen cache after client reconnect - Fixes #3417
IGNITE-2766 - Opportunistically reopen cache after client reconnect - Fixes #3417 Signed-off-by: Valentin KulichenkoProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0991437a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0991437a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0991437a Branch: refs/heads/ignite-7708 Commit: 0991437a3f4d38e68483a8bcadd3daf614b7b2dc Parents: c6ab036 Author: Ilya Kasnacheev Authored: Fri Apr 13 14:48:10 2018 -0700 Committer: Valentin Kulichenko Committed: Fri Apr 13 14:48:10 2018 -0700 -- .../cache/GatewayProtectedCacheProxy.java | 676 --- .../processors/cache/GridCacheGateway.java | 7 + .../processors/cache/IgniteCacheProxyImpl.java | 31 +- .../ignite/spi/discovery/tcp/ClientImpl.java| 6 +- .../IgniteCacheQueryCacheDestroySelfTest.java | 4 + .../ClientReconnectAfterClusterRestartTest.java | 33 +- 6 files changed, 316 insertions(+), 441 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0991437a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java index 27fc395..2e8120b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java @@ -36,6 +36,7 @@ import javax.cache.integration.CompletionListener; import javax.cache.processor.EntryProcessor; import javax.cache.processor.EntryProcessorResult; import org.apache.ignite.IgniteCache; +import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.CacheEntry; import org.apache.ignite.cache.CacheEntryProcessor; import org.apache.ignite.cache.CacheMetrics; @@ -48,6 +49,9 @@ import org.apache.ignite.cache.query.QueryMetrics; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cluster.ClusterGroup; import org.apache.ignite.internal.AsyncSupportAdapter; +import org.apache.ignite.internal.GridKernalState; +import org.apache.ignite.internal.util.future.GridFutureAdapter; +import org.apache.ignite.internal.util.future.IgniteFutureImpl; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.lang.IgniteClosure; @@ -138,15 +142,13 @@ public class GatewayProtectedCacheProxy extends AsyncSupportAdapter withExpiryPolicy(ExpiryPolicy plc) { -GridCacheGateway gate = gate(); - -CacheOperationContext prev = onEnter(gate, opCtx); +CacheOperationGate opGate = onEnter(); try { return new GatewayProtectedCacheProxy<>(delegate, opCtx.withExpiryPolicy(plc), lock); } finally { -onLeave(gate, prev); +onLeave(opGate); } } @@ -157,9 +159,7 @@ public class GatewayProtectedCacheProxy extends AsyncSupportAdapter skipStore() { -GridCacheGateway gate = gate(); - -CacheOperationContext prev = onEnter(gate, opCtx); +CacheOperationGate opGate = onEnter(); try { boolean skip = opCtx.skipStore(); @@ -170,15 +170,13 @@ public class GatewayProtectedCacheProxy extends AsyncSupportAdapter(delegate, opCtx.setSkipStore(true), lock); } finally { -onLeave(gate, prev); +onLeave(opGate); } } /** {@inheritDoc} */ @Override public GatewayProtectedCacheProxy withNoRetries() { -GridCacheGateway gate = gate(); - -CacheOperationContext prev = onEnter(gate, opCtx); +CacheOperationGate opGate = onEnter(); try { boolean noRetries = opCtx.noRetries(); @@ -189,15 +187,13 @@ public class GatewayProtectedCacheProxy extends AsyncSupportAdapter(delegate, opCtx.setNoRetries(true), lock); } finally { -onLeave(gate, prev); +onLeave(opGate); } } /** {@inheritDoc} */ @Override public GatewayProtectedCacheProxy withPartitionRecover() { -GridCacheGateway gate = gate(); - -CacheOperationContext prev = onEnter(gate, opCtx); +CacheOperationGate opGate = onEnter(); try { boolean recovery = opCtx.recovery(); @@ -208,7 +204,7 @@
[37/50] [abbrv] ignite git commit: IGNITE-8233: KNN and SVM algorithms don't work when partition doesn't contain data.
IGNITE-8233: KNN and SVM algorithms don't work when partition doesn't contain data. this closes #3807 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ee9ca06a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ee9ca06a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ee9ca06a Branch: refs/heads/ignite-7708 Commit: ee9ca06a8cbec6eec2b963fb1db1b3f383fc1837 Parents: 568c3e7 Author: dmitrievanthonyAuthored: Fri Apr 13 18:02:37 2018 +0300 Committer: Yury Babak Committed: Fri Apr 13 18:02:37 2018 +0300 -- .../dataset/impl/cache/CacheBasedDataset.java | 14 ++- .../dataset/impl/cache/util/ComputeUtils.java | 9 +- .../ml/dataset/impl/local/LocalDataset.java | 16 ++- .../dataset/impl/local/LocalDatasetBuilder.java | 8 +- .../classification/KNNClassificationModel.java | 32 +++-- .../impl/cache/CacheBasedDatasetTest.java | 9 +- .../ignite/ml/knn/KNNClassificationTest.java| 120 ++ .../apache/ignite/ml/knn/KNNRegressionTest.java | 122 +++ .../ignite/ml/knn/LabeledDatasetHelper.java | 45 ++- .../ignite/ml/knn/LabeledDatasetTest.java | 54 10 files changed, 226 insertions(+), 203 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/ee9ca06a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDataset.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDataset.java b/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDataset.java index 463d496..7428faf 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDataset.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/cache/CacheBasedDataset.java @@ -101,12 +101,16 @@ public class CacheBasedDataset > cursor = upstreamCache.query(qry)) { -return partDataBuilder.build(new UpstreamCursorAdapter<>(cursor.iterator(), cnt), cnt, ctx); + +if (cnt > 0) { +try (QueryCursor > cursor = upstreamCache.query(qry)) { +return partDataBuilder.build(new UpstreamCursorAdapter<>(cursor.iterator(), cnt), cnt, ctx); +} } + +return null; }); } http://git-wip-us.apache.org/repos/asf/ignite/blob/ee9ca06a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/local/LocalDataset.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/local/LocalDataset.java b/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/local/LocalDataset.java index c08b7de..e312b20 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/dataset/impl/local/LocalDataset.java +++
[07/50] [abbrv] 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-7708 Commit: a4653b7c1287a039206bf22e9d85125bb15bc412 Parents: 6557fe6 Author: zaleslawAuthored: 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
[11/50] [abbrv] 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 VinogradovProject: 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-7708 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 =
[29/50] [abbrv] ignite git commit: IGNITE-7691: Provide info about DECIMAL column precision and scale. - Fixes #3691.
IGNITE-7691: Provide info about DECIMAL column precision and scale. - Fixes #3691. Signed-off-by: Nikolay IzhikovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6df5f99b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6df5f99b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6df5f99b Branch: refs/heads/ignite-7708 Commit: 6df5f99bec46d9b0eabd2e623f0d26b32d031e4c Parents: 08a700d Author: Nikolay Izhikov Authored: Fri Apr 13 11:53:50 2018 +0300 Committer: Nikolay Izhikov Committed: Fri Apr 13 11:53:50 2018 +0300 -- .../jdbc/thin/JdbcThinMetadataSelfTest.java | 22 +- .../org/apache/ignite/cache/QueryEntity.java| 41 ++- .../cache/query/annotations/QuerySqlField.java | 16 +- .../internal/client/thin/ClientUtils.java | 38 ++- .../jdbc/thin/JdbcThinDatabaseMetadata.java | 6 +- .../cache/query/QueryEntityTypeDescriptor.java | 21 ++ .../processors/odbc/jdbc/JdbcColumnMeta.java| 14 + .../processors/odbc/jdbc/JdbcColumnMetaV4.java | 90 +++ .../odbc/jdbc/JdbcConnectionContext.java| 4 +- .../odbc/jdbc/JdbcMetaColumnsResultV4.java | 50 .../odbc/jdbc/JdbcRequestHandler.java | 14 +- .../processors/odbc/jdbc/JdbcResult.java| 8 + .../utils/PlatformConfigurationUtils.java | 20 ++ .../processors/query/GridQueryProcessor.java| 2 +- .../processors/query/GridQueryProperty.java | 14 + .../internal/processors/query/QueryField.java | 26 +- .../internal/processors/query/QueryUtils.java | 28 +- .../query/property/QueryBinaryProperty.java | 23 +- .../query/property/QueryClassProperty.java | 10 + .../query/h2/ddl/DdlStatementsProcessor.java| 13 +- .../processors/query/h2/sql/GridSqlColumn.java | 17 +- .../cache/index/IgniteDecimalSelfTest.java | 265 +++ .../h2/GridIndexingSpiAbstractSelfTest.java | 12 +- .../IgniteCacheQuerySelfTestSuite.java | 2 + .../QueryEntityConfigurationParityTest.cs | 5 +- .../Cache/CacheConfigurationTest.cs | 2 + .../Cache/Configuration/QueryEntity.cs | 4 +- .../Cache/Configuration/QueryField.cs | 16 +- .../Configuration/QuerySqlFieldAttribute.cs | 10 + .../IgniteConfigurationSection.xsd | 10 + 30 files changed, 773 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/6df5f99b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java index 4a34be6..cc6790a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.jdbc.thin; import java.io.Serializable; +import java.math.BigDecimal; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; @@ -143,6 +144,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { stmt.execute("CREATE TABLE \"Quoted\" (\"Id\" INT primary key, \"Name\" VARCHAR(50)) WITH WRAP_KEY"); stmt.execute("CREATE INDEX \"MyTestIndex quoted\" on \"Quoted\" (\"Id\" DESC)"); stmt.execute("CREATE INDEX IDX ON TEST (ID ASC)"); +stmt.execute("CREATE TABLE TEST_DECIMAL_COLUMN (ID INT primary key, DEC_COL DECIMAL(8, 3))"); } } @@ -244,7 +246,8 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { "org.ORGANIZATION", "pers.PERSON", "PUBLIC.TEST", -"PUBLIC.Quoted")); +"PUBLIC.Quoted", +"PUBLIC.TEST_DECIMAL_COLUMN")); Set actualTbls = new HashSet<>(expectedTbls.size()); @@ -390,15 +393,25 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest { "PUBLIC.TEST.VAL.null", "PUBLIC.TEST.AGE.21", "PUBLIC.Quoted.Id.null", -"PUBLIC.Quoted.Name.null")); +"PUBLIC.Quoted.Name.null", +"PUBLIC.TEST_DECIMAL_COLUMN.ID.null", +"PUBLIC.TEST_DECIMAL_COLUMN.DEC_COL.null.8.3" +)); Set actualCols = new HashSet<>(expectedCols.size()); while(rs.next()) { +int precision = rs.getInt("COLUMN_SIZE"); + +int scale =
ignite git commit: IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 c43049d4f -> b3f252666 IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b3f25266 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b3f25266 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b3f25266 Branch: refs/heads/ignite-2.5 Commit: b3f252666785fddf41ef07846e034d55ae0dda71 Parents: c43049d Author: Alexey KukushkinAuthored: Mon Apr 16 11:47:19 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:49:37 2018 +0300 -- .../internal/client/thin/ReliableChannel.java | 2 ++ .../apache/ignite/client/FunctionalTest.java| 37 .../org/apache/ignite/client/SecurityTest.java | 22 ++-- 3 files changed, 42 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f25266/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java index 392b8f8..dac4320 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java @@ -81,6 +81,8 @@ final class ReliableChannel implements AutoCloseable { primary = addrs.get(new Random().nextInt(addrs.size())); // we already verified there is at least one address +ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get(); + for (InetSocketAddress a : addrs) if (a != primary) this.backups.add(a); http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f25266/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java index d69ac4d..b49f7e3 100644 --- a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java +++ b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java @@ -39,21 +39,16 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.client.ClientCache; -import org.apache.ignite.client.ClientCacheConfiguration; -import org.apache.ignite.client.Comparers; -import org.apache.ignite.client.Config; -import org.apache.ignite.client.IgniteClient; import org.apache.ignite.configuration.ClientConfiguration; -import org.apache.ignite.client.LocalIgniteCluster; -import org.apache.ignite.client.Person; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Thin client functional tests. @@ -380,6 +375,34 @@ public class FunctionalTest { } } +/** + * Test client fails on start if server is unavailable + */ +@Test +public void testClientFailsOnStart() { +ClientConnectionException expEx = null; + +try (IgniteClient ignored = Ignition.startClient(getClientConfiguration())) { +// No-op. +} +catch (ClientConnectionException connEx) { +expEx = connEx; +} +catch (Exception ex) { +fail(String.format( +"%s expected but %s was received: %s", +ClientConnectionException.class.getName(), +ex.getClass().getName(), +ex +)); +} + +assertNotNull( +String.format("%s expected but no exception was received", ClientConnectionException.class.getName()), +expEx +); +} + /** */ private static ClientConfiguration getClientConfiguration() { return new ClientConfiguration() http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f25266/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java -- diff --git
ignite git commit: IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822.
Repository: ignite Updated Branches: refs/heads/master af2b74215 -> 7586cfd50 IGNITE-8097: Java thin client: throw handshake exception eagerly on connect phase in case of failure. This closes #3822. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7586cfd5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7586cfd5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7586cfd5 Branch: refs/heads/master Commit: 7586cfd50e01fd7d781ad652df23734a7ebeb54d Parents: af2b742 Author: Alexey KukushkinAuthored: Mon Apr 16 11:47:19 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:47:19 2018 +0300 -- .../internal/client/thin/ReliableChannel.java | 2 ++ .../apache/ignite/client/FunctionalTest.java| 37 .../org/apache/ignite/client/SecurityTest.java | 22 ++-- 3 files changed, 42 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java index 392b8f8..dac4320 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java @@ -81,6 +81,8 @@ final class ReliableChannel implements AutoCloseable { primary = addrs.get(new Random().nextInt(addrs.size())); // we already verified there is at least one address +ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get(); + for (InetSocketAddress a : addrs) if (a != primary) this.backups.add(a); http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java index d69ac4d..b49f7e3 100644 --- a/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java +++ b/modules/core/src/test/java/org/apache/ignite/client/FunctionalTest.java @@ -39,21 +39,16 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.client.ClientCache; -import org.apache.ignite.client.ClientCacheConfiguration; -import org.apache.ignite.client.Comparers; -import org.apache.ignite.client.Config; -import org.apache.ignite.client.IgniteClient; import org.apache.ignite.configuration.ClientConfiguration; -import org.apache.ignite.client.LocalIgniteCluster; -import org.apache.ignite.client.Person; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Thin client functional tests. @@ -380,6 +375,34 @@ public class FunctionalTest { } } +/** + * Test client fails on start if server is unavailable + */ +@Test +public void testClientFailsOnStart() { +ClientConnectionException expEx = null; + +try (IgniteClient ignored = Ignition.startClient(getClientConfiguration())) { +// No-op. +} +catch (ClientConnectionException connEx) { +expEx = connEx; +} +catch (Exception ex) { +fail(String.format( +"%s expected but %s was received: %s", +ClientConnectionException.class.getName(), +ex.getClass().getName(), +ex +)); +} + +assertNotNull( +String.format("%s expected but no exception was received", ClientConnectionException.class.getName()), +expEx +); +} + /** */ private static ClientConfiguration getClientConfiguration() { return new ClientConfiguration() http://git-wip-us.apache.org/repos/asf/ignite/blob/7586cfd5/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java -- diff --git
ignite git commit: IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795.
Repository: ignite Updated Branches: refs/heads/ignite-2.5 c51f24651 -> c43049d4f IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c43049d4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c43049d4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c43049d4 Branch: refs/heads/ignite-2.5 Commit: c43049d4fc154e532497320e178d5acb468c15d9 Parents: c51f246 Author: tledkov-gridgainAuthored: Mon Apr 16 11:28:39 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:29:56 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSSLTest.java| 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c43049d4/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java index cc71f51..355a198 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java @@ -164,7 +164,14 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ public void testDefaultContext() throws Exception { +// Store exists default SSL context to restore after test. +final SSLContext dfltSslCtx = SSLContext.getDefault(); + +// Setup default context +SSLContext.setDefault(getTestSslContextFactory().create()); + setSslCtxFactoryToCli = true; + // Factory return default SSL context sslCtxFactory = new Factory() { @Override public SSLContext create() { @@ -177,23 +184,16 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { } }; -System.setProperty("javax.net.ssl.keyStore", CLI_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.keyStorePassword", "123456"); -System.setProperty("javax.net.ssl.trustStore", TRUST_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.trustStorePassword", "123456"); - startGrids(1); try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/?sslMode=require")) { checkConnection(conn); } finally { -System.getProperties().remove("javax.net.ssl.keyStore"); -System.getProperties().remove("javax.net.ssl.keyStorePassword"); -System.getProperties().remove("javax.net.ssl.trustStore"); -System.getProperties().remove("javax.net.ssl.trustStorePassword"); - stopAllGrids(); + +// Restore SSL context. +SSLContext.setDefault(dfltSslCtx); } }
ignite git commit: IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795.
Repository: ignite Updated Branches: refs/heads/master 8cb691743 -> af2b74215 IGNITE-8129: MTCGA: setup default SSL context in JdbcthinConnectionSSLTest (because sometimes default SSL context may be setup by build system). This closes #3795. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/af2b7421 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/af2b7421 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/af2b7421 Branch: refs/heads/master Commit: af2b74215e8b0fc119537c6ba0a35977e0579b24 Parents: 8cb6917 Author: tledkov-gridgainAuthored: Mon Apr 16 11:28:39 2018 +0300 Committer: devozerov Committed: Mon Apr 16 11:28:39 2018 +0300 -- .../jdbc/thin/JdbcThinConnectionSSLTest.java| 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/af2b7421/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java -- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java index cc71f51..355a198 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java @@ -164,7 +164,14 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { * @throws Exception If failed. */ public void testDefaultContext() throws Exception { +// Store exists default SSL context to restore after test. +final SSLContext dfltSslCtx = SSLContext.getDefault(); + +// Setup default context +SSLContext.setDefault(getTestSslContextFactory().create()); + setSslCtxFactoryToCli = true; + // Factory return default SSL context sslCtxFactory = new Factory() { @Override public SSLContext create() { @@ -177,23 +184,16 @@ public class JdbcThinConnectionSSLTest extends JdbcThinAbstractSelfTest { } }; -System.setProperty("javax.net.ssl.keyStore", CLI_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.keyStorePassword", "123456"); -System.setProperty("javax.net.ssl.trustStore", TRUST_KEY_STORE_PATH); -System.setProperty("javax.net.ssl.trustStorePassword", "123456"); - startGrids(1); try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/?sslMode=require")) { checkConnection(conn); } finally { -System.getProperties().remove("javax.net.ssl.keyStore"); -System.getProperties().remove("javax.net.ssl.keyStorePassword"); -System.getProperties().remove("javax.net.ssl.trustStore"); -System.getProperties().remove("javax.net.ssl.trustStorePassword"); - stopAllGrids(); + +// Restore SSL context. +SSLContext.setDefault(dfltSslCtx); } }