ignite git commit: zk
Repository: ignite Updated Branches: refs/heads/ignite-zk-alpha f6fb5603b -> adf77174e zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/adf77174 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/adf77174 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/adf77174 Branch: refs/heads/ignite-zk-alpha Commit: adf77174e39af4cd43a0b1f0ae3761de810ee404 Parents: f6fb560 Author: sboikovAuthored: Fri Dec 8 10:16:24 2017 +0300 Committer: sboikov Committed: Fri Dec 8 10:16:24 2017 +0300 -- .../org/apache/ignite/internal/IgnitionEx.java | 74 1 file changed, 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/adf77174/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 0202b1b..d84f8a9 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 @@ -44,8 +44,6 @@ import java.util.logging.Handler; import javax.management.JMException; import javax.management.MBeanServer; import javax.management.ObjectName; -import org.apache.curator.test.InstanceSpec; -import org.apache.curator.test.TestingCluster; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; @@ -103,7 +101,6 @@ import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.deployment.local.LocalDeploymentSpi; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder; -import org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpi; import org.apache.ignite.spi.eventstorage.NoopEventStorageSpi; import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi; import org.apache.ignite.spi.indexing.noop.NoopIndexingSpi; @@ -155,67 +152,6 @@ import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.RESTART_J * GridConfiguration cfg = new GridConfiguration(); */ public class IgnitionEx { -/** */ -// TODO ZK -public static volatile boolean TEST_ZK = IgniteSystemProperties.getBoolean("TEST_ZK", false); - -/** */ -public static TestingCluster zkCluster; - -synchronized static void startZk() { -if (TEST_ZK && zkCluster == null) { -System.out.println("Start ZK cluster for tests"); - -zkCluster = createTestingCluster(1); - -try { -System.setProperty("zookeeper.forceSync", "false"); -zkCluster.start(); - -System.out.println("ZK cluster started: " + zkCluster.getConnectString()); -} -catch (Exception e) { -e.printStackTrace(); -} -} -} - -private static TestingCluster createTestingCluster(int instances) { -String tmpDir = System.getProperty("java.io.tmpdir"); - -List specs = new ArrayList<>(); - -for (int i = 0; i < instances; i++) { -File file = new File(tmpDir, "apacheIgniteTestZk-" + i); - -if (file.isDirectory()) -deleteRecursively0(file); -else { -if (!file.mkdirs()) -throw new IgniteException("Failed to create directory for test Zookeeper server: " + file.getAbsolutePath()); -} - - -specs.add(new InstanceSpec(file, -1, -1, -1, true, -1, -1, 500)); -} - -return new TestingCluster(specs); -} - -private static void deleteRecursively0(File file) { -File[] files = file.listFiles(); - -if (files == null) -return; - -for (File f : files) { -if (f.isDirectory()) -deleteRecursively0(f); -else -f.delete(); -} -} - /** Default configuration path relative to Ignite home. */ public static final String DFLT_CFG = "config/default-config.xml"; @@ -2285,16 +2221,6 @@ public class IgnitionEx { initializeDataStorageConfiguration(myCfg); -if (TEST_ZK) { -startZk(); - -ZookeeperDiscoverySpi zkSpi = new ZookeeperDiscoverySpi(); - -zkSpi.setZkConnectionString(zkCluster.getConnectString()); - -myCfg.setDiscoverySpi(zkSpi); -} - return myCfg; }
[1/2] ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-zk
Repository: ignite Updated Branches: refs/heads/ignite-zk-alpha [created] f6fb5603b Merge remote-tracking branch 'remotes/origin/master' into ignite-zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2ffdd076 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2ffdd076 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2ffdd076 Branch: refs/heads/ignite-zk-alpha Commit: 2ffdd0761b9bdab38410a7abae691db952a3a786 Parents: f50c7cc a7893b6 Author: sboikovAuthored: Fri Dec 8 10:02:01 2017 +0300 Committer: sboikov Committed: Fri Dec 8 10:02:01 2017 +0300 -- .../clustering/DatasetWithObviousStructure.java | 105 + .../KMeansDistributedClustererExample.java | 95 + .../clustering/KMeansLocalClustererExample.java | 106 + .../examples/ml/clustering/package-info.java|2 +- .../decompositions/QRDecompositionExample.java | 82 + .../DistributedRegressionExample.java | 149 -- .../examples/ml/math/trees/MNISTExample.java| 261 --- .../examples/ml/math/trees/package-info.java| 22 - .../apache/ignite/examples/ml/package-info.java | 22 + .../DistributedRegressionExample.java | 149 ++ .../DistributedRegressionModelExample.java | 134 ++ .../examples/ml/regression/package-info.java| 22 + .../ignite/examples/ml/trees/MNISTExample.java | 261 +++ .../ignite/examples/ml/trees/package-info.java | 22 + modules/compatibility/pom.xml | 11 + .../apache/ignite/internal/GridLoggerProxy.java |9 + .../apache/ignite/internal/IgniteKernal.java| 13 + .../logger/platform/PlatformLogger.java | 15 + .../processors/cache/ClusterCachesInfo.java |8 +- .../AtomicDataStructureProxy.java | 16 +- .../ignite/internal/visor/cache/VisorCache.java | 94 +- .../node/VisorExecutorServiceConfiguration.java | 18 +- .../visor/node/VisorNodeDataCollectorJob.java |9 +- .../node/VisorNodeDataCollectorTaskArg.java | 47 +- .../internal/visor/query/VisorQueryTaskArg.java |2 +- .../internal/visor/util/VisorTaskUtils.java | 139 ++ .../org/apache/ignite/logger/NullLogger.java|6 + .../apache/ignite/logger/java/JavaLogger.java | 17 + .../sharedfs/TcpDiscoverySharedFsIpFinder.java | 34 +- .../processors/cache/CacheComparatorTest.java | 48 + ...ionedAtomicQueueCreateMultiNodeSelfTest.java |4 - ...PartitionedQueueCreateMultiNodeSelfTest.java |2 - .../ignite/logger/java/JavaLoggerTest.java |5 + .../junits/logger/GridTestLog4jLogger.java | 21 +- .../testsuites/IgniteCacheTestSuite2.java |3 + .../ignite/development/utils/package-info.java | 22 + .../cache/index/AbstractSchemaSelfTest.java | 18 + modules/kubernetes/config/example-kube.xml |2 +- .../apache/ignite/logger/log4j/Log4JLogger.java | 40 +- .../log4j/GridLog4jCorrectFileNameTest.java | 13 + .../logger/log4j/GridLog4jInitializedTest.java |7 +- .../logger/log4j/GridLog4jLoggingFileTest.java | 13 +- .../logger/log4j/GridLog4jLoggingPathTest.java | 12 +- .../logger/log4j/GridLog4jLoggingUrlTest.java | 15 +- .../log4j/GridLog4jNotInitializedTest.java |5 + .../ignite/testsuites/IgniteLog4jTestSuite.java |6 + .../ignite/logger/log4j2/Log4J2Logger.java | 20 +- .../logger/log4j2/Log4j2LoggerSelfTest.java | 19 +- .../ml/math/decompositions/QRDSolver.java | 197 ++ .../ml/math/decompositions/QRDecomposition.java | 54 +- .../AbstractMultipleLinearRegression.java | 20 + .../OLSMultipleLinearRegression.java| 41 +- .../OLSMultipleLinearRegressionModel.java | 77 + .../OLSMultipleLinearRegressionModelFormat.java | 46 + .../OLSMultipleLinearRegressionTrainer.java | 62 + .../columnbased/caches/package-info.java| 22 + .../org/apache/ignite/ml/util/package-info.java | 22 + .../org/apache/ignite/ml/IgniteMLTestSuite.java |3 +- .../org/apache/ignite/ml/LocalModelsTest.java | 99 +- ...KMeansDistributedClustererTestMultiNode.java | 15 +- ...MeansDistributedClustererTestSingleNode.java | 15 +- .../apache/ignite/ml/clustering/KMeansUtil.java |6 +- .../ignite/ml/math/MathImplLocalTestSuite.java |2 + .../ml/math/decompositions/QRDSolverTest.java | 87 + ...tedBlockOLSMultipleLinearRegressionTest.java | 38 +- ...tributedOLSMultipleLinearRegressionTest.java | 38 +- .../OLSMultipleLinearRegressionModelTest.java | 53 + .../ml/regressions/RegressionsTestSuite.java|5 +- .../Apache.Ignite.Benchmarks.csproj |2 + .../Interop/PlatformBenchmarkBase.cs| 21 + .../ThinClient/ThinClientGetBenchmark.cs| 63 + .../ThinClient/ThinClientPutBenchmark.cs| 59 +
[2/2] ignite git commit: zk
zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f6fb5603 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f6fb5603 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f6fb5603 Branch: refs/heads/ignite-zk-alpha Commit: f6fb5603bb9565b9e1067354c069624d5a379007 Parents: 2ffdd07 Author: sboikovAuthored: Fri Dec 8 10:09:01 2017 +0300 Committer: sboikov Committed: Fri Dec 8 10:09:01 2017 +0300 -- .../ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java| 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f6fb5603/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java index 2e97aed..91d5fdd 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java @@ -706,6 +706,7 @@ public class ZookeeperDiscoveryImpl { ", instanceName=" + locNode.attribute(IgniteNodeAttributes.ATTR_IGNITE_INSTANCE_NAME) + ", joinDataSize=" + joinDataBytes.length + ", joinDataPartCnt=" + rtState.joinDataPartCnt + +", consistentId=" + locNode.consistentId() + ", initTime=" + (System.currentTimeMillis() - startTime) + ", nodePath=" + rtState.locNodeZkPath + ']');
ignite git commit: IGNITE-6373: Create example for local and distributed k-means algorithm
Repository: ignite Updated Branches: refs/heads/master 1f63b8115 -> a7893b630 IGNITE-6373: Create example for local and distributed k-means algorithm this closes #3173 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7893b63 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7893b63 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7893b63 Branch: refs/heads/master Commit: a7893b6307bc752d7b7f1432967a964f30716858 Parents: 1f63b81 Author: Oleg IgnatenkoAuthored: Thu Dec 7 20:34:14 2017 +0300 Committer: Yury Babak Committed: Thu Dec 7 20:34:14 2017 +0300 -- .../clustering/DatasetWithObviousStructure.java | 105 ++ .../KMeansDistributedClustererExample.java | 95 + .../clustering/KMeansLocalClustererExample.java | 106 +++ .../examples/ml/clustering/package-info.java| 2 +- ...KMeansDistributedClustererTestMultiNode.java | 15 +-- ...MeansDistributedClustererTestSingleNode.java | 15 +-- .../apache/ignite/ml/clustering/KMeansUtil.java | 6 +- 7 files changed, 326 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a7893b63/examples/src/main/ml/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java -- diff --git a/examples/src/main/ml/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java b/examples/src/main/ml/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java new file mode 100644 index 000..5cd0e09 --- /dev/null +++ b/examples/src/main/ml/org/apache/ignite/examples/ml/clustering/DatasetWithObviousStructure.java @@ -0,0 +1,105 @@ +/* + * 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 org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; + +/** + * See KMeansDistributedClustererTestSingleNode#testClusterizationOnDatasetWithObviousStructure. + */ +class DatasetWithObviousStructure { +/** */ +private final Random rnd = new Random(123456L); + +/** Let centers be in the vertices of square. */ +private final Map centers = new HashMap<>(); + +/** Square side length. */ +private final int squareSideLen; + +/** */ +DatasetWithObviousStructure(int squareSideLen) { +this.squareSideLen = squareSideLen; +centers.put(100, new DenseLocalOnHeapVector(new double[] {0.0, 0.0})); +centers.put(900, new DenseLocalOnHeapVector(new double[] {squareSideLen, 0.0})); +centers.put(3000, new DenseLocalOnHeapVector(new double[] {0.0, squareSideLen})); +centers.put(6000, new DenseLocalOnHeapVector(new double[] {squareSideLen, squareSideLen})); +} + +/** */ +List generate(Matrix points) { +int ptsCnt = points.rowSize(); + +// Mass centers of dataset. +List massCenters = new ArrayList<>(); + +int centersCnt = centers.size(); + +List permutation = IntStream.range(0, ptsCnt).boxed().collect(Collectors.toList()); +Collections.shuffle(permutation, rnd); + +Vector[] mc = new Vector[centersCnt]; +Arrays.fill(mc, VectorUtils.zeroes(2)); + +int totalCnt = 0; + +int centIdx = 0; +massCenters.clear(); + +for (Integer count : centers.keySet()) { +for (int i = 0; i < count; i++) { +Vector pnt = getPoint(count); + +mc[centIdx] = mc[centIdx].plus(pnt); + +
ignite git commit: IGNITE-7110: Javadoc package descriptions missed for ML
Repository: ignite Updated Branches: refs/heads/master e39283e88 -> 1f63b8115 IGNITE-7110: Javadoc package descriptions missed for ML this closes #3174 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1f63b811 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1f63b811 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1f63b811 Branch: refs/heads/master Commit: 1f63b8115127c0ea38430c85bf9fc7a1d85ca210 Parents: e39283e Author: YuriBabakAuthored: Thu Dec 7 19:33:27 2017 +0300 Committer: Yury Babak Committed: Thu Dec 7 19:33:27 2017 +0300 -- .../ignite/development/utils/package-info.java | 22 .../columnbased/caches/package-info.java| 22 .../org/apache/ignite/ml/util/package-info.java | 22 3 files changed, 66 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1f63b811/modules/dev-utils/src/main/java/org/apache/ignite/development/utils/package-info.java -- diff --git a/modules/dev-utils/src/main/java/org/apache/ignite/development/utils/package-info.java b/modules/dev-utils/src/main/java/org/apache/ignite/development/utils/package-info.java new file mode 100644 index 000..d9018ed --- /dev/null +++ b/modules/dev-utils/src/main/java/org/apache/ignite/development/utils/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * + * Contains converter for WAL logs. + */ +package org.apache.ignite.development.utils; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/1f63b811/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/caches/package-info.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/caches/package-info.java b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/caches/package-info.java new file mode 100644 index 000..0a488ab --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/trees/trainers/columnbased/caches/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * + * Contains cache configurations for columnbased decision tree trainer with some related logic. + */ +package org.apache.ignite.ml.trees.trainers.columnbased.caches; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/1f63b811/modules/ml/src/main/java/org/apache/ignite/ml/util/package-info.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/util/package-info.java b/modules/ml/src/main/java/org/apache/ignite/ml/util/package-info.java new file mode 100644 index 000..cc0d4bf --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/util/package-info.java @@ -0,0 +1,22 @@ +/* + * 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
ignite git commit: IGNITE-7008 TcpDiscoverySharedFsIpFinder fails with NPE if address can't be resolved. This closes #3087.
Repository: ignite Updated Branches: refs/heads/master c5c512e46 -> e39283e88 IGNITE-7008 TcpDiscoverySharedFsIpFinder fails with NPE if address can't be resolved. This closes #3087. Signed-off-by: nikolay_tikhonovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e39283e8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e39283e8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e39283e8 Branch: refs/heads/master Commit: e39283e88d5948ebfe1d8a166e3ed74a9304b7b2 Parents: c5c512e Author: Andrey V. Mashenkov Authored: Thu Dec 7 19:16:25 2017 +0300 Committer: nikolay_tikhonov Committed: Thu Dec 7 19:17:56 2017 +0300 -- .../sharedfs/TcpDiscoverySharedFsIpFinder.java | 34 +--- 1 file changed, 15 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e39283e8/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java index a30309c..397af1a 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java @@ -186,29 +186,24 @@ public class TcpDiscoverySharedFsIpFinder extends TcpDiscoveryIpFinderAdapter { Collection addrs = new LinkedList<>(); -for (String fileName : folder.list()) -if (!".svn".equals(fileName)) { -InetSocketAddress addr = null; +for (String fileName : folder.list()) { +StringTokenizer st = new StringTokenizer(fileName, DELIM); -StringTokenizer st = new StringTokenizer(fileName, DELIM); +if (st.countTokens() != 2) +continue; -if (st.countTokens() == 2) { -String addrStr = st.nextToken(); -String portStr = st.nextToken(); +String addrStr = st.nextToken(); +String portStr = st.nextToken(); -try { -int port = Integer.parseInt(portStr); - -addr = new InetSocketAddress(denormalizeAddress(addrStr), port); -} -catch (IllegalArgumentException e) { -U.error(log, "Failed to parse file entry: " + fileName, e); -} -} +try { +int port = Integer.parseInt(portStr); -if (addr != null) -addrs.add(addr); +addrs.add(new InetSocketAddress(denormalizeAddress(addrStr), port)); } +catch (IllegalArgumentException e) { +U.error(log, "Failed to parse file entry: " + fileName, e); +} +} return Collections.unmodifiableCollection(addrs); } @@ -277,7 +272,8 @@ public class TcpDiscoverySharedFsIpFinder extends TcpDiscoveryIpFinderAdapter { SB sb = new SB(); -sb.a(normalizeAddress(addr.getAddress().getHostAddress())) +// There is no need to normalize hostname as DNS name specification doesn't allow ':' and '_' chars. +sb.a(addr.isUnresolved() ? addr.getHostName() : normalizeAddress(addr.getAddress().getHostAddress())) .a(DELIM) .a(addr.getPort());
[2/2] ignite git commit: IGNITE-6872: Linear regression should implement Model API
IGNITE-6872: Linear regression should implement Model API This closes #3168 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c5c512e4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c5c512e4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c5c512e4 Branch: refs/heads/master Commit: c5c512e460140c91fb77b527ff909ddbe3d1fd72 Parents: bbeb205 Author: Oleg IgnatenkoAuthored: Thu Dec 7 18:14:51 2017 +0300 Committer: Yury Babak Committed: Thu Dec 7 18:14:51 2017 +0300 -- .../decompositions/QRDecompositionExample.java | 82 ++ .../DistributedRegressionExample.java | 149 --- .../examples/ml/math/trees/MNISTExample.java| 261 --- .../examples/ml/math/trees/package-info.java| 22 -- .../apache/ignite/examples/ml/package-info.java | 22 ++ .../DistributedRegressionExample.java | 149 +++ .../DistributedRegressionModelExample.java | 134 ++ .../examples/ml/regression/package-info.java| 22 ++ .../ignite/examples/ml/trees/MNISTExample.java | 261 +++ .../ignite/examples/ml/trees/package-info.java | 22 ++ .../ml/math/decompositions/QRDSolver.java | 197 ++ .../ml/math/decompositions/QRDecomposition.java | 54 +--- .../AbstractMultipleLinearRegression.java | 20 ++ .../OLSMultipleLinearRegression.java| 41 +-- .../OLSMultipleLinearRegressionModel.java | 77 ++ .../OLSMultipleLinearRegressionModelFormat.java | 46 .../OLSMultipleLinearRegressionTrainer.java | 62 + .../org/apache/ignite/ml/IgniteMLTestSuite.java | 3 +- .../org/apache/ignite/ml/LocalModelsTest.java | 99 +-- .../ignite/ml/math/MathImplLocalTestSuite.java | 2 + .../ml/math/decompositions/QRDSolverTest.java | 87 +++ ...tedBlockOLSMultipleLinearRegressionTest.java | 38 ++- ...tributedOLSMultipleLinearRegressionTest.java | 38 ++- .../OLSMultipleLinearRegressionModelTest.java | 53 .../ml/regressions/RegressionsTestSuite.java| 5 +- 25 files changed, 1371 insertions(+), 575 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c5c512e4/examples/src/main/ml/org/apache/ignite/examples/ml/math/decompositions/QRDecompositionExample.java -- diff --git a/examples/src/main/ml/org/apache/ignite/examples/ml/math/decompositions/QRDecompositionExample.java b/examples/src/main/ml/org/apache/ignite/examples/ml/math/decompositions/QRDecompositionExample.java new file mode 100644 index 000..bed99d1 --- /dev/null +++ b/examples/src/main/ml/org/apache/ignite/examples/ml/math/decompositions/QRDecompositionExample.java @@ -0,0 +1,82 @@ +/* + * 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.math.decompositions; + +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Tracer; +import org.apache.ignite.ml.math.decompositions.QRDecomposition; +import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix; + +/** + * Example of using {@link QRDecomposition}. + */ +public class QRDecompositionExample { +/** + * Executes example. + * + * @param args Command line arguments, none required. + */ +public static void main(String[] args) { +System.out.println(">>> QR decomposition example started."); +Matrix m = new DenseLocalOnHeapMatrix(new double[][] { +{2.0d, -1.0d, 0.0d}, +{-1.0d, 2.0d, -1.0d}, +{0.0d, -1.0d, 2.0d} +}); + +System.out.println("\n>>> Input matrix:"); +Tracer.showAscii(m); + +QRDecomposition dec = new QRDecomposition(m); +System.out.println("\n>>> Value for full rank in decomposition: [" + dec.hasFullRank() + "]."); + +Matrix q = dec.getQ(); +Matrix r = dec.getR(); + +System.out.println("\n>>> Orthogonal matrix Q:"); +Tracer.showAscii(q);
[1/2] ignite git commit: IGNITE-6872: Linear regression should implement Model API
Repository: ignite Updated Branches: refs/heads/master bbeb20508 -> c5c512e46 http://git-wip-us.apache.org/repos/asf/ignite/blob/c5c512e4/modules/ml/src/test/java/org/apache/ignite/ml/LocalModelsTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/LocalModelsTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/LocalModelsTest.java index acc5649..d0d1247 100644 --- a/modules/ml/src/test/java/org/apache/ignite/ml/LocalModelsTest.java +++ b/modules/ml/src/test/java/org/apache/ignite/ml/LocalModelsTest.java @@ -20,12 +20,14 @@ package org.apache.ignite.ml; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; +import java.util.function.Function; import org.apache.ignite.ml.clustering.KMeansLocalClusterer; import org.apache.ignite.ml.clustering.KMeansModel; import org.apache.ignite.ml.math.EuclideanDistance; import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix; -import org.junit.After; +import org.apache.ignite.ml.regressions.OLSMultipleLinearRegressionModel; +import org.apache.ignite.ml.regressions.OLSMultipleLinearRegressionModelFormat; +import org.apache.ignite.ml.regressions.OLSMultipleLinearRegressionTrainer; import org.junit.Assert; import org.junit.Test; @@ -34,39 +36,68 @@ import org.junit.Test; */ public class LocalModelsTest { /** */ -private String mdlFilePath = "model.mlmod"; - -/** - * - */ -@After -public void cleanUp() throws IOException { -Files.deleteIfExists(Paths.get(mdlFilePath)); +@Test +public void importExportKMeansModelTest() throws IOException { +executeModelTest(mdlFilePath -> { +KMeansModel mdl = getClusterModel(); + +Exporterexporter = new FileExporter<>(); + +mdl.saveModel(exporter, mdlFilePath); + +KMeansModelFormat load = exporter.load(mdlFilePath); + +Assert.assertNotNull(load); + +KMeansModel importedMdl = new KMeansModel(load.getCenters(), load.getDistance()); + +Assert.assertTrue("", mdl.equals(importedMdl)); + +return null; +}); } -/** - * - */ +/** */ @Test -public void importExportKMeansModelTest() { -Path mdlPath = Paths.get(mdlFilePath); +public void importExportOLSMultipleLinearRegressionModelTest() throws IOException { +executeModelTest(mdlFilePath -> { +OLSMultipleLinearRegressionModel mdl = getAbstractMultipleLinearRegressionModel(); + +Exporter exporter = new FileExporter<>(); -KMeansModel mdl = getClusterModel(); +mdl.saveModel(exporter, mdlFilePath); -Exporter exporter = new FileExporter<>(); -mdl.saveModel(exporter, mdlFilePath); +OLSMultipleLinearRegressionModelFormat load = exporter.load(mdlFilePath); -Assert.assertTrue(String.format("File %s not found.", mdlPath.toString()), Files.exists(mdlPath)); +Assert.assertNotNull(load); -KMeansModelFormat load = exporter.load(mdlFilePath); -KMeansModel importedMdl = new KMeansModel(load.getCenters(), load.getDistance()); +OLSMultipleLinearRegressionModel importedMdl = load.getOLSMultipleLinearRegressionModel(); -Assert.assertTrue("", mdl.equals(importedMdl)); +Assert.assertTrue("", mdl.equals(importedMdl)); + +return null; +}); } -/** - * - */ +/** */ +private void executeModelTest(Function code) throws IOException { +Path mdlPath = Files.createTempFile(null, null); + +Assert.assertNotNull(mdlPath); + +try { +String mdlFilePath = mdlPath.toAbsolutePath().toString(); + +Assert.assertTrue(String.format("File %s not found.", mdlFilePath), Files.exists(mdlPath)); + +code.apply(mdlFilePath); +} +finally { +Files.deleteIfExists(mdlPath); +} +} + +/** */ private KMeansModel getClusterModel() { KMeansLocalClusterer clusterer = new KMeansLocalClusterer(new EuclideanDistance(), 1, 1L); @@ -77,4 +108,22 @@ public class LocalModelsTest { return clusterer.cluster(points, 1); } + +/** */ +private OLSMultipleLinearRegressionModel getAbstractMultipleLinearRegressionModel() { +double[] data = new double[] { +0, 0, 0, 0, 0, 0, // IMPL NOTE values in this row are later replaced (with 1.0) +0, 2.0, 0, 0, 0, 0, +0, 0, 3.0, 0, 0, 0, +0, 0, 0, 4.0, 0, 0, +0, 0, 0, 0, 5.0, 0, +0, 0, 0, 0, 0, 6.0}; + +final int nobs = 6, nvars = 5; + +OLSMultipleLinearRegressionTrainer trainer += new
[4/5] ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-zk
Merge remote-tracking branch 'remotes/origin/master' into ignite-zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c0dfb208 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c0dfb208 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c0dfb208 Branch: refs/heads/ignite-zk Commit: c0dfb208dd84544941b843ad5f01c772455ba9b0 Parents: a11e06a e15cbcc Author: sboikovAuthored: Thu Dec 7 12:54:05 2017 +0300 Committer: sboikov Committed: Thu Dec 7 12:54:05 2017 +0300 -- .../ignite/internal/GridJobExecuteRequest.java | 133 +++ .../ignite/internal/GridTaskSessionImpl.java| 18 ++ .../ignite/internal/IgniteComputeImpl.java | 8 +- .../processors/job/GridJobProcessor.java| 8 + .../session/GridTaskSessionProcessor.java | 6 + .../processors/task/GridTaskProcessor.java | 15 +- .../task/GridTaskThreadContextKey.java | 3 + .../processors/task/GridTaskWorker.java | 2 + .../internal/GridJobStealingSelfTest.java | 7 +- .../GridMultithreadedJobStealingSelfTest.java | 176 ++ .../Examples/Example.cs | 7 +- .../ProjectFilesTest.cs | 2 +- modules/platforms/dotnet/examples/README.txt| 2 + .../dotnetcore/Apache.Ignite.Examples.csproj| 29 +++ .../dotnet/examples/dotnetcore/App.config | 41 .../dotnet/examples/dotnetcore/Employee.cs | 67 ++ .../dotnet/examples/dotnetcore/LinqExample.cs | 239 +++ .../dotnet/examples/dotnetcore/Organization.cs | 58 + .../dotnet/examples/dotnetcore/Program.cs | 109 + .../dotnet/examples/dotnetcore/PutGetExample.cs | 122 ++ .../dotnet/examples/dotnetcore/README.txt | 8 + .../dotnet/examples/dotnetcore/SqlExample.cs| 191 +++ .../dotnet/run-dotnetcore-examples.bat | 27 +++ 23 files changed, 1182 insertions(+), 96 deletions(-) --
[5/5] ignite git commit: zk
zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f50c7ccb Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f50c7ccb Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f50c7ccb Branch: refs/heads/ignite-zk Commit: f50c7ccb5e80731426446c2051231fd55c912d23 Parents: c0dfb20 Author: sboikovAuthored: Thu Dec 7 13:49:16 2017 +0300 Committer: sboikov Committed: Thu Dec 7 15:49:31 2017 +0300 -- .../GridCachePartitionExchangeManager.java | 2 +- .../communication/tcp/TcpCommunicationSpi.java | 7 + .../spi/discovery/zk/ZookeeperDiscoverySpi.java | 32 +--- .../discovery/zk/internal/ZookeeperClient.java | 4 ++- .../zk/internal/ZookeeperDiscoveryImpl.java | 5 +-- .../ignite/internal/GridDiscoverySelfTest.java | 5 +-- .../internal/GridSameVmStartupSelfTest.java | 19 +--- .../binary/BinaryMetadataUpdatesFlowTest.java | 6 8 files changed, 64 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f50c7ccb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index 30d3d26..4f481fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -413,7 +413,7 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana if (evt.type() != EVT_DISCOVERY_CUSTOM_EVT) { assert evt.type() != EVT_NODE_JOINED || n.isLocal() || n.order() > loc.order() : "Node joined with smaller-than-local " + -"order [newOrder=" + n.order() + ", locOrder=" + loc.order() + ']'; +"order [newOrder=" + n.order() + ", locOrder=" + loc.order() + ", evt=" + evt + ']'; exchId = exchangeId(n.id(), affinityTopologyVersion(evt), evt); http://git-wip-us.apache.org/repos/asf/ignite/blob/f50c7ccb/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 662a2b9..e03e2cf 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -2100,6 +2100,13 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati } } +/** + * @return Bound TCP server port. + */ +public int boundPort() { +return boundTcpPort; +} + /** {@inheritDoc} */ @Override public void spiStart(String igniteInstanceName) throws IgniteSpiException { assert locHost != null; http://git-wip-us.apache.org/repos/asf/ignite/blob/f50c7ccb/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java index bd7f427..b9c2431 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java @@ -32,6 +32,7 @@ import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi; import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; +import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; @@ -42,6 +43,7 @@ import org.apache.ignite.spi.IgniteSpiConfiguration; import org.apache.ignite.spi.IgniteSpiContext; import org.apache.ignite.spi.IgniteSpiException; import
[1/5] ignite git commit: ignite-1267 Fixed job stealing so that newly joined node is able to steal jobs
Repository: ignite Updated Branches: refs/heads/ignite-zk a11e06a5b -> f50c7ccb5 ignite-1267 Fixed job stealing so that newly joined node is able to steal jobs Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/24f90874 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/24f90874 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/24f90874 Branch: refs/heads/ignite-zk Commit: 24f908748b6d284eac0a2795366e80d9e06e19ff Parents: ff3712c Author: Andrey V. MashenkovAuthored: Tue Dec 5 10:22:50 2017 +0300 Committer: sboikov Committed: Tue Dec 5 10:22:50 2017 +0300 -- .../ignite/internal/GridJobExecuteRequest.java | 133 +- .../ignite/internal/GridTaskSessionImpl.java| 18 ++ .../ignite/internal/IgniteComputeImpl.java | 8 +- .../processors/job/GridJobProcessor.java| 8 + .../session/GridTaskSessionProcessor.java | 6 + .../processors/task/GridTaskProcessor.java | 15 +- .../task/GridTaskThreadContextKey.java | 3 + .../processors/task/GridTaskWorker.java | 2 + .../internal/GridJobStealingSelfTest.java | 7 +- .../GridMultithreadedJobStealingSelfTest.java | 176 ++- 10 files changed, 283 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/24f90874/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java index fe2d6d8..4357d1d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java @@ -23,6 +23,7 @@ import java.nio.ByteBuffer; import java.util.Collection; import java.util.Map; import java.util.UUID; +import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.compute.ComputeJob; import org.apache.ignite.compute.ComputeJobSibling; import org.apache.ignite.configuration.DeploymentMode; @@ -31,6 +32,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType; import org.apache.ignite.plugin.extensions.communication.MessageReader; @@ -137,6 +139,13 @@ public class GridJobExecuteRequest implements ExecutorAwareMessage { private Collection top; /** */ +@GridDirectTransient +private IgnitePredicate topPred; + +/** */ +private byte[] topPredBytes; + +/** */ private int[] idsOfCaches; /** */ @@ -166,6 +175,8 @@ public class GridJobExecuteRequest implements ExecutorAwareMessage { * @param startTaskTime Task execution start time. * @param timeout Task execution timeout. * @param top Topology. + * @param topPred Topology predicate. + * @param topPredBytes Marshalled topology predicate. * @param siblingsBytes Serialized collection of split siblings. * @param siblings Collection of split siblings. * @param sesAttrsBytes Map of session attributes. @@ -197,6 +208,8 @@ public class GridJobExecuteRequest implements ExecutorAwareMessage { long startTaskTime, long timeout, @Nullable Collection top, +@Nullable IgnitePredicate topPred, +byte[] topPredBytes, byte[] siblingsBytes, Collection siblings, byte[] sesAttrsBytes, @@ -216,7 +229,6 @@ public class GridJobExecuteRequest implements ExecutorAwareMessage { int part, @Nullable AffinityTopologyVersion topVer, @Nullable String execName) { -this.top = top; assert sesId != null; assert jobId != null; assert taskName != null; @@ -224,6 +236,7 @@ public class GridJobExecuteRequest implements ExecutorAwareMessage { assert job != null || jobBytes != null; assert sesAttrs != null || sesAttrsBytes != null || !sesFullSup; assert jobAttrs != null || jobAttrsBytes != null; +assert top != null || topPred != null || topPredBytes != null; assert clsLdrId != null; assert userVer != null; assert depMode != null; @@ -238,6 +251,9 @@ public class GridJobExecuteRequest implements
[3/5] ignite git commit: IGNITE-7002 .NET: Add cross-platform examples on .NET Core (missed changes)
IGNITE-7002 .NET: Add cross-platform examples on .NET Core (missed changes) This closes #3119 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e15cbcc5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e15cbcc5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e15cbcc5 Branch: refs/heads/ignite-zk Commit: e15cbcc5987e0674266efbc73ca15b9315f0efd5 Parents: 3b314f7 Author: Pavel TupitsynAuthored: Tue Dec 5 14:18:57 2017 +0300 Committer: Pavel Tupitsyn Committed: Tue Dec 5 14:18:57 2017 +0300 -- .../dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs | 7 +-- .../dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e15cbcc5/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs index 4d1eeb6..de43666 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/Example.cs @@ -73,7 +73,8 @@ namespace Apache.Ignite.Core.Tests.Examples { var examplesAsm = typeof (ClosureExample).Assembly; -var sourceFiles = Directory.GetFiles(PathUtil.ExamplesSourcePath, "*.cs", SearchOption.AllDirectories); +var sourceFiles = Directory.GetFiles(PathUtil.ExamplesSourcePath, "*.cs", SearchOption.AllDirectories) +.Where(x => !x.Contains("dotnetcore")).ToArray(); Assert.IsTrue(sourceFiles.Any()); @@ -102,7 +103,9 @@ namespace Apache.Ignite.Core.Tests.Examples /// private static Action GetRunAction(Type type) { -return (Action) Delegate.CreateDelegate(typeof (Action), type.GetMethod("Main")); +var mainMethod = type.GetMethod("Main"); +Assert.IsNotNull(mainMethod); +return (Action) Delegate.CreateDelegate(typeof (Action), mainMethod); } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/e15cbcc5/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs index 5415378..513ec0c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs @@ -37,7 +37,7 @@ namespace Apache.Ignite.Core.Tests public void TestCsprojToolsVersion() { var projFiles = GetDotNetSourceDir().GetFiles("*.csproj", SearchOption.AllDirectories) -.Where(x => !x.Name.Contains("DotNetCore")).ToArray(); +.Where(x => !x.FullName.ToLower().Contains("dotnetcore")).ToArray(); Assert.GreaterOrEqual(projFiles.Length, 7); CheckFiles(projFiles, x => !x.Contains("ToolsVersion=\"4.0\""), "Invalid csproj files: ");
[2/5] ignite git commit: IGNITE-7002 .NET: Add cross-platform examples on .NET Core
IGNITE-7002 .NET: Add cross-platform examples on .NET Core This closes #3119 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3b314f72 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3b314f72 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3b314f72 Branch: refs/heads/ignite-zk Commit: 3b314f72512ca417cb08a079dcb6f1521b37a474 Parents: 24f9087 Author: Pavel TupitsynAuthored: Tue Dec 5 10:58:02 2017 +0300 Committer: Pavel Tupitsyn Committed: Tue Dec 5 10:58:02 2017 +0300 -- modules/platforms/dotnet/examples/README.txt| 2 + .../dotnetcore/Apache.Ignite.Examples.csproj| 29 +++ .../dotnet/examples/dotnetcore/App.config | 41 .../dotnet/examples/dotnetcore/Employee.cs | 67 ++ .../dotnet/examples/dotnetcore/LinqExample.cs | 239 +++ .../dotnet/examples/dotnetcore/Organization.cs | 58 + .../dotnet/examples/dotnetcore/Program.cs | 109 + .../dotnet/examples/dotnetcore/PutGetExample.cs | 122 ++ .../dotnet/examples/dotnetcore/README.txt | 8 + .../dotnet/examples/dotnetcore/SqlExample.cs| 191 +++ .../dotnet/run-dotnetcore-examples.bat | 27 +++ 11 files changed, 893 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3b314f72/modules/platforms/dotnet/examples/README.txt -- diff --git a/modules/platforms/dotnet/examples/README.txt b/modules/platforms/dotnet/examples/README.txt index e39f48a..db38a35 100644 --- a/modules/platforms/dotnet/examples/README.txt +++ b/modules/platforms/dotnet/examples/README.txt @@ -1,6 +1,8 @@ Apache Ignite.NET Examples == +Windows-only. See dotnetcore folder for cross-platform .NET-core based examples. + * Open Visual Studio solution %IGNITE_HOME%\platforms\dotnet\examples\Apache.Ignite.Examples.sln * Build Apache.Ignite.ExamplesDll project. * Set desired example as startup object in Apache.Ignite.Examples project and run it. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/3b314f72/modules/platforms/dotnet/examples/dotnetcore/Apache.Ignite.Examples.csproj -- diff --git a/modules/platforms/dotnet/examples/dotnetcore/Apache.Ignite.Examples.csproj b/modules/platforms/dotnet/examples/dotnetcore/Apache.Ignite.Examples.csproj new file mode 100644 index 000..9deb9fa --- /dev/null +++ b/modules/platforms/dotnet/examples/dotnetcore/Apache.Ignite.Examples.csproj @@ -0,0 +1,29 @@ + + + +Exe +netcoreapp2.0 +Apache.Ignite.Examples.Program + + + + NU1701 + + + + + ..\..\Apache.Ignite\bin\$(Configuration)\Apache.Ignite.Core.dll + ..\..\bin\Apache.Ignite.Core.dll + + + ..\..\Apache.Ignite.Linq\bin\$(Configuration)\Apache.Ignite.Linq.dll + ..\..\bin\Apache.Ignite.Linq.dll + + + + + + + + + http://git-wip-us.apache.org/repos/asf/ignite/blob/3b314f72/modules/platforms/dotnet/examples/dotnetcore/App.config -- diff --git a/modules/platforms/dotnet/examples/dotnetcore/App.config b/modules/platforms/dotnet/examples/dotnetcore/App.config new file mode 100644 index 000..e653d62 --- /dev/null +++ b/modules/platforms/dotnet/examples/dotnetcore/App.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + +http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection; + localhost="127.0.0.1"> + + + + + +127.0.0.1:47500..47502 + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/3b314f72/modules/platforms/dotnet/examples/dotnetcore/Employee.cs -- diff --git a/modules/platforms/dotnet/examples/dotnetcore/Employee.cs b/modules/platforms/dotnet/examples/dotnetcore/Employee.cs new file mode 100644 index 000..a8afaec --- /dev/null +++ b/modules/platforms/dotnet/examples/dotnetcore/Employee.cs @@ -0,0 +1,67 @@ +/* + * 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 + * + *
ignite git commit: IGNITE-7088 Fix implementation of DIRECT comparator for ordering cache start operations. This closes #3136.
Repository: ignite Updated Branches: refs/heads/master cab5cc562 -> bbeb20508 IGNITE-7088 Fix implementation of DIRECT comparator for ordering cache start operations. This closes #3136. Signed-off-by: nikolay_tikhonovProject: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bbeb2050 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bbeb2050 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bbeb2050 Branch: refs/heads/master Commit: bbeb2050877d064cf937c12a4f1536079da40b17 Parents: cab5cc5 Author: Evgenii Zhuravlev Authored: Thu Dec 7 15:42:33 2017 +0300 Committer: nikolay_tikhonov Committed: Thu Dec 7 15:42:33 2017 +0300 -- .../processors/cache/ClusterCachesInfo.java | 8 ++-- .../processors/cache/CacheComparatorTest.java | 48 .../testsuites/IgniteCacheTestSuite2.java | 3 ++ 3 files changed, 54 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/bbeb2050/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 2b5ebf9..2c32bf2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -1755,16 +1755,14 @@ class ClusterCachesInfo { * Use DIRECT comparator for ordering cache start operations. * Use REVERSE comparator for ordering cache stop operations. */ -private static class CacheComparators { +static class CacheComparators { /** * DIRECT comparator for cache descriptors (first system caches). */ static Comparator DIRECT = new Comparator() { @Override public int compare(DynamicCacheDescriptor o1, DynamicCacheDescriptor o2) { -if (!o1.cacheType().userCache()) -return -1; -if (!o2.cacheType().userCache()) -return 1; +if (o1.cacheType().userCache() ^ o2.cacheType().userCache()) +return o2.cacheType().userCache() ? -1 : 1; return o1.cacheId().compareTo(o2.cacheId()); } http://git-wip-us.apache.org/repos/asf/ignite/blob/bbeb2050/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheComparatorTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheComparatorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheComparatorTest.java new file mode 100644 index 000..0bd587d --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheComparatorTest.java @@ -0,0 +1,48 @@ +/* + * 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; + +import junit.framework.TestCase; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.processors.query.QuerySchema; + +/** + * Test for CacheComparators from ClusterCachesInfo + */ +public class CacheComparatorTest extends TestCase { +/** + * Test if comparator not violates its general contract + */ +public void testDirect() { +DynamicCacheDescriptor desc1 = new DynamicCacheDescriptor(null, +new CacheConfiguration().setName(""), CacheType.DATA_STRUCTURES, +null, true, null, true, +false, null, new QuerySchema()); + +DynamicCacheDescriptor desc2 = new DynamicCacheDescriptor(null, +new
[1/2] ignite git commit: zk
Repository: ignite Updated Branches: refs/heads/ignite-zk d3a80fb03 -> a11e06a5b zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3d1c0e88 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3d1c0e88 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3d1c0e88 Branch: refs/heads/ignite-zk Commit: 3d1c0e88dea6569ceddfd015ceae6f66f4483ad3 Parents: d3a80fb Author: sboikovAuthored: Thu Dec 7 11:09:48 2017 +0300 Committer: sboikov Committed: Thu Dec 7 11:09:48 2017 +0300 -- .../discovery/zk/internal/ZookeeperClient.java | 4 +-- .../ZookeeperDiscoverySpiBasicTest.java | 35 2 files changed, 37 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1c0e88/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java index e2ec675..4886572 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java @@ -38,7 +38,7 @@ import org.apache.zookeeper.data.Stat; import org.jetbrains.annotations.Nullable; /** - * + * TODO ZK: limit reconnect attempts. */ public class ZookeeperClient implements Watcher { /** */ @@ -683,7 +683,7 @@ public class ZookeeperClient implements Watcher { else { assert connStartTime != 0; -assert state == ConnectionState.Disconnected; +assert state == ConnectionState.Disconnected : state; remainingTime = connLossTimeout - (System.currentTimeMillis() - connStartTime); http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1c0e88/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java index c2e4aba..56d1eaf 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiBasicTest.java @@ -42,6 +42,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -1360,6 +1361,40 @@ public class ZookeeperDiscoverySpiBasicTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ +public void testLargeCustomEvent() throws Exception { +Ignite srv0 = startGrid(0); + +CacheConfiguration
[2/2] ignite git commit: zk
zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a11e06a5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a11e06a5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a11e06a5 Branch: refs/heads/ignite-zk Commit: a11e06a5bde8b5e25b37374504030423c0062183 Parents: 3d1c0e8 Author: sboikovAuthored: Thu Dec 7 12:49:31 2017 +0300 Committer: sboikov Committed: Thu Dec 7 12:49:31 2017 +0300 -- .../discovery/zk/internal/ZkIgnitePaths.java| 61 --- .../discovery/zk/internal/ZookeeperClient.java | 6 +- .../zk/internal/ZookeeperDiscoveryImpl.java | 102 +++ .../ZookeeperDiscoverySpiBasicTest.java | 77 +- 4 files changed, 183 insertions(+), 63 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a11e06a5/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZkIgnitePaths.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZkIgnitePaths.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZkIgnitePaths.java index c9c0281..0d47658 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZkIgnitePaths.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZkIgnitePaths.java @@ -30,13 +30,16 @@ class ZkIgnitePaths { private static final String JOIN_DATA_DIR = "jd"; /** */ -private static final String CUSTOM_EVTS_DIR = "c"; +private static final String CUSTOM_EVTS_DIR = "ce"; + +/** */ +private static final String CUSTOM_EVTS_PARTS_DIR = "cp"; /** */ private static final String CUSTOM_EVTS_ACKS_DIR = "ca"; /** */ -private static final String ALIVE_NODES_DIR = "n"; +static final String ALIVE_NODES_DIR = "n"; /** */ private static final String DISCO_EVENTS_PATH = "e"; @@ -57,6 +60,9 @@ class ZkIgnitePaths { final String customEvtsDir; /** */ +final String customEvtsPartsDir; + +/** */ final String customEvtsAcksDir; /** @@ -69,6 +75,7 @@ class ZkIgnitePaths { joinDataDir = zkPath(JOIN_DATA_DIR); evtsPath = zkPath(DISCO_EVENTS_PATH); customEvtsDir = zkPath(CUSTOM_EVTS_DIR); +customEvtsPartsDir = zkPath(CUSTOM_EVTS_PARTS_DIR); customEvtsAcksDir = zkPath(CUSTOM_EVTS_ACKS_DIR); } @@ -201,7 +208,7 @@ class ZkIgnitePaths { * @return Event node ID. */ static UUID customEventSendNodeId(String path) { -// :| +// ::| int startIdx = ZkIgnitePaths.UUID_LEN + 1; String idStr = path.substring(startIdx, startIdx + ZkIgnitePaths.UUID_LEN); @@ -209,6 +216,41 @@ class ZkIgnitePaths { return UUID.fromString(idStr); } +static String customEventPrefix(String path) { +// ::| + +return path.substring(0, ZkIgnitePaths.UUID_LEN); +} + +/** + * @param path Custom event zl path. + * @return Event node ID. + */ +static int customEventPartsCount(String path) { +// ::| +int startIdx = 2 * ZkIgnitePaths.UUID_LEN + 2; + +String cntStr = path.substring(startIdx, startIdx + 4); + +int partCnt = Integer.parseInt(cntStr); + +assert partCnt >= 1 : partCnt; + +return partCnt; +} + +String createCustomEventPath(String prefix, UUID nodeId, int partCnt) { +return customEvtsDir + "/" + prefix + ":" + nodeId + ":" + String.format("%04d", partCnt) + '|'; +} + +String customEventPartsBasePath(String prefix, UUID nodeId) { +return customEvtsPartsDir + "/" + prefix + ":" + nodeId + ":"; +} + +String customEventPartPath(String prefix, UUID nodeId, int part) { +return customEventPartsBasePath(prefix, nodeId) + String.format("%04d", part); +} + /** * @param evtId Event ID. * @return Event zk path. @@ -222,17 +264,6 @@ class ZkIgnitePaths { * @return Path for custom event ack. */ String ackEventDataPath(long evtId) { -return customEventDataPath(true, String.valueOf(evtId)); -} - -/** - * @param ack Ack event flag. - * @param child Event child path. - * @return Full event data path. - */ -String customEventDataPath(boolean ack, String child) { -String baseDir = ack ? customEvtsAcksDir : customEvtsDir; - -return baseDir + "/" + child; +return customEvtsAcksDir + "/" + String.valueOf(evtId); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/a11e06a5/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java