ignite git commit: IGNITE-5024 - expandable memory space
Repository: ignite Updated Branches: refs/heads/ignite-5024 [created] 67ba03bc2 IGNITE-5024 - expandable memory space Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/67ba03bc Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/67ba03bc Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/67ba03bc Branch: refs/heads/ignite-5024 Commit: 67ba03bc2c2181f9d61caddd5981d24ef50cc10a Parents: a826c61 Author: Alexey Goncharuk Authored: Thu Apr 20 19:38:24 2017 +0300 Committer: Alexey Goncharuk Committed: Thu Apr 20 19:38:24 2017 +0300 -- .../benchmarks/jmh/tree/BPlusTreeBenchmark.java | 8 +- .../configuration/DataPageEvictionMode.java | 4 +- .../configuration/MemoryConfiguration.java | 7 +- .../MemoryPolicyConfiguration.java | 41 ++- .../ignite/internal/mem/DirectMemory.java | 55 .../internal/mem/DirectMemoryProvider.java | 19 +- .../mem/file/MappedFileMemoryProvider.java | 153 +++--- .../mem/unsafe/UnsafeMemoryProvider.java| 69 ++--- .../pagemem/impl/PageMemoryNoStoreImpl.java | 286 +++ .../IgniteCacheDatabaseSharedManager.java | 81 ++ .../cache/database/MemoryMetricsImpl.java | 2 +- .../evict/PageAbstractEvictionTracker.java | 2 +- .../evict/Random2LruPageEvictionTracker.java| 2 +- .../evict/RandomLruPageEvictionTracker.java | 2 +- .../node/VisorMemoryPolicyConfiguration.java| 2 +- .../pagemem/impl/PageMemoryNoLoadSelfTest.java | 3 +- .../cache/CacheConfigurationLeakTest.java | 2 +- .../CacheMemoryPolicyConfigurationTest.java | 8 +- .../cache/MemoryPolicyConfigValidationTest.java | 2 +- .../paged/PageEvictionAbstractTest.java | 2 +- .../TxPessimisticDeadlockDetectionTest.java | 2 +- .../processors/database/BPlusTreeSelfTest.java | 12 +- .../database/FreeListImplSelfTest.java | 4 +- .../database/IgniteDbDynamicCacheSelfTest.java | 2 +- .../database/MetadataStorageSelfTest.java | 2 +- .../index/DynamicIndexAbstractSelfTest.java | 2 +- .../h2/database/InlineIndexHelperTest.java | 18 +- 27 files changed, 363 insertions(+), 429 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/67ba03bc/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java -- diff --git a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java index 5833e1f..d4e2c9f 100644 --- a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java +++ b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java @@ -210,7 +210,7 @@ public class BPlusTreeBenchmark extends JmhAbstractBenchmark { sizes[i] = 1024 * MB / CPUS; PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(), -new UnsafeMemoryProvider(sizes), +new UnsafeMemoryProvider(new JavaLogger()), null, PAGE_SIZE, null, @@ -281,8 +281,7 @@ public class BPlusTreeBenchmark extends JmhAbstractBenchmark { } /** {@inheritDoc} */ -@Override public Long getLookupRow(BPlusTree tree, long pageAddr, int idx) -throws IgniteCheckedException { +@Override public Long getLookupRow(BPlusTree tree, long pageAddr, int idx) { return PageUtils.getLong(pageAddr, offset(idx)); } } @@ -318,8 +317,7 @@ public class BPlusTreeBenchmark extends JmhAbstractBenchmark { } /** {@inheritDoc} */ -@Override public Long getLookupRow(BPlusTree tree, long pageAddr, int idx) -throws IgniteCheckedException { +@Override public Long getLookupRow(BPlusTree tree, long pageAddr, int idx) { return PageUtils.getLong(pageAddr, offset(idx)); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/67ba03bc/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java index 91f707e..661e03e 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java @@ -31,9 +31,9 @@ public enum
ignite git commit: IGNITE-5043 .NET: CacheConfiguration.WriteBehindCoalescing
Repository: ignite Updated Branches: refs/heads/ignite-2.0 800fb87a1 -> 217c6be26 IGNITE-5043 .NET: CacheConfiguration.WriteBehindCoalescing Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/217c6be2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/217c6be2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/217c6be2 Branch: refs/heads/ignite-2.0 Commit: 217c6be2650fa77e8ba295a682f6549a1e3c2be0 Parents: 800fb87 Author: Pavel Tupitsyn Authored: Thu Apr 20 19:39:45 2017 +0300 Committer: Pavel Tupitsyn Committed: Thu Apr 20 19:39:45 2017 +0300 -- .../platform/utils/PlatformConfigurationUtils.java| 2 ++ .../Cache/CacheConfigurationTest.cs | 3 +++ .../IgniteConfigurationSerializerTest.cs | 4 +++- .../Cache/Configuration/CacheConfiguration.cs | 14 ++ .../Apache.Ignite.Core/IgniteConfigurationSection.xsd | 7 +++ 5 files changed, 29 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java index b79ab4b..0fe537f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java @@ -167,6 +167,7 @@ public class PlatformConfigurationUtils { ccfg.setWriteBehindFlushFrequency(in.readLong()); ccfg.setWriteBehindFlushSize(in.readInt()); ccfg.setWriteBehindFlushThreadCount(in.readInt()); +ccfg.setWriteBehindCoalescing(in.readBoolean()); ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.fromOrdinal(in.readInt())); ccfg.setReadThrough(in.readBoolean()); ccfg.setWriteThrough(in.readBoolean()); @@ -794,6 +795,7 @@ public class PlatformConfigurationUtils { writer.writeLong(ccfg.getWriteBehindFlushFrequency()); writer.writeInt(ccfg.getWriteBehindFlushSize()); writer.writeInt(ccfg.getWriteBehindFlushThreadCount()); +writer.writeBoolean(ccfg.getWriteBehindCoalescing()); writeEnumInt(writer, ccfg.getWriteSynchronizationMode()); writer.writeBoolean(ccfg.isReadThrough()); writer.writeBoolean(ccfg.isWriteThrough()); http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs index 6406d32..25ba43e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs @@ -213,6 +213,8 @@ namespace Apache.Ignite.Core.Tests.Cache Assert.AreEqual(CacheConfiguration.DefaultWriteBehindEnabled, cfg.WriteBehindEnabled); Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushFrequency, cfg.WriteBehindFlushFrequency); Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushSize, cfg.WriteBehindFlushSize); + Assert.AreEqual(CacheConfiguration.DefaultWriteBehindFlushThreadCount, cfg.WriteBehindFlushThreadCount); +Assert.AreEqual(CacheConfiguration.DefaultWriteBehindCoalescing, cfg.WriteBehindCoalescing); } /// @@ -511,6 +513,7 @@ namespace Apache.Ignite.Core.Tests.Cache CacheStoreFactory = new CacheStoreFactoryTest(), ReadThrough = true, WriteThrough = true, +WriteBehindCoalescing = false, QueryEntities = new[] { new QueryEntity http://git-wip-us.apache.org/repos/asf/ignite/blob/217c6be2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs index 2d8cc20..6b94079 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfiguratio
svn commit: r1792108 - /ignite/site/trunk/community/contribute.html
Author: dmagda Date: Thu Apr 20 18:47:14 2017 New Revision: 1792108 URL: http://svn.apache.org/viewvc?rev=1792108&view=rev Log: added DynaCache provider task Modified: ignite/site/trunk/community/contribute.html Modified: ignite/site/trunk/community/contribute.html URL: http://svn.apache.org/viewvc/ignite/site/trunk/community/contribute.html?rev=1792108&r1=1792107&r2=1792108&view=diff == --- ignite/site/trunk/community/contribute.html (original) +++ ignite/site/trunk/community/contribute.html Thu Apr 20 18:47:14 2017 @@ -116,15 +116,14 @@ under the License. Apache Apex Connectors, https://issues.apache.org/jira/browse/IGNITE-3131";>IGNITE-3131 - +DynaCache Provider, https://issues.apache.org/jira/browse/IGNITE-5047";>IGNITE-5047 + Kubernetes Deployments Support: Parent Jira ticket for the Kubernetes related work: https://issues.apache.org/jira/browse/IGNITE-4159";>IGNITE-4159. -Discovery for Ignite Kubernetes Pods, https://issues.apache.org/jira/browse/IGNITE-4160";>IGNITE-4160 Discovery for Nodes to Connect to Kubernetes From Outside, https://issues.apache.org/jira/browse/IGNITE-4161";>IGNITE-4161 -Step-by-step Guidance for the Usage of Ignite with Kubernetes, https://issues.apache.org/jira/browse/IGNITE-4162";>IGNITE-4162 Streaming:
ignite git commit: Minor doc fix in DataPageEvictionMOde
Repository: ignite Updated Branches: refs/heads/ignite-2.0 217c6be26 -> e41de0cf4 Minor doc fix in DataPageEvictionMOde Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e41de0cf Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e41de0cf Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e41de0cf Branch: refs/heads/ignite-2.0 Commit: e41de0cf42089c636deddaa611a38009ed5b313e Parents: 217c6be Author: Denis Magda Authored: Thu Apr 20 14:32:18 2017 -0700 Committer: Denis Magda Committed: Thu Apr 20 14:32:18 2017 -0700 -- .../java/org/apache/ignite/configuration/DataPageEvictionMode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e41de0cf/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java index 437721b..0d1b5b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataPageEvictionMode.java @@ -20,7 +20,7 @@ package org.apache.ignite.configuration; /** * Defines memory page eviction algorithm. A mode is set for a specific * {@link MemoryPolicyConfiguration}. Only data pages, that store key-value entries, are eligible for eviction. The - * other types of pages, like index or system pages, are not evictable. + * other types of pages, like index or meta pages, are not evictable. */ public enum DataPageEvictionMode { /** Eviction is disabled. */
ignite git commit: ignite-2.0 Fixed IGNITE_MODULES search path.
Repository: ignite Updated Branches: refs/heads/ignite-2.0 e41de0cf4 -> 8ad5a945d ignite-2.0 Fixed IGNITE_MODULES search path. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8ad5a945 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8ad5a945 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8ad5a945 Branch: refs/heads/ignite-2.0 Commit: 8ad5a945de9df6df6281b80dbec6c3c8c7e3c497 Parents: e41de0c Author: vsisko Authored: Fri Apr 21 09:42:15 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Apr 21 09:42:15 2017 +0700 -- modules/web-console/backend/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/8ad5a945/modules/web-console/backend/index.js -- diff --git a/modules/web-console/backend/index.js b/modules/web-console/backend/index.js index 7416f51..7db51c8 100644 --- a/modules/web-console/backend/index.js +++ b/modules/web-console/backend/index.js @@ -22,12 +22,13 @@ const path = require('path'); const http = require('http'); const https = require('https'); -const igniteModules = process.env.IGNITE_MODULES || './ignite_modules'; +const igniteModules = process.env.IGNITE_MODULES ? +path.join(path.normalize(process.env.IGNITE_MODULES), 'backend') : './ignite_modules'; let injector; try { -const igniteModulesInjector = path.resolve(path.join(igniteModules, 'backend', 'injector.js')); +const igniteModulesInjector = path.resolve(path.join(igniteModules, 'injector.js')); fs.accessSync(igniteModulesInjector, fs.F_OK);
[ignite] Git Push Summary
Repository: ignite Updated Branches: refs/heads/ignite-4929 [deleted] c31405a05
ignite git commit: ignite-4929 Fixed issue with incorrect return value on backup for one-phase tx invoke (anyway old value is sent on backups on changed topology, use this value on backup for invoke)
Repository: ignite Updated Branches: refs/heads/ignite-2.0 a5088265d -> a4c397076 ignite-4929 Fixed issue with incorrect return value on backup for one-phase tx invoke (anyway old value is sent on backups on changed topology, use this value on backup for invoke) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a4c39707 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4c39707 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4c39707 Branch: refs/heads/ignite-2.0 Commit: a4c397076954d10cfb200fe30060ed0d118a3fc1 Parents: a508826 Author: sboikov Authored: Thu Apr 20 10:26:09 2017 +0300 Committer: sboikov Committed: Thu Apr 20 10:26:09 2017 +0300 -- .../processors/cache/GridCacheUtils.java| 9 - .../distributed/GridDistributedLockRequest.java | 14 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 26 +-- .../near/GridNearSingleGetRequest.java | 4 +- .../cache/transactions/IgniteTxAdapter.java | 16 +- .../cache/transactions/IgniteTxEntry.java | 39 ++-- .../IgfsMetaDirectoryListingAddProcessor.java | 5 +- .../internal/TestRecordingCommunicationSpi.java | 9 + .../cache/IgniteOnePhaseCommitInvokeTest.java | 213 +++ .../IgniteCachePutRetryAbstractSelfTest.java| 25 +-- ...gniteCachePutRetryTransactionalSelfTest.java | 2 +- .../atomic/IgniteCacheAtomicProtocolTest.java | 16 +- .../testframework/junits/GridAbstractTest.java | 9 +- .../junits/common/GridCommonAbstractTest.java | 79 +++ .../testsuites/IgniteCacheTestSuite2.java | 3 + 15 files changed, 360 insertions(+), 109 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a4c39707/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 51a95a6..5abb6de 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -196,15 +196,6 @@ public class GridCacheUtils { /** Expire time: must be calculated based on TTL value. */ public static final long EXPIRE_TIME_CALCULATE = -1L; -/** Skip store flag bit mask. */ -public static final int SKIP_STORE_FLAG_MASK = 0x1; - -/** Keep serialized flag. */ -public static final int KEEP_BINARY_FLAG_MASK = 0x2; - -/** Flag indicating that old value for 'invoke' operation was non null on primary node. */ -public static final int OLD_VAL_ON_PRIMARY = 0x4; - /** Empty predicate array. */ private static final IgnitePredicate[] EMPTY = new IgnitePredicate[0]; http://git-wip-us.apache.org/repos/asf/ignite/blob/a4c39707/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index b1c2c27..74f34a9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -38,9 +38,6 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.internal.processors.cache.GridCacheUtils.KEEP_BINARY_FLAG_MASK; -import static org.apache.ignite.internal.processors.cache.GridCacheUtils.SKIP_STORE_FLAG_MASK; - /** * Lock request message. */ @@ -48,6 +45,12 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage { /** */ private static final long serialVersionUID = 0L; +/** Skip store flag bit mask. */ +private static final int SKIP_STORE_FLAG_MASK = 0x01; + +/** Keep binary flag. */ +private static final int KEEP_BINARY_FLAG_MASK = 0x02; + /** Sender node ID. */ private UUID nodeId; @@ -90,10 +93,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage { /** Key count. */ private int txSize; -/** - * Additional flags. - * GridCacheUtils.SKIP_STORE_FLAG_MASK - for skipStore flag value. - */
[65/70] [abbrv] ignite git commit: ignite-1561 Fixed tx prepare for cross cache tx with near + colocated cache
http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java index 2c317df..10e9ec5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformCollectionView.java @@ -21,7 +21,6 @@ import java.util.Collection; import java.util.Iterator; import org.apache.ignite.internal.util.GridSerializableCollection; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgnitePredicate; import org.jetbrains.annotations.NotNull; @@ -50,6 +49,7 @@ public class TransformCollectionView extends GridSerializableCollection< * @param clos Transformation closure. * @param preds Optional predicated. If predicates are not provided - all elements will be in the view. */ +@SafeVarargs public TransformCollectionView(Collection col, IgniteClosure clos, IgnitePredicate... preds) { this.col = col; @@ -71,9 +71,4 @@ public class TransformCollectionView extends GridSerializableCollection< @Override public boolean isEmpty() { return F.isEmpty(preds) ? col.isEmpty() : !iterator().hasNext(); } - -/** {@inheritDoc} */ -@Override public String toString() { -return S.toString(TransformCollectionView.class, this); -} } http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java index 91b8302..a089f67 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView.java @@ -24,7 +24,6 @@ import org.apache.ignite.internal.util.GridSerializableMap; import org.apache.ignite.internal.util.GridSerializableSet; import org.apache.ignite.internal.util.lang.GridFunc; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgnitePredicate; import org.jetbrains.annotations.NotNull; @@ -160,9 +159,4 @@ public class TransformMapView extends GridSerializableMap { @Override public boolean containsKey(Object key) { return GridFunc.isAll((K)key, preds) && map.containsKey(key); } - -/** {@inheritDoc} */ -@Override public String toString() { -return S.toString(TransformMapView.class, this); -} } http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxNearEnabledRandomOperationsTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxNearEnabledRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxNearEnabledRandomOperationsTest.java new file mode 100644 index 000..73985a0 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxNearEnabledRandomOperationsTest.java @@ -0,0 +1,28 @@ +/* + * 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; + +/** + * + */ +public class CrossCacheTxNearEnabledRandomOperationsTest extends Cro
[20/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/RandomMatrix.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/RandomMatrix.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/RandomMatrix.java deleted file mode 100644 index 2c3dcb2..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/RandomMatrix.java +++ /dev/null @@ -1,97 +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.math.impls.matrix; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.MatrixStorage; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.impls.storage.matrix.RandomMatrixStorage; -import org.apache.ignite.math.impls.vector.RandomVector; - -/** - * Implementation of {@link Matrix} with random values in the elements. - */ -public class RandomMatrix extends AbstractMatrix { -/** Whether fast hash is used, see {@link RandomMatrixStorage}. */ -private boolean fastHash; - -/** - * @param rows Amount of rows in the matrix. - * @param cols Amount of columns in the matrix. - * @param fastHash Whether fast hash is used. - */ -private MatrixStorage mkStorage(int rows, int cols, boolean fastHash) { -this.fastHash = fastHash; - -return new RandomMatrixStorage(rows, cols, fastHash); -} - -/** - * @param rows Amount of rows in the matrix. - * @param cols Amount of columns in the matrix. - * @param fastHash Whether fast hash is used. - */ -public RandomMatrix(int rows, int cols, boolean fastHash) { -setStorage(mkStorage(rows, cols, fastHash)); -} - -/** - * @param rows Amount of rows in the matrix. - * @param cols Amount of columns in the matrix. - */ -public RandomMatrix(int rows, int cols) { -this(rows, cols, true); -} - -/** */ -public RandomMatrix() { -// No-op. -} - -/** {@inheritDoc} */ -@Override public Matrix copy() { -return new RandomMatrix(rowSize(), columnSize(), fastHash); -} - -/** {@inheritDoc} */ -@Override public Matrix like(int rows, int cols) { -return new RandomMatrix(rows, cols); -} - -/** {@inheritDoc} */ -@Override public Vector likeVector(int crd) { -return new RandomVector(crd); -} - -/** {@inheritDoc} */ -@Override public void writeExternal(ObjectOutput out) throws IOException { -super.writeExternal(out); - -out.writeBoolean(fastHash); -} - -/** {@inheritDoc} */ -@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { -super.readExternal(in); - -fastHash = in.readBoolean(); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/SparseDistributedMatrix.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/SparseDistributedMatrix.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/SparseDistributedMatrix.java deleted file mode 100644 index 5c40d70..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/matrix/SparseDistributedMatrix.java +++ /dev/null @@ -1,155 +0,0 @@ -// @java.file.header - -/* __ ___ - * __ /___(_)__ /__ /__ (_)___ - * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ - * / /_/ / _ /_ / / /_/ / / /_/ / / /_/ / _ / _ / / / - * \/ /_/ /_/ \_,__/ \/ \__,_/ /_/ /_/ /_/ - */ - -/* - * 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, Versio
[06/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java deleted file mode 100644 index 7a64c85..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java +++ /dev/null @@ -1,376 +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.math.impls.vector; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Spliterator; -import java.util.function.BiConsumer; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.impls.MathTestConstants; -import org.junit.Test; - -import static java.util.Spliterator.ORDERED; -import static java.util.Spliterator.SIZED; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -/** */ -public class VectorIterableTest { -/** */ -@Test -public void allTest() { -consumeSampleVectors( -(v, desc) -> { -int expIdx = 0; - -for (Vector.Element e : v.all()) { -int actualIdx = e.index(); - -assertEquals("Unexpected index for " + desc, -expIdx, actualIdx); - -expIdx++; -} - -assertEquals("Unexpected amount of elements for " + desc, -expIdx, v.size()); -} -); -} - -/** */ -@Test -public void allTestBound() { -consumeSampleVectors( -(v, desc) -> iteratorTestBound(v.all().iterator(), desc) -); -} - -/** */ -@Test -public void nonZeroesTestBasic() { -final int size = 5; - -final double[] nonZeroesOddData = new double[size], nonZeroesEvenData = new double[size]; - -for (int idx = 0; idx < size; idx++) { -final boolean odd = (idx & 1) == 1; - -nonZeroesOddData[idx] = odd ? 1 : 0; - -nonZeroesEvenData[idx] = odd ? 0 : 1; -} - -assertTrue("Arrays failed to initialize.", -!isZero(nonZeroesEvenData[0]) -&& isZero(nonZeroesEvenData[1]) -&& isZero(nonZeroesOddData[0]) -&& !isZero(nonZeroesOddData[1])); - -final Vector nonZeroesEvenVec = new DenseLocalOnHeapVector(nonZeroesEvenData), -nonZeroesOddVec = new DenseLocalOnHeapVector(nonZeroesOddData); - -assertTrue("Vectors failed to initialize.", -!isZero(nonZeroesEvenVec.getElement(0).get()) -&& isZero(nonZeroesEvenVec.getElement(1).get()) -&& isZero(nonZeroesOddVec.getElement(0).get()) -&& !isZero(nonZeroesOddVec.getElement(1).get())); - -assertTrue("Iterator(s) failed to start.", -nonZeroesEvenVec.nonZeroes().iterator().next() != null -&& nonZeroesOddVec.nonZeroes().iterator().next() != null); - -int nonZeroesActual = 0; - -for (Vector.Element e : nonZeroesEvenVec.nonZeroes()) { -final int idx = e.index(); - -final boolean odd = (idx & 1) == 1; - -final double val = e.get(); - -assertTrue("Not an even index " + idx + ", for value " + val, !odd); - -assertTrue("Zero value " + val + " at even index " + idx, !isZero(val)); - -nonZeroesActual++; -} - -final int nonZeroesOddExp = (size + 1) / 2; - -assertEquals("Unexpected num of iterated odd non-zeroes.", nonZeroesOddExp, nonZeroesActual); - -assertEquals("Unexpected nonZeroElements of odd.", nonZeroesOddExp, nonZeroesEvenVec.nonZeroElements()); - -nonZeroesActual = 0; - -for (Vector.Element e : nonZeroesOddVec.nonZeroes()) { -
[43/70] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2ded758a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2ded758a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2ded758a Branch: refs/heads/ignite-2893 Commit: 2ded758ad1f1663aea05ca943ecf509b1574c0bf Parents: 22d5e55 d383484 Author: devozerov Authored: Wed Apr 19 12:54:34 2017 +0300 Committer: devozerov Committed: Wed Apr 19 12:54:34 2017 +0300 -- .../junits/common/GridCommonAbstractTest.java | 34 1 file changed, 34 insertions(+) --
[34/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java index 7677d0d..119a389 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java @@ -23,7 +23,10 @@ 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.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; @@ -33,6 +36,9 @@ import java.util.Map; * Descriptor of type. */ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { +/** Space. */ +private final String space; + /** */ private String name; @@ -50,9 +56,15 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { /** Map with upper cased property names to help find properties based on SQL INSERT and MERGE queries. */ private final Map uppercaseProps = new HashMap<>(); +/** Mutex for operations on indexes. */ +private final Object idxMux = new Object(); + /** */ @GridToStringInclude -private final Map indexes = new HashMap<>(); +private final Map idxs = new HashMap<>(); + +/** Aliases. */ +private Map aliases; /** */ private QueryIndexDescriptorImpl fullTextIdx; @@ -78,6 +90,25 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { /** */ private String affKey; +/** Obsolete. */ +private volatile boolean obsolete; + +/** + * Constructor. + * + * @param space Cache name. + */ +public QueryTypeDescriptorImpl(String space) { +this.space = space; +} + +/** + * @return Space. + */ +public String space() { +return space; +} + /** {@inheritDoc} */ @Override public String name() { return name; @@ -97,7 +128,7 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { * @return Table name. */ @Override public String tableName() { -return tblName; +return tblName != null ? tblName : name; } /** @@ -160,7 +191,9 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { /** {@inheritDoc} */ @Override public Map indexes() { -return Collections.unmodifiableMap(indexes); +synchronized (idxMux) { +return Collections.unmodifiableMap(idxs); +} } /** {@inheritDoc} */ @@ -176,59 +209,74 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor { } /** - * Adds index. + * Get index by name. * - * @param idxName Index name. - * @param type Index type. - * @param inlineSize Inline size. - * @return Index descriptor. - * @throws IgniteCheckedException In case of error. + * @param name Name. + * @return Index. */ -public QueryIndexDescriptorImpl addIndex(String idxName, QueryIndexType type, int inlineSize) throws IgniteCheckedException { -QueryIndexDescriptorImpl idx = new QueryIndexDescriptorImpl(type, inlineSize); +@Nullable public QueryIndexDescriptorImpl index(String name) { +synchronized (idxMux) { +return idxs.get(name); +} +} -if (indexes.put(idxName, idx) != null) -throw new IgniteCheckedException("Index with name '" + idxName + "' already exists."); +/** + * @return Raw index descriptors. + */ +public Collection indexes0() { +synchronized (idxMux) { +return new ArrayList<>(idxs.values()); +} +} -return idx; +/** {@inheritDoc} */ +@Override public GridQueryIndexDescriptor textIndex() { +return fullTextIdx; } /** - * Adds field to index. + * Add index. * - * @param idxName Index name. - * @param field Field name. - * @param orderNum Fields order number in index. - * @param inlineSize Inline size. - * @param descending Sorting order. + * @param idx Index. * @throws IgniteCheckedException If failed. */ -public void addFieldToIndex( -String idxName, -String field, -int orderNum, -int inlineSize, -boolean descending -
[05/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java new file mode 100644 index 000..d283ce7 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java @@ -0,0 +1,193 @@ +/* + * 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.math.decompositions; + +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +/** + * Tests for {@link EigenDecomposition} + */ +public class EigenDecompositionTest { +/** */ +private static final double EPSILON = 1e-11; + +/** */ +@Test +public void testMatrixWithRealEigenvalues() { +test(new double[][] { +{1.0d, 0.0d, 0.0d, 0.0d}, +{0.0d, 1.0d, 0.0d, 0.0d}, +{0.0d, 0.0d, 2.0d, 0.0d}, +{1.0d, 1.0d, 0.0d, 2.0d}}, +new double[] {1, 2, 2, 1}); +} + +/** */ +@Test +public void testSymmetricMatrix() { +EigenDecomposition decomposition = new EigenDecomposition(new DenseLocalOnHeapMatrix(new double[][] { +{1.0d, 0.0d, 0.0d, 1.0d}, +{0.0d, 1.0d, 0.0d, 1.0d}, +{0.0d, 0.0d, 2.0d, 0.0d}, +{1.0d, 1.0d, 0.0d, 2.0d}})); + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertNotNull("Matrix d is expected to be not null.", d); +assertNotNull("Matrix v is expected to be not null.", v); + +assertEquals("Unexpected rows in d matrix.", 4, d.rowSize()); +assertEquals("Unexpected cols in d matrix.", 4, d.columnSize()); + +assertEquals("Unexpected rows in v matrix.", 4, v.rowSize()); +assertEquals("Unexpected cols in v matrix.", 4, v.columnSize()); + +assertIsDiagonalNonZero(d); + +decomposition.destroy(); +} + +/** */ +@Test +public void testNonSquareMatrix() { +EigenDecomposition decomposition = new EigenDecomposition(new DenseLocalOnHeapMatrix(new double[][] { +{1.0d, 0.0d, 0.0d}, +{0.0d, 1.0d, 0.0d}, +{0.0d, 0.0d, 2.0d}, +{1.0d, 1.0d, 0.0d}})); +// todo find out why decomposition of 3X4 matrix throws row index exception + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertNotNull("Matrix d is expected to be not null.", d); +assertNotNull("Matrix v is expected to be not null.", v); + +assertEquals("Unexpected rows in d matrix.", 4, d.rowSize()); +assertEquals("Unexpected cols in d matrix.", 4, d.columnSize()); + +assertEquals("Unexpected rows in v matrix.", 4, v.rowSize()); +assertEquals("Unexpected cols in v matrix.", 3, v.columnSize()); + +assertIsDiagonal(d, true); + +decomposition.destroy(); +} + +/** */ +private void test(double[][] mRaw, double[] expRealEigenValues) { +DenseLocalOnHeapMatrix m = new DenseLocalOnHeapMatrix(mRaw); +EigenDecomposition decomposition = new EigenDecomposition(m); + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertIsDiagonalNonZero(d); + +// check that d's diagonal consists of eigenvalues of m. +assertDiagonalConsistsOfEigenvalues(m, d, v); + +// m = v d v^{-1} is equivalent to +// m v = v d +assertMatricesAreEqual(m.times(v), v.times(d)); + +assertEigenvalues(decomposition, expRealEigenValues); + +decomposition.destroy(); +} + +/** */ +private void assertEigenvalues(EigenDecomposition decomposit
[68/70] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-2893
http://git-wip-us.apache.org/repos/asf/ignite/blob/81835e48/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java -- http://git-wip-us.apache.org/repos/asf/ignite/blob/81835e48/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java -- http://git-wip-us.apache.org/repos/asf/ignite/blob/81835e48/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java -- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java index f7f61c6,163ed99..c9c4f34 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java @@@ -68,26 -68,26 +68,35 @@@ public class IgniteTxEntry implements G private static final long serialVersionUID = 0L; /** Dummy version for non-existing entry read in SERIALIZABLE transaction. */ - public static final GridCacheVersion SER_READ_EMPTY_ENTRY_VER = new GridCacheVersion(0, 0, 0, 0); + public static final GridCacheVersion SER_READ_EMPTY_ENTRY_VER = new GridCacheVersion(0, 0, 0); /** Dummy version for any existing entry read in SERIALIZABLE transaction. */ - public static final GridCacheVersion SER_READ_NOT_EMPTY_VER = new GridCacheVersion(0, 0, 0, 1); + public static final GridCacheVersion SER_READ_NOT_EMPTY_VER = new GridCacheVersion(0, 0, 1); /** */ - public static final GridCacheVersion GET_ENTRY_INVALID_VER_UPDATED = new GridCacheVersion(0, 0, 0, 2); + public static final GridCacheVersion GET_ENTRY_INVALID_VER_UPDATED = new GridCacheVersion(0, 0, 2); /** */ - public static final GridCacheVersion GET_ENTRY_INVALID_VER_AFTER_GET = new GridCacheVersion(0, 0, 0, 3); + public static final GridCacheVersion GET_ENTRY_INVALID_VER_AFTER_GET = new GridCacheVersion(0, 0, 3); + + /** Skip store flag bit mask. */ + private static final int TX_ENTRY_SKIP_STORE_FLAG_MASK = 0x01; + + /** Keep binary flag. */ + private static final int TX_ENTRY_KEEP_BINARY_FLAG_MASK = 0x02; + + /** Flag indicating that old value for 'invoke' operation was non null on primary node. */ + private static final int TX_ENTRY_OLD_VAL_ON_PRIMARY = 0x04; +/** Skip store flag bit mask. */ +private static final int TX_ENTRY_SKIP_STORE_FLAG_MASK = 0x01; + +/** Keep binary flag. */ +private static final int TX_ENTRY_KEEP_BINARY_FLAG_MASK = 0x02; + +/** Flag indicating that old value for 'invoke' operation was non null on primary node. */ +private static final int TX_ENTRY_OLD_VAL_ON_PRIMARY = 0x04; + /** Prepared flag updater. */ private static final AtomicIntegerFieldUpdater PREPARED_UPD = AtomicIntegerFieldUpdater.newUpdater(IgniteTxEntry.class, "prepared"); http://git-wip-us.apache.org/repos/asf/ignite/blob/81835e48/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java -- http://git-wip-us.apache.org/repos/asf/ignite/blob/81835e48/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java -- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java index f74d8a4,be718cf..3f07151 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java @@@ -32,10 -29,17 +32,11 @@@ import org.apache.ignite.cache.CacheEnt import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.IgniteInternalCache; -import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal; -import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; + import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport; import org.apache.ignite.lang.IgniteBiTuple; -import static org.apache.ignite.internal.util.typedef.internal.CU.retryTopologySafe; -import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; -import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ; - /** * C
[22/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/decompositions/EigenDecomposition.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/decompositions/EigenDecomposition.java b/modules/ml/src/main/java/org/apache/ignite/math/decompositions/EigenDecomposition.java deleted file mode 100644 index 66fe13c..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/decompositions/EigenDecomposition.java +++ /dev/null @@ -1,923 +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.math.decompositions; - -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.functions.Functions; - -/** - * This class provides EigenDecomposition of given matrix. The class is based on - * class with similar name from http://mahout.apache.org/";>Apache Mahout library. - * - * @see http://mathworld.wolfram.com/EigenDecomposition.html>MathWorld - */ -public class EigenDecomposition extends DecompositionSupport { -/** Row and column dimension (square matrix). */ -private final int n; - -/** Array for internal storage of eigen vectors. */ -private final Matrix v; - -/** Array for internal storage of eigenvalues. */ -private final Vector d; -/** Array for internal storage of eigenvalues. */ -private final Vector e; - -/** */ -public EigenDecomposition(Matrix matrix) { -this(matrix, isSymmetric(matrix)); -} - -/** */ -public EigenDecomposition(Matrix matrix, boolean isSymmetric) { -n = matrix.columnSize(); - -d = likeVector(matrix); -e = likeVector(matrix); -v = like(matrix); - -if (isSymmetric) { -v.assign(matrix); - -// Tridiagonalize. -tred2(); - -// Diagonalize. -tql2(); - -} -else -// Reduce to Hessenberg form. -// Reduce Hessenberg to real Schur form. -hqr2(orthes(matrix)); -} - -/** - * Return the eigen vector matrix - * - * @return V - */ -public Matrix getV() { -return like(v).assign(v); -} - -/** - * Return the real parts of the eigenvalues - */ -public Vector getRealEigenValues() { -return d; -} - -/** - * Return the imaginary parts of the eigenvalues - */ -public Vector getImagEigenvalues() { -return e; -} - -/** - * Return the block diagonal eigenvalue matrix - * - * @return D - */ -public Matrix getD() { -Matrix res = like(v, d.size(), d.size()); -res.assign(0); -res.viewDiagonal().assign(d); -for (int i = 0; i < n; i++) { -double v = e.getX(i); -if (v > 0) -res.setX(i, i + 1, v); -else if (v < 0) -res.setX(i, i - 1, v); -} -return res; -} - -/** - * Destroys decomposition components and other internal components of decomposition. - */ -@Override public void destroy() { -e.destroy(); -v.destroy(); -d.destroy(); -} - -/** */ -private void tred2() { -// This is derived from the Algol procedures tred2 by -// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for -// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding -// Fortran subroutine in EISPACK. - -d.assign(v.viewColumn(n - 1)); - -// Householder reduction to tridiagonal form. - -for (int i = n - 1; i > 0; i--) { - -// Scale to avoid under/overflow. -double scale = d.viewPart(0, i).kNorm(1); -double h = 0.0; - -if (scale == 0.0) { -e.setX(i, d.getX(i - 1)); -for (int j = 0; j < i; j++) { -d.setX(j, v.getX(i - 1, j)); -v.setX(i, j, 0.0); -v.setX(j, i, 0.0); -} -} -else { - -// Generate Householder vector. - -for (int
[40/70] [abbrv] ignite git commit: IGNITE-4988 Cleanup code.
IGNITE-4988 Cleanup code. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/36e7e198 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/36e7e198 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/36e7e198 Branch: refs/heads/ignite-2893 Commit: 36e7e19830dc53c0ed02a0d83806b2cb5a7c7ce5 Parents: f82ed01 Author: Alexey Kuznetsov Authored: Wed Apr 19 11:34:16 2017 +0700 Committer: Alexey Kuznetsov Committed: Wed Apr 19 11:34:16 2017 +0700 -- .../JettyRestProcessorAbstractSelfTest.java | 10 +++ .../visor/cache/VisorCachePartition.java| 87 --- .../visor/cache/VisorCachePartitions.java | 28 +++--- .../visor/cache/VisorCachePartitionsTask.java | 20 +++-- .../cache/VisorCachePartitionsTaskArg.java | 72 .../visor/compute/VisorGatewayTask.java | 91 .../resources/META-INF/classnames.properties| 2 +- 7 files changed, 164 insertions(+), 146 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/36e7e198/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 e5d9997..1321929 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 @@ -66,6 +66,8 @@ import org.apache.ignite.internal.visor.cache.VisorCacheMetadataTask; import org.apache.ignite.internal.visor.cache.VisorCacheMetricsCollectorTask; import org.apache.ignite.internal.visor.cache.VisorCacheMetricsCollectorTaskArg; import org.apache.ignite.internal.visor.cache.VisorCacheNodesTask; +import org.apache.ignite.internal.visor.cache.VisorCachePartitionsTask; +import org.apache.ignite.internal.visor.cache.VisorCachePartitionsTaskArg; import org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTask; import org.apache.ignite.internal.visor.cache.VisorCacheResetMetricsTask; import org.apache.ignite.internal.visor.cache.VisorCacheStartTaskArg; @@ -1283,6 +1285,14 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro jsonTaskResult(ret); +ret = content(new VisorGatewayArgument(VisorCachePartitionsTask.class) +.forNode(locNode) +.argument(VisorCachePartitionsTaskArg.class, "person")); + +info("VisorCachePartitionsTask result: " + ret); + +jsonTaskResult(ret); + ret = content(new VisorGatewayArgument(VisorCacheLoadTask.class) .forNode(locNode) .argument(VisorCacheLoadTaskArg.class, "person", 0, "null")); http://git-wip-us.apache.org/repos/asf/ignite/blob/36e7e198/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartition.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartition.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartition.java deleted file mode 100644 index b57bc53..000 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartition.java +++ /dev/null @@ -1,87 +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.internal.visor.cache; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.visor.VisorDataTransferObject; - -/** - * Data transfer object for information about keys in cache partition. - */ -public cl
[52/70] [abbrv] ignite git commit: IGNITE-4898: Added ODBC installers paths to README. This closes #1753.
IGNITE-4898: Added ODBC installers paths to README. This closes #1753. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f278dc96 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f278dc96 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f278dc96 Branch: refs/heads/ignite-2893 Commit: f278dc969a69ad3c166fc863de5b0ffcd46a19c6 Parents: 5dab5fb Author: isapego Authored: Wed Apr 19 15:12:42 2017 +0300 Committer: devozerov Committed: Wed Apr 19 15:12:42 2017 +0300 -- modules/platforms/cpp/odbc/README.txt | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f278dc96/modules/platforms/cpp/odbc/README.txt -- diff --git a/modules/platforms/cpp/odbc/README.txt b/modules/platforms/cpp/odbc/README.txt index fe40a5c..3a83f84 100644 --- a/modules/platforms/cpp/odbc/README.txt +++ b/modules/platforms/cpp/odbc/README.txt @@ -19,13 +19,13 @@ arguments: 1. Address of the node to connect to: SERVER=; - + 2. Port on which OdbcProcessor of the node is listening: PORT=; - + 3. Datagrid cache to connect to: CACHE=; - + All arguments are case-insensitive so "SERVER", "Server" and "server" all are valid server address arguments. @@ -46,11 +46,11 @@ ODBC driver you should perfrom the following steps: $ ldd /usr/local/lib/libignite-odbc.so. If there is unresolved links to other libraries you may want to add directories with these libraries to the LD_LIBRARY_PATH. - + 2. Edit file $IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini and ensure that "Driver" parameter of the "Apache Ignite" section points to the right location where libignite-odbc.so is located. - + 3. To install Apache Ignite ODBC driver use the following command: $ odbcinst -i -d -f $IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini To perform this command you most likely will need root privileges. @@ -67,9 +67,12 @@ There are two ways to install ODBC driver currently. The first one is to use 32-bit or 64-bit installer. This is the most simple way and you are recommended to stick to it by default. +32-bit installer : $IGNITE_HOME/platforms/cpp/bin/odbc/ignite-odbc-x86.msi +64-bit installer : $IGNITE_HOME/platforms/cpp/bin/odbc/ignite-odbc-amd64.msi + However there is also another way to install driver manually using scripts. If you choose this method you should first choose a directory on your filesystem -where your driver or drivers will be located. Once you have choosen the place +where your driver or drivers will be located. Once you have chosen the place you should put your driver there and ensure that all driver dependencies can be resolved i.e. they can be found either in the %PATH% or in the same directory as the driver. @@ -88,7 +91,7 @@ Thats it. Your driver/drivers are installed. After the installation === - + Now Apache Ignite ODBC driver is installed and ready for use. You can connect to it and use it like to any other ODBC driver.
[39/70] [abbrv] ignite git commit: master - Fix mvcc tests after CLOCK mode removal
master - Fix mvcc tests after CLOCK mode removal Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f82ed018 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f82ed018 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f82ed018 Branch: refs/heads/ignite-2893 Commit: f82ed01807c80b36b7e361a5800ea131c1431c14 Parents: 9b21c85 Author: Alexey Goncharuk Authored: Tue Apr 18 18:40:55 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 18 18:43:28 2017 +0300 -- .../cache/GridCacheMvccPartitionedSelfTest.java | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f82ed018/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java index 2fb5d25..0c53fee 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java @@ -604,9 +604,9 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { public void testSerializableReadLocksAdd() throws Exception { GridCacheAdapter cache = grid.internalCache(); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); { GridCacheMvcc mvcc = new GridCacheMvcc(cache.context()); @@ -681,9 +681,9 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { public void testSerializableReadLocksAssign() throws Exception { GridCacheAdapter cache = grid.internalCache(); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); { GridCacheMvcc mvcc = new GridCacheMvcc(cache.context()); @@ -883,10 +883,10 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1"); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder4 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); +GridCacheVersion serOrder4 = new GridCacheVersion(0, 30, 1); GridCacheVersion ver1 = incVer ? version(1) : version(4); GridCacheVersion ver2 = incVer ? version(2) : version(3);
[38/70] [abbrv] ignite git commit: master - Mute test with a correct link
master - Mute test with a correct link Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9b21c85d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9b21c85d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9b21c85d Branch: refs/heads/ignite-2893 Commit: 9b21c85d6ec0cdbba8cbf2382559a8ef5a82e15c Parents: 2edb935 Author: Alexey Goncharuk Authored: Tue Apr 18 18:40:27 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 18 18:43:21 2017 +0300 -- .../cache/IgniteCacheJoinPartitionedAndReplicatedTest.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9b21c85d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java index d4772c1..37b21c9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java @@ -161,6 +161,8 @@ public class IgniteCacheJoinPartitionedAndReplicatedTest extends GridCommonAbstr * @throws Exception If failed. */ public void testJoin() throws Exception { +fail("https://issues.apache.org/jira/browse/IGNITE-5016";); + Ignite client = grid(2); IgniteCache personCache = client.cache(PERSON_CACHE);
[46/70] [abbrv] ignite git commit: Fixed service deployment tests.
Fixed service deployment tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/15359bc0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/15359bc0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/15359bc0 Branch: refs/heads/ignite-2893 Commit: 15359bc0b048c1a6a4093ea8998b343374667d43 Parents: b47f29d Author: Andrey V. Mashenkov Authored: Wed Apr 19 06:30:30 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 14:03:12 2017 +0300 -- .../GridServiceProcessorAbstractSelfTest.java | 17 +++ ...ServiceProcessorMultiNodeConfigSelfTest.java | 40 +++ .../GridServiceProcessorMultiNodeSelfTest.java | 113 ++- 3 files changed, 95 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/15359bc0/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java index b9076b9..fafd24e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorAbstractSelfTest.java @@ -30,7 +30,9 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor; +import org.apache.ignite.internal.util.lang.GridAbsPredicateX; import org.apache.ignite.internal.util.typedef.CA; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.lang.IgniteFuture; @@ -783,6 +785,21 @@ public abstract class GridServiceProcessorAbstractSelfTest extends GridCommonAbs } /** + * @param srvcName Service name + * @param expectedDeps Expected number of service deployments + * + */ +protected boolean waitForDeployment(final String srvcName, final int expectedDeps) throws IgniteInterruptedCheckedException { +final Ignite g = randomGrid(); + +return GridTestUtils.waitForCondition(new GridAbsPredicateX() { +@Override public boolean applyx() { +return actualCount(srvcName, g.services().serviceDescriptors()) == expectedDeps; +} +}, 1500); +} + +/** * Counter service. */ protected interface CounterService { http://git-wip-us.apache.org/repos/asf/ignite/blob/15359bc0/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java index 9da62c0..16e5e30 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java @@ -22,7 +22,6 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.ignite.Ignite; import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.util.lang.GridAbsPredicateX; import org.apache.ignite.services.ServiceConfiguration; import org.apache.ignite.testframework.GridTestUtils; @@ -213,32 +212,20 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc try { latch.await(); +waitForDeployment(name, nodeCount() + 1); + checkCount(name, g.services().serviceDescriptors(), nodeCount() + 1); } finally { stopExtraNodes(extraNodes); } -assertEquals(name, 1, DummyService.cancelled(name)); - waitForDeployment(name, nodeCount()); -checkCount(name, g.services().serviceDescriptors(), nodeCount()); -} - -/** - * @param srvcName Service name - * @param expectedDeps Expected number of service deployments - * - */ -private bool
[51/70] [abbrv] ignite git commit: IGNITE-5028 .NET: Remove default-dotnet.xml
IGNITE-5028 .NET: Remove default-dotnet.xml Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/52bb84db Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/52bb84db Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/52bb84db Branch: refs/heads/ignite-2893 Commit: 52bb84dba83916ea0b22b793f4359f82e8ee4573 Parents: d76a729 Author: Pavel Tupitsyn Authored: Wed Apr 19 15:07:41 2017 +0300 Committer: Pavel Tupitsyn Committed: Wed Apr 19 15:07:41 2017 +0300 -- assembly/release-fabric-base.xml | 5 config/dotnet/default-dotnet.xml | 45 --- 2 files changed, 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/52bb84db/assembly/release-fabric-base.xml -- diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml index b374ab4..5007785 100644 --- a/assembly/release-fabric-base.xml +++ b/assembly/release-fabric-base.xml @@ -59,11 +59,6 @@ NOTICE / - - -config/dotnet/default-dotnet.xml -/config/dotnet - http://git-wip-us.apache.org/repos/asf/ignite/blob/52bb84db/config/dotnet/default-dotnet.xml -- diff --git a/config/dotnet/default-dotnet.xml b/config/dotnet/default-dotnet.xml deleted file mode 100644 index 897c4e5..000 --- a/config/dotnet/default-dotnet.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - -http://www.springframework.org/schema/beans"; - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd";> - - - - - - - - - - - - - - - - - - -
[54/70] [abbrv] ignite git commit: IGNITE-3524 IGFS: Null file system names are no longer allowed. This closes #1789.
IGNITE-3524 IGFS: Null file system names are no longer allowed. This closes #1789. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1a9b38df Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1a9b38df Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1a9b38df Branch: refs/heads/ignite-2893 Commit: 1a9b38df5eb083c1b03fe1ba381587594f6e79f7 Parents: 3ab6e48 Author: tledkov-gridgain Authored: Wed Apr 19 15:39:26 2017 +0300 Committer: devozerov Committed: Wed Apr 19 15:39:26 2017 +0300 -- .../org/apache/ignite/IgniteFileSystem.java | 2 +- .../configuration/FileSystemConfiguration.java | 8 +- .../org/apache/ignite/internal/IgniteEx.java| 2 +- .../apache/ignite/internal/IgniteKernal.java| 8 +- .../internal/processors/igfs/IgfsAsyncImpl.java | 2 +- .../internal/processors/igfs/IgfsImpl.java | 2 +- .../processors/igfs/IgfsNoopProcessor.java | 4 +- .../internal/processors/igfs/IgfsProcessor.java | 30 ++--- .../processors/igfs/IgfsProcessorAdapter.java | 4 +- .../internal/processors/igfs/IgfsUtils.java | 3 + ...lockMessageSystemPoolStarvationSelfTest.java | 8 +- .../processors/igfs/IgfsIgniteMock.java | 2 +- .../igfs/IgfsProcessorValidationSelfTest.java | 19 ++- .../junits/multijvm/IgniteProcessProxy.java | 2 +- .../hadoop/igfs/HadoopIgfsEndpoint.java | 6 +- .../hadoop/impl/HadoopAbstractSelfTest.java | 4 +- .../impl/HadoopTaskExecutionSelfTest.java | 16 +-- ...opClientProtocolMultipleServersSelfTest.java | 8 +- .../client/HadoopClientProtocolSelfTest.java| 7 +- ...IgniteHadoopFileSystemHandshakeSelfTest.java | 119 +-- 20 files changed, 90 insertions(+), 166 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1a9b38df/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java b/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java index 0100c7b..9c3f9dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java @@ -74,7 +74,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { /** * Gets IGFS name. * - * @return IGFS name, or {@code null} for default file system. + * @return IGFS name. */ public String name(); http://git-wip-us.apache.org/repos/asf/ignite/blob/1a9b38df/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java index d667fe8..af5be3c 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java @@ -202,12 +202,11 @@ public class FileSystemConfiguration { } /** - * Gets IGFS instance name. If {@code null}, then instance with default - * name will be used. + * Gets IGFS instance name. * * @return IGFS instance name. */ -@Nullable public String getName() { +public String getName() { return name; } @@ -218,6 +217,9 @@ public class FileSystemConfiguration { * @return {@code this} for chaining. */ public FileSystemConfiguration setName(String name) { +if (name == null) +throw new IllegalArgumentException("IGFS name cannot be null"); + this.name = name; return this; http://git-wip-us.apache.org/repos/asf/ignite/blob/1a9b38df/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java index e3859c5..164839e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteEx.java @@ -108,7 +108,7 @@ public interface IgniteEx extends Ignite { * @param name IGFS name. * @return IGFS. */ -@Nullable public IgniteFileSystem igfsx(@Nullable String name); +@Nullable public IgniteFileSystem igfsx(String name); /** * Get Hadoop facade. http://git-wip-us.apache.org/repos/asf/ignite/blob/1a9b38df/modules/core/src/main/java/org/apache/ignite/in
[27/70] [abbrv] ignite git commit: master Fixed Visor tests. (cherry picked from commit 36a6cd0)
master Fixed Visor tests. (cherry picked from commit 36a6cd0) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8ea9f83c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8ea9f83c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8ea9f83c Branch: refs/heads/ignite-2893 Commit: 8ea9f83ce7f21f6ba50c0c644f62319f25b56ebd Parents: 43d6d7e Author: Alexey Kuznetsov Authored: Tue Apr 18 20:39:58 2017 +0700 Committer: Alexey Kuznetsov Committed: Tue Apr 18 20:56:23 2017 +0700 -- .../ignite/visor/commands/open/VisorOpenCommandSpec.scala | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/8ea9f83c/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/open/VisorOpenCommandSpec.scala -- diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/open/VisorOpenCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/open/VisorOpenCommandSpec.scala index 4cf2204..f00ff55 100644 --- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/open/VisorOpenCommandSpec.scala +++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/open/VisorOpenCommandSpec.scala @@ -29,10 +29,8 @@ class VisorOpenCommandSpec extends VisorRuntimeBaseSpec(3) { visor.mlist() } -it("should print error message when already connected") { -intercept[IgniteException] { -openVisor() -} +it("should reopen when already connected") { +openVisor() } } }
[28/70] [abbrv] ignite git commit: IGNITE-4954 - Configurable expiration timeout for Cassandra session. This closes #1785.
IGNITE-4954 - Configurable expiration timeout for Cassandra session. This closes #1785. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/735ce60d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/735ce60d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/735ce60d Branch: refs/heads/ignite-2893 Commit: 735ce60da02ebadc43aaa29cc97d331b8056df36 Parents: 36a6cd0 Author: Valentin Kulichenko Authored: Thu Apr 13 11:29:30 2017 +0300 Committer: Andrey V. Mashenkov Committed: Tue Apr 18 16:59:50 2017 +0300 -- .../store/cassandra/datasource/DataSource.java | 50 ++-- .../cassandra/session/CassandraSessionImpl.java | 23 + .../cassandra/session/pool/SessionPool.java | 6 +-- .../cassandra/session/pool/SessionWrapper.java | 15 +++--- 4 files changed, 62 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/735ce60d/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/datasource/DataSource.java -- diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/datasource/DataSource.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/datasource/DataSource.java index 1ba3c7d..754d902 100644 --- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/datasource/DataSource.java +++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/datasource/DataSource.java @@ -17,6 +17,16 @@ package org.apache.ignite.cache.store.cassandra.datasource; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; import com.datastax.driver.core.AuthProvider; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.ConsistencyLevel; @@ -31,25 +41,13 @@ import com.datastax.driver.core.policies.LoadBalancingPolicy; import com.datastax.driver.core.policies.ReconnectionPolicy; import com.datastax.driver.core.policies.RetryPolicy; import com.datastax.driver.core.policies.SpeculativeExecutionPolicy; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Serializable; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; - import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.cache.store.cassandra.session.CassandraSession; import org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.internal.util.typedef.internal.U; /** * Data source abstraction to specify configuration of the Cassandra session to be used. @@ -64,6 +62,9 @@ public class DataSource implements Externalizable { */ private static final UUID NULL_OBJECT = UUID.fromString("45ffae47-3193-5910-84a2-048fe65735d9"); +/** Default expiration timeout for Cassandra driver session. */ +public static final long DFLT_SESSION_EXPIRATION_TIMEOUT = 30; // 5 minutes. + /** Number of rows to immediately fetch in CQL statement execution. */ private Integer fetchSize; @@ -141,6 +142,9 @@ public class DataSource implements Externalizable { /** Netty options to use for connection. */ private NettyOptions nettyOptions; +/** Expiration timeout for Cassandra driver session. */ +private long sessionExpirationTimeout = DFLT_SESSION_EXPIRATION_TIMEOUT; + /** Cassandra session wrapper instance. */ private volatile CassandraSession ses; @@ -460,6 +464,23 @@ public class DataSource implements Externalizable { } /** + * Sets expiration timeout for Cassandra driver session. Idle sessions that are not + * used during this timeout value will be automatically closed and recreated later + * on demand. + * + * If set to {@code 0}, timeout is disabled. + * + * Default value is {@link #DFLT_SESSION_EXPIRATION_TIMEOUT}. + * + * @param sessionExpirationTimeout Expiration timeout for Cassandra driver session. + */ +public void setSessionExpirationTimeout(long sessionExpirationTimeout) { +this.sessionExpirationTimeout = sessionExpirationTimeout; + +invalidate(); +} + +
[63/70] [abbrv] ignite git commit: IGNITE-5033: Improved CREATE/DROP INDEX tests. This closes #1835.
IGNITE-5033: Improved CREATE/DROP INDEX tests. This closes #1835. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2c37effe Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2c37effe Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2c37effe Branch: refs/heads/ignite-2893 Commit: 2c37effe46de8afd22378c71bd7260fd0f79cddd Parents: 0cb2c92 Author: devozerov Authored: Wed Apr 19 21:43:44 2017 +0300 Committer: devozerov Committed: Wed Apr 19 21:43:44 2017 +0300 -- .../processors/query/h2/IgniteH2Indexing.java | 2 +- .../query/h2/ddl/DdlStatementsProcessor.java| 19 +- .../cache/index/AbstractSchemaSelfTest.java | 8 +- .../DynamicIndexAbstractBasicSelfTest.java | 186 +++ .../index/DynamicIndexAbstractSelfTest.java | 35 +--- 5 files changed, 177 insertions(+), 73 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2c37effe/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 4f0a9f9..87b0d00 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -1717,7 +1717,7 @@ public class IgniteH2Indexing implements GridQueryIndexing { if (DdlStatementsProcessor.isDdlStatement(prepared)) { try { -return ddlProc.runDdlStatement(stmt); +return ddlProc.runDdlStatement(sqlQry, stmt); } catch (IgniteCheckedException e) { throw new IgniteSQLException("Failed to execute DDL statement [stmt=" + sqlQry + ']', e); http://git-wip-us.apache.org/repos/asf/ignite/blob/2c37effe/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java index 5b4b494..949ea6a 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java @@ -71,10 +71,11 @@ public class DdlStatementsProcessor { /** * Execute DDL statement. * + * @param sql SQL. * @param stmt H2 statement to parse and execute. */ @SuppressWarnings("unchecked") -public QueryCursor> runDdlStatement(PreparedStatement stmt) +public QueryCursor> runDdlStatement(String sql, PreparedStatement stmt) throws IgniteCheckedException { assert stmt instanceof JdbcPreparedStatement; @@ -99,8 +100,8 @@ public class DdlStatementsProcessor { GridH2Table tbl = idx.dataTable(createIdx.schemaName(), createIdx.tableName()); if (tbl == null) -throw new IgniteSQLException("Table not found [schemaName=" + createIdx.schemaName() + ", " + -"tblName=" + createIdx.tableName() + ']', IgniteQueryErrorCode.TABLE_NOT_FOUND); +throw new SchemaOperationException(SchemaOperationException.CODE_TABLE_NOT_FOUND, +createIdx.tableName()); assert tbl.rowDescriptor() != null; @@ -111,8 +112,7 @@ public class DdlStatementsProcessor { GridQueryProperty prop = typeDesc.property(e.getKey()); if (prop == null) -throw new IgniteSQLException("Property not found [typeName=" + typeDesc.name() + ", propName=" + -e.getKey() + ']'); +throw new SchemaOperationException(SchemaOperationException.CODE_COLUMN_NOT_FOUND, e.getKey()); flds.put(prop.name(), e.getValue()); } @@ -129,8 +129,8 @@ public class DdlStatementsProcessor { fut = ctx.query().dynamicIndexDrop(spaceName, dropIdx.name(), dropIdx.ifExists()); } else -throw new IgniteSQLException("Unexpected DDL operation [type=" + gridStmt.getClass() + ']', -
[08/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java deleted file mode 100644 index 66fe9b4..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java +++ /dev/null @@ -1,126 +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.math.impls.storage.matrix; - -import org.apache.ignite.Ignite; -import org.apache.ignite.internal.util.IgniteUtils; -import org.apache.ignite.math.StorageConstants; -import org.apache.ignite.math.impls.MathTestConstants; -import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import org.apache.ignite.testframework.junits.common.GridCommonTest; - -/** - * Tests for {@link SparseDistributedMatrixStorage}. - */ -@GridCommonTest(group = "Distributed Models") -public class SparseDistributedMatrixStorageTest extends GridCommonAbstractTest { -/** Number of nodes in grid */ -private static final int NODE_COUNT = 3; -/** Cache name. */ -private static final String CACHE_NAME = "test-cache"; -/** */ -private static final String UNEXPECTED_ATTRIBUTE_VALUE = "Unexpected attribute value."; -/** Grid instance. */ -private Ignite ignite; - -/** - * Default constructor. - */ -public SparseDistributedMatrixStorageTest() { -super(false); -} - -/** {@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(); -} - -/** - * {@inheritDoc} - */ -@Override protected void beforeTest() throws Exception { -ignite = grid(NODE_COUNT); - -ignite.configuration().setPeerClassLoadingEnabled(true); -} - -/** {@inheritDoc} */ -@Override protected void afterTest() throws Exception { -ignite.destroyCache(CACHE_NAME); -} - -/** */ -public void testCacheCreation() throws Exception { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -assertNotNull("SparseDistributedMatrixStorage cache is null.", storage.cache()); -} - -/** */ -public void testSetGet() throws Exception { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -for (int i = 0; i < rows; i++) { -for (int j = 0; j < cols; j++) { -double v = Math.random(); -storage.set(i, j, v); - -assert Double.compare(v, storage.get(i, j)) == 0; -assert Double.compare(v, storage.get(i, j)) == 0; -} -} -} - -/** */ -public void testAttributes() { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -assertEqu
[13/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/package-info.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/package-info.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/package-info.java new file mode 100644 index 000..e0a760c --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/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 specific implementations for matrix storage models. + */ +package org.apache.ignite.ml.math.impls.storage.matrix; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/vector/ArrayVectorStorage.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/vector/ArrayVectorStorage.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/vector/ArrayVectorStorage.java new file mode 100644 index 000..dc23611 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/vector/ArrayVectorStorage.java @@ -0,0 +1,135 @@ +/* + * 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.math.impls.storage.vector; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Arrays; +import org.apache.ignite.ml.math.VectorStorage; + +/** + * Array based {@link VectorStorage} implementation. + */ +public class ArrayVectorStorage implements VectorStorage { +/** Backing data array. */ +private double[] data; + +/** + * IMPL NOTE required by {@link Externalizable}. + */ +public ArrayVectorStorage() { +// No-op. +} + +/** + * @param size Vector size. + */ +public ArrayVectorStorage(int size) { +assert size > 0; + +data = new double[size]; +} + +/** + * @param data Backing data array. + */ +public ArrayVectorStorage(double[] data) { +assert data != null; + +this.data = data; +} + +/** {@inheritDoc} */ +@Override public int size() { +return data == null ? 0 : data.length; +} + +/** {@inheritDoc} */ +@Override public double get(int i) { +return data[i]; +} + +/** {@inheritDoc} */ +@Override public void set(int i, double v) { +data[i] = v; +} + +/** {@inheritDoc}} */ +@Override public boolean isArrayBased() { +return true; +} + +/** {@inheritDoc} */ +@Override public double[] data() { +return data; +} + +/** {@inheritDoc} */ +@Override public boolean isSequentialAccess() { +return true; +} + +/** {@inheritDoc} */ +@Override public boolean isDense() { +return true; +} + +/** {@inheritDoc} */ +@Override public boolean isRandomAccess() { +return true; +} + +/** {@inheritDoc} */ +@Override public boolean isDistributed() { +return false; +} + +/** {@inheritDoc} */ +@Override public void writeExternal(ObjectOutput out) throws IOException { +out
[44/70] [abbrv] ignite git commit: IGNITE-4993 - Fixing distributed joins on segmented index.
IGNITE-4993 - Fixing distributed joins on segmented index. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/800b8bd9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/800b8bd9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/800b8bd9 Branch: refs/heads/ignite-2893 Commit: 800b8bd90033ab64f4299ba242cc89b1f4c98417 Parents: 2ded758 Author: Alexey Goncharuk Authored: Wed Apr 19 13:55:02 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 13:55:35 2017 +0300 -- .../query/h2/opt/GridH2IndexBase.java | 31 +++- .../query/IgniteSqlSegmentedIndexSelfTest.java | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/800b8bd9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java index 7163834..0eac559 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java @@ -413,9 +413,7 @@ public abstract class GridH2IndexBase extends BaseIndex { GridCacheContext cctx = getTable().rowDescriptor().context(); -boolean isLocal = qctx.distributedJoinMode() == LOCAL_ONLY; - -return new DistributedLookupBatch(cctx, ucast, affColId, isLocal); +return new DistributedLookupBatch(cctx, ucast, affColId); } /** @@ -1086,9 +1084,6 @@ public abstract class GridH2IndexBase extends BaseIndex { final int affColId; /** */ -private final boolean localQuery; - -/** */ GridH2QueryContext qctx; /** */ @@ -1113,13 +1108,11 @@ public abstract class GridH2IndexBase extends BaseIndex { * @param cctx Cache Cache context. * @param ucast Unicast or broadcast query. * @param affColId Affinity column ID. - * @param localQuery Local query flag. */ -DistributedLookupBatch(GridCacheContext cctx, boolean ucast, int affColId, boolean localQuery) { +DistributedLookupBatch(GridCacheContext cctx, boolean ucast, int affColId) { this.cctx = cctx; this.ucast = ucast; this.affColId = affColId; -this.localQuery = localQuery; } /** @@ -1191,25 +1184,26 @@ public abstract class GridH2IndexBase extends BaseIndex { Object affKey = affColId == -1 ? null : getAffinityKey(firstRow, lastRow); +boolean locQry = localQuery(); + List segmentKeys; -Future fut; if (affKey != null) { // Affinity key is provided. if (affKey == EXPLICIT_NULL) // Affinity key is explicit null, we will not find anything. return false; -segmentKeys = F.asList(rangeSegment(cctx, qctx, affKey, localQuery)); +segmentKeys = F.asList(rangeSegment(cctx, qctx, affKey, locQry)); } else { // Affinity key is not provided or is not the same in upper and lower bounds, we have to broadcast. if (broadcastSegments == null) -broadcastSegments = broadcastSegments(qctx, cctx, localQuery); +broadcastSegments = broadcastSegments(qctx, cctx, locQry); segmentKeys = broadcastSegments; } -if (localQuery && segmentKeys.isEmpty()) +if (locQry && segmentKeys.isEmpty()) return false; // Nothing to do assert !F.isEmpty(segmentKeys) : segmentKeys; @@ -1250,7 +1244,7 @@ public abstract class GridH2IndexBase extends BaseIndex { batchFull = true; } -fut = new DoneFuture<>(segmentKeys.size() == 1 ? +Future fut = new DoneFuture<>(segmentKeys.size() == 1 ? new UnicastCursor(rangeId, segmentKeys, rangeStreams) : new BroadcastCursor(rangeId, segmentKeys, rangeStreams)); @@ -1265,6 +1259,15 @@ public abstract class GridH2IndexBase extends BaseIndex { } /** + * @return {@code True} if local query execution is enforced. + */ +private boolean localQuery() { +assert qctx != null : "Missing query context: " + this; + +return qctx.distributedJoinMode() == LOCAL_ONLY; +} + +
[29/70] [abbrv] ignite git commit: Merge branch 'master' into ignite-2.0
Merge branch 'master' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e7421f2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e7421f2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e7421f2 Branch: refs/heads/ignite-2893 Commit: 9e7421f261354b28119094b3b53b9490fd817b24 Parents: 8ea9f83 735ce60 Author: devozerov Authored: Tue Apr 18 17:04:43 2017 +0300 Committer: devozerov Committed: Tue Apr 18 17:04:43 2017 +0300 -- .../store/cassandra/datasource/DataSource.java | 50 ++-- .../cassandra/session/CassandraSessionImpl.java | 23 + .../cassandra/session/pool/SessionPool.java | 6 +-- .../cassandra/session/pool/SessionWrapper.java | 15 +++--- 4 files changed, 62 insertions(+), 32 deletions(-) --
[57/70] [abbrv] ignite git commit: IGNITE-5018 review and improve javadocs in ML module
IGNITE-5018 review and improve javadocs in ML module Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7b2e3888 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7b2e3888 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7b2e3888 Branch: refs/heads/ignite-2893 Commit: 7b2e38882010776c3ea29662fa25e71da97bd946 Parents: 67d3358 Author: Oleg Ignatenko Authored: Wed Apr 19 17:03:40 2017 +0300 Committer: Anton Vinogradov Committed: Wed Apr 19 17:03:40 2017 +0300 -- .../java/org/apache/ignite/ml/math/Algebra.java | 18 +- .../org/apache/ignite/ml/math/Constants.java| 35 +- .../java/org/apache/ignite/ml/math/Matrix.java | 8 ++--- .../org/apache/ignite/ml/math/MurmurHash.java | 31 .../org/apache/ignite/ml/math/ValueMapper.java | 6 ++-- .../decompositions/CholeskyDecomposition.java | 2 +- .../math/decompositions/EigenDecomposition.java | 23 .../ml/math/decompositions/LUDecomposition.java | 16 ++--- .../ignite/ml/math/functions/Functions.java | 7 ++-- .../functions/IntIntDoubleToVoidFunction.java | 6 +++- .../ml/math/impls/matrix/CacheMatrix.java | 19 +- .../ml/math/impls/matrix/PivotedMatrixView.java | 38 ++-- .../impls/matrix/SparseDistributedMatrix.java | 17 - .../storage/matrix/CacheMatrixStorage.java | 10 +++--- .../matrix/DenseOffHeapMatrixStorage.java | 9 +++-- .../storage/vector/CacheVectorStorage.java | 8 ++--- .../storage/vector/DelegateVectorStorage.java | 12 +-- .../storage/vector/MatrixVectorStorage.java | 27 ++ .../vector/SparseLocalOffHeapVectorStorage.java | 4 ++- .../ml/math/impls/vector/AbstractVector.java| 16 + .../ml/math/impls/vector/CacheVector.java | 10 +++--- .../ml/math/impls/vector/ConstantVector.java| 4 +-- .../ml/math/impls/vector/DelegatingVector.java | 2 +- .../ml/math/impls/vector/MatrixVectorView.java | 12 +++ .../ml/math/impls/vector/PivotedVectorView.java | 23 ++-- .../ml/math/impls/vector/RandomVector.java | 10 +++--- .../math/impls/vector/SingleElementVector.java | 8 ++--- .../impls/vector/SingleElementVectorView.java | 4 +-- .../ml/math/impls/vector/SparseLocalVector.java | 4 +-- .../ml/math/impls/matrix/CacheMatrixTest.java | 4 +-- .../math/impls/vector/AbstractVectorTest.java | 6 ++-- 31 files changed, 224 insertions(+), 175 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7b2e3888/modules/ml/src/main/java/org/apache/ignite/ml/math/Algebra.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/Algebra.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/Algebra.java index a31503f..b13d9fc 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/math/Algebra.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/Algebra.java @@ -250,8 +250,8 @@ public class Algebra extends Constants { * else: {@code (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k)}. * * - * @param n - * @param k + * @param n Size of set. + * @param k Size of subset. * @return Binomial coefficient. */ public static double binomial(double n, long k) { @@ -281,8 +281,8 @@ public class Algebra extends Constants { * {@code k<0}: {@code 0}. {@code k==0 || k==n}: {@code 1}. {@code k==1 || k==n-1}: * {@code n}. else: {@code (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k )}. * - * @param n - * @param k + * @param n Size of set. + * @param k Size of subset. * @return Binomial coefficient. */ public static double binomial(long n, long k) { @@ -328,7 +328,8 @@ public class Algebra extends Constants { * Examples: {@code 1.0 -> 1, 1.2 -> 2, 1.9 -> 2}. This * method is safer than using (long) Math.ceil(value), because of possible rounding error. * - * @param val + * @param val Value for ceil. + * @return Ceil of the given value. */ public static long ceil(double val) { return Math.round(Math.ceil(val)); @@ -428,7 +429,7 @@ public class Algebra extends Constants { /** * Returns {@code log(k!)}. Tries to avoid overflows. For {@code k<30} simply looks up a table in O(1). - * For {@code k>=30} uses stirlings approximation. + * For {@code k>=30} uses Stirling's approximation. * * @param k must hold {@code k >= 0}. */ @@ -549,8 +550,9 @@ public class Algebra extends Constants { /** * Gets sqrt(a^2 + b^2) without under/overflow. * - * @param a - * @param b + * @param a First side value. + * @param b Second side value. + * @retu
[60/70] [abbrv] ignite git commit: ignite-4844 Removed internal async ops queue for atomic cache
ignite-4844 Removed internal async ops queue for atomic cache Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/130b1fde Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/130b1fde Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/130b1fde Branch: refs/heads/ignite-2893 Commit: 130b1fde3e1f9cf1f9685a8144d71d03c7514533 Parents: f923bc9 Author: Konstantin Dudkov Authored: Wed Apr 19 18:34:08 2017 +0300 Committer: sboikov Committed: Wed Apr 19 18:34:08 2017 +0300 -- .../processors/cache/GridCacheAdapter.java | 5 ++- .../dht/atomic/GridDhtAtomicCache.java | 38 .../local/atomic/GridLocalAtomicCache.java | 35 -- 3 files changed, 17 insertions(+), 61 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/130b1fde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index b38e481..a3d4c81 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -4288,6 +4288,7 @@ public abstract class GridCacheAdapter implements IgniteInternalCache IgniteInternalFuture asyncOpAcquire(boolean retry) { @@ -4307,8 +4308,10 @@ public abstract class GridCacheAdapter implements IgniteInternalCachehttp://git-wip-us.apache.org/repos/asf/ignite/blob/130b1fde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 2dacd12..5bbfe14 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -84,7 +84,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx; import org.apache.ignite.internal.processors.timeout.GridTimeoutObject; import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.GridUnsafe; -import org.apache.ignite.internal.util.future.GridEmbeddedFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.nio.GridNioBackPressureControl; import org.apache.ignite.internal.util.nio.GridNioMessageTracker; @@ -102,7 +101,6 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteInClosure; -import org.apache.ignite.lang.IgniteOutClosure; import org.apache.ignite.lang.IgniteRunnable; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.plugin.security.SecurityPermission; @@ -822,39 +820,15 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { if (fail != null) return fail; -FutureHolder holder = lastFut.get(); +IgniteInternalFuture f = op.apply(); -holder.lock(); - -try { -IgniteInternalFuture fut = holder.future(); - -if (fut != null && !fut.isDone()) { -IgniteInternalFuture f = new GridEmbeddedFuture(fut, -new IgniteOutClosure() { -@Override public IgniteInternalFuture apply() { -if (ctx.kernalContext().isStopping()) -return new GridFinishedFuture<>( -new IgniteCheckedException("Operation has been cancelled (node is stopping).")); - -return op.apply(); -} -}); - -saveFuture(holder, f, /*retry*/false); - -return f; +f.listen(new CI1>() { +@Override public void apply(IgniteInternalFuture f) { +asyncOpRelease(/*retry*/false); } +}); -IgniteInternalFuture f = op.apply(); - -saveFuture(holder, f, /*retry*/false); - -return f; -} -finally { -holder.unlock(); -} +
[02/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/RandomVectorConstructorTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/RandomVectorConstructorTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/RandomVectorConstructorTest.java new file mode 100644 index 000..49e1a50 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/RandomVectorConstructorTest.java @@ -0,0 +1,145 @@ +/* + * 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.math.impls.vector; + +import java.util.HashMap; +import java.util.Map; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +/** */ +public class RandomVectorConstructorTest { +/** */ +private static final int IMPOSSIBLE_SIZE = -1; + +/** */ +@Test(expected = UnsupportedOperationException.class) +public void mapInvalidArgsTest() { +assertEquals("Expect exception due to invalid args.", IMPOSSIBLE_SIZE, +new RandomVector(new HashMap() {{ +put("invalid", 99); +}}).size()); +} + +/** */ +@Test(expected = UnsupportedOperationException.class) +public void mapMissingArgsTest() { +final Map test = new HashMap() {{ +put("paramMissing", "whatever"); +}}; + +assertEquals("Expect exception due to missing args.", +-1, new RandomVector(test).size()); +} + +/** */ +@Test(expected = ClassCastException.class) +public void mapInvalidParamTypeTest() { +final Map test = new HashMap() {{ +put("size", "whatever"); +put("fastHash", true); +}}; + +assertEquals("Expect exception due to invalid param type.", IMPOSSIBLE_SIZE, +new RandomVector(test).size()); +} + +/** */ +@Test(expected = AssertionError.class) +public void mapNullTest() { +//noinspection ConstantConditions +assertEquals("Null map args.", IMPOSSIBLE_SIZE, +new RandomVector(null).size()); +} + +/** */ +@Test +public void mapTest() { +assertEquals("Size from args.", 99, +new RandomVector(new HashMap() {{ +put("size", 99); +}}).size()); + +final int test = 99; + +assertEquals("Size from args with fastHash false.", test, +new RandomVector(new HashMap() {{ +put("size", test); +put("fastHash", false); +}}).size()); + +assertEquals("Size from args with fastHash true.", test, +new RandomVector(new HashMap() {{ +put("size", test); +put("fastHash", true); +}}).size()); +} + +/** */ +@Test(expected = AssertionError.class) +public void negativeSizeTest() { +assertEquals("Negative size.", IMPOSSIBLE_SIZE, +new RandomVector(-1).size()); +} + +/** */ +@Test +public void basicTest() { +final int basicSize = 3; + +Vector v1 = new RandomVector(basicSize); + +//noinspection EqualsWithItself +assertTrue("Expect vector to be equal to self", v1.equals(v1)); + +//noinspection ObjectEqualsNull +assertFalse("Expect vector to be not equal to null", v1.equals(null)); + +assertEquals("Size differs from expected", basicSize, v1.size()); + +verifyValues(v1); + +Vector v2 = new RandomVector(basicSize, true); + +assertEquals("Size differs from expected", basicSize, v2.size()); + +verifyValues(v2); + +Vector v3 = new RandomVector(basicSize, false); + +assertEquals("Size differs from expected", basicSize, v3.size()); + +verifyValues(v3); +} + +/** */ +private void verifyValues(Vector v) { +for (Vector.Element
[07/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/RandomVectorConstructorTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/RandomVectorConstructorTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/RandomVectorConstructorTest.java deleted file mode 100644 index 6d4e4f1..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/RandomVectorConstructorTest.java +++ /dev/null @@ -1,145 +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.math.impls.vector; - -import java.util.HashMap; -import java.util.Map; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.exceptions.UnsupportedOperationException; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** */ -public class RandomVectorConstructorTest { -/** */ -private static final int IMPOSSIBLE_SIZE = -1; - -/** */ -@Test(expected = org.apache.ignite.math.exceptions.UnsupportedOperationException.class) -public void mapInvalidArgsTest() { -assertEquals("Expect exception due to invalid args.", IMPOSSIBLE_SIZE, -new RandomVector(new HashMap() {{ -put("invalid", 99); -}}).size()); -} - -/** */ -@Test(expected = UnsupportedOperationException.class) -public void mapMissingArgsTest() { -final Map test = new HashMap() {{ -put("paramMissing", "whatever"); -}}; - -assertEquals("Expect exception due to missing args.", --1, new RandomVector(test).size()); -} - -/** */ -@Test(expected = ClassCastException.class) -public void mapInvalidParamTypeTest() { -final Map test = new HashMap() {{ -put("size", "whatever"); -put("fastHash", true); -}}; - -assertEquals("Expect exception due to invalid param type.", IMPOSSIBLE_SIZE, -new RandomVector(test).size()); -} - -/** */ -@Test(expected = AssertionError.class) -public void mapNullTest() { -//noinspection ConstantConditions -assertEquals("Null map args.", IMPOSSIBLE_SIZE, -new RandomVector(null).size()); -} - -/** */ -@Test -public void mapTest() { -assertEquals("Size from args.", 99, -new RandomVector(new HashMap() {{ -put("size", 99); -}}).size()); - -final int test = 99; - -assertEquals("Size from args with fastHash false.", test, -new RandomVector(new HashMap() {{ -put("size", test); -put("fastHash", false); -}}).size()); - -assertEquals("Size from args with fastHash true.", test, -new RandomVector(new HashMap() {{ -put("size", test); -put("fastHash", true); -}}).size()); -} - -/** */ -@Test(expected = AssertionError.class) -public void negativeSizeTest() { -assertEquals("Negative size.", IMPOSSIBLE_SIZE, -new RandomVector(-1).size()); -} - -/** */ -@Test -public void basicTest() { -final int basicSize = 3; - -Vector v1 = new RandomVector(basicSize); - -//noinspection EqualsWithItself -assertTrue("Expect vector to be equal to self", v1.equals(v1)); - -//noinspection ObjectEqualsNull -assertFalse("Expect vector to be not equal to null", v1.equals(null)); - -assertEquals("Size differs from expected", basicSize, v1.size()); - -verifyValues(v1); - -Vector v2 = new RandomVector(basicSize, true); - -assertEquals("Size differs from expected", basicSize, v2.size()); - -verifyValues(v2); - -Vector v3 = new RandomVector(basicSize, false); - -assertEquals("Size differs from expected", basicSize, v3.size()); - -verifyValues(v3); -} - -/** */ -private void verifyValues(Vector v) { -fo
[25/70] [abbrv] ignite git commit: ignite-4982 Fixed GridIntList.
ignite-4982 Fixed GridIntList. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d60cf53b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d60cf53b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d60cf53b Branch: refs/heads/ignite-2893 Commit: d60cf53bbfae162ac96ec1525bcd1772b8249a79 Parents: 58a8cb2 Author: Konstantin Dudkov Authored: Tue Apr 18 16:50:16 2017 +0300 Committer: sboikov Committed: Tue Apr 18 16:50:16 2017 +0300 -- .../communication/GridIoMessageFactory.java | 8 +- .../ignite/internal/util/GridIntList.java | 5 +- ...ClientWriteBehindStoreNonCoalescingTest.java | 13 +- .../testsuites/IgniteUtilSelfTestSuite.java | 2 + .../apache/ignite/util/GridIntListSelfTest.java | 153 +++ 5 files changed, 167 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d60cf53b/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 e1c9511..b972a31 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 @@ -36,7 +36,6 @@ import org.apache.ignite.internal.managers.eventstorage.GridEventStorageMessage; import org.apache.ignite.internal.pagemem.snapshot.SnapshotFinishedMessage; import org.apache.ignite.internal.pagemem.snapshot.SnapshotProgressMessage; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; -import org.apache.ignite.internal.processors.cache.GridChangeGlobalStateMessageResponse; import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection; import org.apache.ignite.internal.processors.cache.CacheEntryPredicateContainsValue; import org.apache.ignite.internal.processors.cache.CacheEntrySerializablePredicate; @@ -46,6 +45,7 @@ import org.apache.ignite.internal.processors.cache.CacheObjectByteArrayImpl; import org.apache.ignite.internal.processors.cache.CacheObjectImpl; import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo; import org.apache.ignite.internal.processors.cache.GridCacheReturn; +import org.apache.ignite.internal.processors.cache.GridChangeGlobalStateMessageResponse; import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl; import org.apache.ignite.internal.processors.cache.binary.MetadataRequestMessage; import org.apache.ignite.internal.processors.cache.binary.MetadataResponseMessage; @@ -144,6 +144,7 @@ import org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQuery import org.apache.ignite.internal.processors.rest.handlers.task.GridTaskResultRequest; import org.apache.ignite.internal.processors.rest.handlers.task.GridTaskResultResponse; import org.apache.ignite.internal.util.GridByteArrayList; +import org.apache.ignite.internal.util.GridIntList; import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.GridMessageCollection; import org.apache.ignite.internal.util.UUIDCollectionMessage; @@ -176,6 +177,11 @@ public class GridIoMessageFactory implements MessageFactory { Message msg = null; switch (type) { +case -52: +msg = new GridIntList(); + +break; + case -51: msg = new NearCacheUpdates(); http://git-wip-us.apache.org/repos/asf/ignite/blob/d60cf53b/modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java index 1de8106..968b88e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java @@ -132,8 +132,7 @@ public class GridIntList implements Message, Externalizable { for (int i = 0; i < idx; i++) { int element = arr[i]; -int elementHash = (int)(element ^ (element >>> 32)); -res = 31 * res + elementHash; +res = 31 * res + element; } return res; @@ -577,7 +576,7 @@ public class GridIntList implements Message, Externalizable { /** {@inheritDoc} */ @Override public short directType() { -
[61/70] [abbrv] ignite git commit: IGNITE-5027: Fixed issue with duplicate names on quto-generated indexes. This closes #1831.
IGNITE-5027: Fixed issue with duplicate names on quto-generated indexes. This closes #1831. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1cd3cac5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1cd3cac5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1cd3cac5 Branch: refs/heads/ignite-2893 Commit: 1cd3cac534403172145481310b597b6175306222 Parents: 130b1fd Author: devozerov Authored: Wed Apr 19 19:44:30 2017 +0300 Committer: devozerov Committed: Wed Apr 19 19:44:30 2017 +0300 -- .../configuration/CacheConfiguration.java | 17 ++-- .../processors/query/GridQueryProcessor.java| 10 +-- .../query/h2/H2IndexingAbstractGeoSelfTest.java | 8 +- .../IgniteCacheAbstractFieldsQuerySelfTest.java | 10 ++- .../index/DuplicateKeyValueClassesSelfTest.java | 94 .../IgniteCacheQuerySelfTestSuite.java | 4 + 6 files changed, 126 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/1cd3cac5/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java index a2f7cc8..d378343 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java @@ -2145,7 +2145,7 @@ public class CacheConfiguration extends MutableConfiguration { // properties override will happen properly (first parent, then children). type.addProperty(prop, key, true); -processAnnotation(key, sqlAnn, txtAnn, field.getType(), prop, type); +processAnnotation(key, sqlAnn, txtAnn, cls, c, field.getType(), prop, type); } } @@ -2171,7 +2171,7 @@ public class CacheConfiguration extends MutableConfiguration { // properties override will happen properly (first parent, then children). type.addProperty(prop, key, true); -processAnnotation(key, sqlAnn, txtAnn, mtd.getReturnType(), prop, type); +processAnnotation(key, sqlAnn, txtAnn, cls, c, mtd.getReturnType(), prop, type); } } } @@ -2183,20 +2183,25 @@ public class CacheConfiguration extends MutableConfiguration { * @param key If given class relates to key. * @param sqlAnn SQL annotation, can be {@code null}. * @param txtAnn H2 text annotation, can be {@code null}. - * @param cls Class of field or return type for method. + * @param cls Entity class. + * @param curCls Current entity class. + * @param fldCls Class of field or return type for method. * @param prop Current property. * @param desc Class description. */ private static void processAnnotation(boolean key, QuerySqlField sqlAnn, QueryTextField txtAnn, -Class cls, ClassProperty prop, TypeDescriptor desc) { +Class cls, Class curCls, Class fldCls, ClassProperty prop, TypeDescriptor desc) { if (sqlAnn != null) { -processAnnotationsInClass(key, cls, desc, prop); +processAnnotationsInClass(key, fldCls, desc, prop); if (!sqlAnn.name().isEmpty()) prop.alias(sqlAnn.name()); if (sqlAnn.index()) { -String idxName = prop.alias() + "_idx"; +String idxName = curCls.getSimpleName() + "_" + prop.alias() + "_idx"; + +if (cls != curCls) +idxName = cls.getSimpleName() + "_" + idxName; desc.addIndex(idxName, QueryUtils.isGeometryClass(prop.type()) ? QueryIndexType.GEOSPATIAL : QueryIndexType.SORTED); http://git-wip-us.apache.org/repos/asf/ignite/blob/1cd3cac5/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 ceb139a..8381882 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 @@ -685,15 +685,15 @@ public class GridQueryProcessor extends GridProcessorAdapter { QueryTypeDescriptorImpl oldDesc =
[31/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java new file mode 100644 index 000..d2a2f49 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java @@ -0,0 +1,921 @@ +/* + * 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.index; + +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.Ignition; +import org.apache.ignite.binary.BinaryObject; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cache.QueryIndex; +import org.apache.ignite.cache.query.SqlQuery; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.processors.query.GridQueryProcessor; +import org.apache.ignite.internal.processors.query.QueryIndexDescriptorImpl; +import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing; +import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitor; +import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; +import org.apache.ignite.internal.util.typedef.T2; +import org.jetbrains.annotations.Nullable; + +import javax.cache.Cache; +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Concurrency tests for dynamic index create/drop. + */ +@SuppressWarnings("unchecked") +public abstract class DynamicIndexAbstractConcurrentSelfTest extends DynamicIndexAbstractSelfTest { +/** Test duration. */ +private static final long TEST_DUR = 10_000L; + +/** Large cache size. */ +private static final int LARGE_CACHE_SIZE = 100_000; + +/** Latches to block certain index operations. */ +private static final ConcurrentHashMap> BLOCKS = new ConcurrentHashMap<>(); + +/** Cache mode. */ +private final CacheMode cacheMode; + +/** Atomicity mode. */ +private final CacheAtomicityMode atomicityMode; + +/** + * Constructor. + * + * @param cacheMode Cache mode. + * @param atomicityMode Atomicity mode. + */ +protected DynamicIndexAbstractConcurrentSelfTest(CacheMode cacheMode, CacheAtomicityMode atomicityMode) { +this.cacheMode = cacheMode; +this.atomicityMode = atomicityMode; +} + +/** {@inheritDoc} */ +@Override protected void beforeTest() throws Exception { +super.beforeTest(); + +GridQueryProcessor.idxCls = BlockingIndexing.class; +} + +/** {@inheritDoc} */ +@Override protected void afterTest() throws Exception { +GridQueryProcessor.idxCls = null; + +for (T2 block : BLOCKS.values()) +block.get1().countDown(); + +BLOCKS.clear(); + +stopAllGrids(); + +super.afterTest(); +} + +/** {@inheritDoc} */ +@Override protected long getTestTimeout() { +return 5 * 60 * 1000L; +} + +/** {@inheritDoc} */ +@Override protected CacheConfiguration cacheConfiguration() { +CacheConfiguration ccfg = super.cacheConfiguration(); + +return ccfg.setCacheMode(cacheMode).setAtomicityMode(atomicityMode); +} + +/** + * Make sure that coordinator migrates correctly between nodes. + * + * @thro
[21/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/functions/Functions.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/functions/Functions.java b/modules/ml/src/main/java/org/apache/ignite/math/functions/Functions.java deleted file mode 100644 index 7100908..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/functions/Functions.java +++ /dev/null @@ -1,136 +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.math.functions; - -/** - * Compatibility with Apache Mahout. - */ -public final class Functions { -/** Function that returns {@code Math.abs(a)}. */ -public static final IgniteDoubleFunction ABS = Math::abs; - -/** Function that returns its argument. */ -public static final IgniteDoubleFunction IDENTITY = (a) -> a; - -/** Function that returns {@code Math.log(a) / Math.log(2)}. */ -public static final IgniteDoubleFunction LOG2 = (a) -> Math.log(a) * 1.4426950408889634; - -/** Function that returns {@code -a}. */ -public static final IgniteDoubleFunction NEGATE = (a) -> -a; - -/** Function that returns {@code a < 0 ? -1 : a > 0 ? 1 : 0 }. */ -public static final IgniteDoubleFunction SIGN = (a) -> a < 0.0 ? -1.0 : a > 0.0 ? 1.0 : 0.0; - -/** Function that returns {@code a * a}. */ -public static final IgniteDoubleFunction SQUARE = (a) -> a * a; - -/** Function that returns {@code 1 / (1 + exp(-a) } */ -public static final IgniteDoubleFunction SIGMOID = (a) -> 1.0 / (1.0 + Math.exp(-a)); - -/** Function that returns {@code 1 / a } */ -public static final IgniteDoubleFunction INV = (a) -> 1.0 / a; - -/** Function that returns {@code a * (1-a) } */ -public static final IgniteDoubleFunction SIGMOIDGRADIENT = (a) -> a * (1.0 - a); - -/** Function that returns {@code a % b}. */ -public static final IgniteBiFunction MOD = (a, b) -> a % b; - -/** Function that returns {@code a * b}. */ -public static final IgniteBiFunction MULT = (a, b) -> a * b; - -/** Function that returns {@code Math.log(a) / Math.log(b)}. */ -public static final IgniteBiFunction LG = (a, b) -> Math.log(a) / Math.log(b); - -/** Function that returns {@code a + b}. */ -public static final IgniteBiFunction PLUS = (a, b) -> a + b; - -/** Function that returns {@code a - b}. */ -public static final IgniteBiFunction MINUS = (a, b) -> a - b; - -/** Function that returns {@code abs(a - b)}. */ -public static final IgniteBiFunction MINUS_ABS = (a, b) -> Math.abs(a - b); - -/** Function that returns {@code max(abs(a), abs(b))}. */ -public static final IgniteBiFunction MAX_ABS = (a, b) -> Math.max(Math.abs(a), Math.abs(b)); - -/** Function that returns {@code min(abs(a), abs(b))}. */ -public static final IgniteBiFunction MIN_ABS = (a, b) -> Math.min(Math.abs(a), Math.abs(b)); - -/** Function that returns {@code Math.abs(a) + Math.abs(b)}. */ -public static final IgniteBiFunction PLUS_ABS = (a, b) -> Math.abs(a) + Math.abs(b); - -/** Function that returns {@code (a - b) * (a - b)} */ -public static final IgniteBiFunction MINUS_SQUARED = (a, b) -> (a - b) * (a - b); - -/** - * Function that returns {@code a < b ? -1 : a > b ? 1 : 0}. - */ -public static final IgniteBiFunction COMPARE = (a, b) -> a < b ? -1.0 : a > b ? 1.0 : 0.0; - -/** - * Function that returns {@code a + b}. {@code a} is a variable, {@code b} is fixed. - * - * @param b - */ -public static IgniteDoubleFunction plus(final double b) { -return (a) -> a + b; -} - -/** - * Function that returns {@code a * b}. {@code a} is a variable, {@code b} is fixed. - * - * @param b - */ -public static IgniteDoubleFunction mult(final double b) { -return (a) -> a * b; -} - -/** Function that returns {@code a / b}. {@code a} is a variable, {@code b} is fixed. */ -public static IgniteDoubleFunction div(double b) { -return mult(1 / b); -} - -/** - * Function that returns {@code a +
[58/70] [abbrv] ignite git commit: Fixed hang in testJoinExchangeBecomeCoordinator.
Fixed hang in testJoinExchangeBecomeCoordinator. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b1822da3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b1822da3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b1822da3 Branch: refs/heads/ignite-2893 Commit: b1822da3d29951d727f91c9dedc91e168f727e26 Parents: 7b2e388 Author: sboikov Authored: Wed Apr 19 17:53:28 2017 +0300 Committer: sboikov Committed: Wed Apr 19 17:53:28 2017 +0300 -- .../cache/distributed/CacheLateAffinityAssignmentTest.java| 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b1822da3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java index 5ecc5aa..a74117c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java @@ -1101,13 +1101,12 @@ public class CacheLateAffinityAssignmentTest extends GridCommonAbstractTest { U.sleep(5000); for (int i = 0; i < NODES; i++) -stopGrid(i); +stopGrid(getTestIgniteInstanceName(i), false, false); return null; } }, "stop-thread"); - latch.countDown(); Ignite node = startGrid(NODES);
[49/70] [abbrv] ignite git commit: IGNITE-5001 .NET: Tests cleanup
http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/SerializableClosureTaskTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/SerializableClosureTaskTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/SerializableClosureTaskTest.cs index 8db4876..9f1ae68 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/SerializableClosureTaskTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/SerializableClosureTaskTest.cs @@ -25,6 +25,7 @@ namespace Apache.Ignite.Core.Tests.Compute /// /// Closure execution tests for serializable objects. /// +[TestFixture] public class SerializableClosureTaskTest : ClosureTaskTest { /// http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs index 32a28a7..8d23fc4 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskAdapterTest.cs @@ -100,12 +100,6 @@ namespace Apache.Ignite.Core.Tests.Compute } } -/** */ -protected override ICollection GetBinaryTypes() -{ -return new[] { typeof(BinarizableJob) }; -} - /// /// Test task. /// http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs index 289b68b..2fb698f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/TaskResultTest.cs @@ -154,18 +154,6 @@ namespace Apache.Ignite.Core.Tests.Compute Assert.AreEqual(101 * 1024, res.Length); } -/** */ -protected override ICollection GetBinaryTypes() -{ -return new[] -{ -typeof(BinarizableResult), -typeof(TestBinarizableJob), -typeof(BinarizableOutFunc), -typeof(BinarizableFunc) -}; -} - [Test] public void TestOutFuncResultPrimitive1() { http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTest.cs index 33c7704..eb025f6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Dataload/DataStreamerTest.cs @@ -25,8 +25,6 @@ namespace Apache.Ignite.Core.Tests.Dataload using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Datastream; -using Apache.Ignite.Core.Impl; -using Apache.Ignite.Core.Tests.Cache; using NUnit.Framework; /// @@ -34,9 +32,6 @@ namespace Apache.Ignite.Core.Tests.Dataload /// public sealed class DataStreamerTest { -/** Node name. */ -private const string GridName = "grid"; - /** Cache name. */ private const string CacheName = "partitioned"; @@ -52,15 +47,18 @@ namespace Apache.Ignite.Core.Tests.Dataload [TestFixtureSetUp] public void InitClient() { -_grid = Ignition.Start(GetIgniteConfiguration(GridName)); +_grid = Ignition.Start(TestUtils.GetTestConfiguration()); -Ignition.Start(GetIgniteConfiguration(GridName + "_1")); +Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration()) +{ +IgniteInstanceName = "grid1" +}); -_cache = _grid.GetCache(CacheName); +_cache = _grid.CreateCache(CacheName); } /// -/// +/// Fixture teardown. /// [TestFixtureTearDown] public void StopGrids() @@ -458,45 +456,6 @@ namespace Apache.Ignite.Core.Tests.Dataload } /// -/// Gets the Ignite configuration. -/// -/// Grid name. -private
[66/70] [abbrv] ignite git commit: ignite-1561 Fixed tx prepare for cross cache tx with near + colocated cache
ignite-1561 Fixed tx prepare for cross cache tx with near + colocated cache Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a5088265 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5088265 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5088265 Branch: refs/heads/ignite-2893 Commit: a5088265d7927aab702425249b3f0d6996cb989e Parents: badf49c Author: sboikov Authored: Thu Apr 20 08:29:42 2017 +0300 Committer: sboikov Committed: Thu Apr 20 08:29:42 2017 +0300 -- .../cache/GridCacheSharedContext.java | 6 +- .../processors/cache/GridCacheUtils.java| 83 +-- .../distributed/GridDistributedTxMapping.java | 68 +- .../GridDistributedTxRemoteAdapter.java | 2 +- .../cache/distributed/dht/GridDhtTxLocal.java | 2 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 2 + ...arOptimisticSerializableTxPrepareFuture.java | 218 --- .../near/GridNearOptimisticTxPrepareFuture.java | 95 ++-- .../GridNearPessimisticTxPrepareFuture.java | 186 ++-- .../near/GridNearTxFinishFuture.java| 6 +- .../cache/distributed/near/GridNearTxLocal.java | 30 +-- .../near/GridNearTxPrepareFutureAdapter.java| 30 +-- .../cache/transactions/IgniteTxHandler.java | 49 + .../IgniteTxImplicitSingleStateImpl.java| 6 + .../transactions/IgniteTxLocalAdapter.java | 7 +- .../cache/transactions/IgniteTxLocalState.java | 10 + .../cache/transactions/IgniteTxManager.java | 7 +- .../cache/transactions/IgniteTxState.java | 2 +- .../cache/transactions/IgniteTxStateImpl.java | 52 +++-- .../lang/gridfunc/PredicateCollectionView.java | 7 +- .../util/lang/gridfunc/PredicateMapView.java| 6 - .../util/lang/gridfunc/PredicateSetView.java| 6 - .../lang/gridfunc/ReadOnlyCollectionView.java | 6 - .../lang/gridfunc/ReadOnlyCollectionView2X.java | 6 - .../lang/gridfunc/TransformCollectionView.java | 7 +- .../util/lang/gridfunc/TransformMapView.java| 6 - ...sCacheTxNearEnabledRandomOperationsTest.java | 28 +++ .../cache/CrossCacheTxRandomOperationsTest.java | 23 +- .../dht/GridNearCacheTxNodeFailureSelfTest.java | 31 --- .../dht/IgniteCrossCacheTxSelfTest.java | 8 + .../IgniteCacheFailoverTestSuite.java | 2 - .../testsuites/IgniteCacheTestSuite2.java | 2 + 32 files changed, 631 insertions(+), 368 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java index 34bb321..79083e0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java @@ -52,7 +52,7 @@ import org.apache.ignite.internal.processors.cache.transactions.TransactionMetri import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager; import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor; -import org.apache.ignite.internal.util.GridLongList; +import org.apache.ignite.internal.util.GridIntList; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.tostring.GridToStringExclude; @@ -742,7 +742,7 @@ public class GridCacheSharedContext { * @param cacheCtx Cache context. * @return Error message if transactions are incompatible. */ -@Nullable public String verifyTxCompatibility(IgniteInternalTx tx, GridLongList activeCacheIds, +@Nullable public String verifyTxCompatibility(IgniteInternalTx tx, GridIntList activeCacheIds, GridCacheContext cacheCtx) { if (cacheCtx.systemTx() && !tx.system()) return "system cache can be enlisted only in system transaction"; @@ -751,7 +751,7 @@ public class GridCacheSharedContext { return "non-system cache can't be enlisted in system transaction"; for (int i = 0; i < activeCacheIds.size(); i++) { -int cacheId = (int)activeCacheIds.get(i); +int cacheId = activeCacheIds.get(i); GridCacheContext activeCacheCtx = cacheContext(cacheId); http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/
[32/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java index 98d227c..a9c1a20 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java @@ -17,12 +17,10 @@ package org.apache.ignite.internal.processors.query.h2.opt; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Statement; import java.util.ArrayList; -import java.util.Collections; -import java.util.Set; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; @@ -35,11 +33,9 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.KeyCacheObject; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.query.h2.database.H2RowFactory; -import org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex; import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.lang.IgniteBiTuple; -import org.h2.api.TableEngine; import org.h2.command.ddl.CreateTableData; import org.h2.engine.Session; import org.h2.index.Index; @@ -50,7 +46,6 @@ import org.h2.result.SearchRow; import org.h2.result.SortOrder; import org.h2.table.IndexColumn; import org.h2.table.TableBase; -import org.h2.table.TableFilter; import org.h2.value.Value; import org.jetbrains.annotations.Nullable; import org.jsr166.ConcurrentHashMap8; @@ -72,7 +67,10 @@ public class GridH2Table extends TableBase { private final GridH2RowDescriptor desc; /** */ -private final ArrayList idxs; +private volatile ArrayList idxs; + +/** */ +private final Map tmpIdxs = new HashMap<>(); /** */ private final ReadWriteLock lock; @@ -81,7 +79,7 @@ public class GridH2Table extends TableBase { private boolean destroyed; /** */ -private final Set sessions = Collections.newSetFromMap(new ConcurrentHashMap8()); +private final ConcurrentMap sessions = new ConcurrentHashMap8<>(); /** */ private final AtomicReference actualSnapshot = new AtomicReference<>(); @@ -106,11 +104,12 @@ public class GridH2Table extends TableBase { * * @param createTblData Table description. * @param desc Row descriptor. + * @param rowFactory Row factory. * @param idxsFactory Indexes factory. * @param spaceName Space name. */ -public GridH2Table(CreateTableData createTblData, @Nullable GridH2RowDescriptor desc, IndexesFactory idxsFactory, -@Nullable String spaceName) { +public GridH2Table(CreateTableData createTblData, @Nullable GridH2RowDescriptor desc, H2RowFactory rowFactory, +GridH2SystemIndexFactory idxsFactory, @Nullable String spaceName) { super(createTblData); assert idxsFactory != null; @@ -143,18 +142,18 @@ public class GridH2Table extends TableBase { } } +this.rowFactory = rowFactory; + // Indexes must be created in the end when everything is ready. -rowFactory = idxsFactory.createRowFactory(this); -idxs = idxsFactory.createIndexes(this); +idxs = idxsFactory.createSystemIndexes(this); assert idxs != null; // Add scan index at 0 which is required by H2. -if (idxs.size() >= 2 -&& index(0).getIndexType().isHash()) -idxs.add(0, new ScanIndex(index(1), index(0))); +if (idxs.size() >= 2 && index(0).getIndexType().isHash()) +idxs.add(0, new GridH2PrimaryScanIndex(this, index(1), index(0))); else -idxs.add(0, new ScanIndex(index(0), null)); +idxs.add(0, new GridH2PrimaryScanIndex(this, index(0), null)); snapshotEnabled = desc == null || desc.snapshotableIndex(); @@ -238,6 +237,8 @@ public class GridH2Table extends TableBase { desc.guard().begin(); try { +ensureNotDestroyed(); + GridH2AbstractKeyValueRow row = (GridH2AbstractKeyValueRow)pk.findOne(searchRow); if (row == null) @@ -266,13 +267,21 @@ public class GridH2Table extends TableBase { } /** {@inheritDoc} */ -@SuppressWarnings({"LockAcquiredButNotSafelyReleased", "SynchronizationOnLocalVariableOrM
[30/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java new file mode 100644 index 000..85a8837 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java @@ -0,0 +1,39 @@ +/* + * 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.index; + +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; + +/** */ +public class H2DynamicIndexTransactionalReplicatedSelfTest extends H2DynamicIndexAbstractSelfTest { +/** {@inheritDoc} */ +@Override protected CacheMode cacheMode() { +return CacheMode.REPLICATED; +} + +/** {@inheritDoc} */ +@Override protected CacheAtomicityMode atomicityMode() { +return CacheAtomicityMode.TRANSACTIONAL; +} + +/** {@inheritDoc} */ +@Override protected boolean nearCache() { +return false; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java new file mode 100644 index 000..95ad2f1 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java @@ -0,0 +1,589 @@ +/* + * 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.index; + +import org.apache.ignite.IgniteClientDisconnectedException; +import org.apache.ignite.Ignition; +import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl; +import org.apache.ignite.internal.util.lang.GridAbsPredicate; +import org.apache.ignite.internal.util.typedef.F; +import org.apache.ignite.lang.IgniteFuture; +import org.apache.ignite.lang.IgnitePredicate; +import org.apache.ignite.testframework.GridTestUtils; + +import java.util.Collections; +import java.util.Map; + +/** + * Tests for schema exchange between nodes. + */ +public class SchemaExchangeSelfTest extends AbstractSchemaSelfTest { +/** Node on which filter should be applied (if any). */ +private static String filterNodeName; + +/** {@inheritDoc} */ +@Override protected void afterTest() throws Exception { +stopAllGrids(); + +filterNodeName = null; + +super.afterTest(); +} + +/** + * Test propagation o
[10/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java b/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java deleted file mode 100644 index d0b89f8..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java +++ /dev/null @@ -1,120 +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.math.decompositions; - -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.impls.matrix.DenseLocalOnHeapMatrix; -import org.apache.ignite.math.impls.matrix.PivotedMatrixView; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** */ -public class SingularValueDecompositionTest { -/** */ -@Test -public void basicTest() { -basicTest(new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d}, -{0.0d, -1.0d, 2.0d} -})); -} - -/** - * Test for {@link DecompositionSupport} features. - */ -@Test -public void decompositionSupportTest() { -basicTest(new PivotedMatrixView(new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d}, -{0.0d, -1.0d, 2.0d} -}))); -} - -/** */ -@Test -public void rowsLessThanColumnsTest() { -DenseLocalOnHeapMatrix m = new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d} -}); - -SingularValueDecomposition dec = new SingularValueDecomposition(m); -assertEquals("Unexpected value for singular values size.", -2, dec.getSingularValues().length); - -Matrix s = dec.getS(); -Matrix u = dec.getU(); -Matrix v = dec.getV(); -Matrix covariance = dec.getCovariance(0.5); - -assertNotNull("Matrix s is expected to be not null.", s); -assertNotNull("Matrix u is expected to be not null.", u); -assertNotNull("Matrix v is expected to be not null.", v); -assertNotNull("Covariance matrix is expected to be not null.", covariance); - -dec.destroy(); -} - -/** */ -@Test(expected = AssertionError.class) -public void nullMatrixTest() { -new SingularValueDecomposition(null); -} - -/** */ -private void basicTest(Matrix m) { -SingularValueDecomposition dec = new SingularValueDecomposition(m); -assertEquals("Unexpected value for singular values size.", -3, dec.getSingularValues().length); - -Matrix s = dec.getS(); -Matrix u = dec.getU(); -Matrix v = dec.getV(); -Matrix covariance = dec.getCovariance(0.5); - -assertNotNull("Matrix s is expected to be not null.", s); -assertNotNull("Matrix u is expected to be not null.", u); -assertNotNull("Matrix v is expected to be not null.", v); -assertNotNull("Covariance matrix is expected to be not null.", covariance); - -assertTrue("Decomposition cond is expected to be positive.", dec.cond() > 0); -assertTrue("Decomposition norm2 is expected to be positive.", dec.norm2() > 0); -assertEquals("Decomposition rank differs from expected.", 3, dec.rank()); -assertEquals("Decomposition singular values size differs from expected.", -3, dec.getSingularValues().length); - -Matrix recomposed = (u.times(s).times(v.transpose())); - -for (int row = 0; row < m.rowSize(); row++) -for (int col = 0; col < m.columnSize(); col++) -assertEquals("Unexpected recomposed matrix value at (" + row + "," + col + ").", -m.get(row, col), recomposed.get(row, col), 0.001); - -for (int row = 0; row < cov
[15/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/UnsupportedOperationException.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/UnsupportedOperationException.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/UnsupportedOperationException.java new file mode 100644 index 000..0fea255 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/UnsupportedOperationException.java @@ -0,0 +1,44 @@ +/* + * 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.math.exceptions; + +import org.apache.ignite.IgniteException; + +/** + * Indicate that a specific operation is not supported by the underlying implementation. + * In some cases, an operation may be unsupported only in certain cases where, for example, + * it could not be deterministically completed in polynomial time. + */ +public class UnsupportedOperationException extends IgniteException { +/** */ +private static final long serialVersionUID = 0L; + +/** + * @param errMsg Error message. + */ +public UnsupportedOperationException(String errMsg) { +super(errMsg); +} + +/** + * + */ +public UnsupportedOperationException() { +this("Unsupported operation."); +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/package-info.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/package-info.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/package-info.java new file mode 100644 index 000..1990a8a --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/exceptions/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 exceptions for distributed code algebra. + */ +package org.apache.ignite.ml.math.exceptions; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/Functions.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/Functions.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/Functions.java new file mode 100644 index 000..cd48daa --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/functions/Functions.java @@ -0,0 +1,136 @@ +/* + * 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 specif
[18/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java deleted file mode 100644 index 0e9b26f..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java +++ /dev/null @@ -1,140 +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.math.impls.vector; - -import org.apache.ignite.IgniteCache; -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.ValueMapper; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.VectorKeyMapper; -import org.apache.ignite.math.exceptions.UnsupportedOperationException; -import org.apache.ignite.math.functions.IgniteBiFunction; -import org.apache.ignite.math.functions.IgniteDoubleFunction; -import org.apache.ignite.math.functions.IgniteFunction; -import org.apache.ignite.math.impls.CacheUtils; -import org.apache.ignite.math.impls.storage.vector.CacheVectorStorage; - -/** - * Vector based on existing cache and index and value mapping functions. - */ -public class CacheVector extends AbstractVector { -/** - * - */ -public CacheVector() { -// No-op. -} - -/** - * Creates new vector over existing cache. - * - * @param size - * @param cache - * @param keyFunc - * @param valMapper - */ -public CacheVector( -int size, -IgniteCache cache, -VectorKeyMapper keyFunc, -ValueMapper valMapper) { -setStorage(new CacheVectorStorage<>(size, cache, keyFunc, valMapper)); -} - -/** - * @param mapper - */ -private Vector mapOverCache(IgniteFunction mapper) { -CacheVectorStorage sto = storage(); - -CacheUtils.map(sto.cache().getName(), sto.keyMapper(), sto.valueMapper(), mapper); - -return this; -} - -/** {@inheritDoc} */ -@Override public double minValue() { -CacheVectorStorage sto = storage(); - -return CacheUtils.min(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public double maxValue() { -CacheVectorStorage sto = storage(); - -return CacheUtils.max(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public Vector map(IgniteDoubleFunction fun) { -return mapOverCache(fun::apply); -} - -/** {@inheritDoc} */ -@Override public Vector map(IgniteBiFunction fun, double y) { -// TODO: provide cache-optimized implementation. -return super.map(fun, y); // TODO -} - -/** {@inheritDoc} */ -@Override public double sum() { -CacheVectorStorage sto = storage(); - -return CacheUtils.sum(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public Vector assign(double val) { -return mapOverCache((Double d) -> val); -} - -/** {@inheritDoc} */ -@Override public Vector plus(double x) { -return mapOverCache((Double d) -> d + x); -} - -/** {@inheritDoc} */ -@Override public Vector divide(double x) { -return mapOverCache((Double d) -> d / x); -} - -/** {@inheritDoc} */ -@Override public Vector times(double x) { -return mapOverCache((Double d) -> d * x); -} - -/** - * - * - */ -@SuppressWarnings({"unchecked"}) -private CacheVectorStorage storage() { -return (CacheVectorStorage)getStorage(); -} - -/** {@inheritDoc} */ -@Override public Vector like(int crd) { -throw new UnsupportedOperationException(); -} - -/** {@inheritDoc} */ -@Override public Matrix likeMatrix(int rows, int cols) { -throw new UnsupportedOperationException(); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/ConstantVector.java --
[41/70] [abbrv] ignite git commit: Attempt to fix awaitPartitionMapExchange: wait for last exchange completion to avoid races with cache destroy.
Attempt to fix awaitPartitionMapExchange: wait for last exchange completion to avoid races with cache destroy. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d3834843 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d3834843 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d3834843 Branch: refs/heads/ignite-2893 Commit: d38348432a2b8b66999c6410ec4f5c1ef050191d Parents: 36e7e19 Author: sboikov Authored: Wed Apr 19 12:46:31 2017 +0300 Committer: sboikov Committed: Wed Apr 19 12:46:31 2017 +0300 -- .../junits/common/GridCommonAbstractTest.java | 34 1 file changed, 34 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d3834843/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 81f5caf..cef35e5 100644 --- 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 @@ -544,6 +544,27 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest { Set names = new HashSet<>(); +Ignite crd = null; + +for (Ignite g : G.allGrids()) { +ClusterNode node = g.cluster().localNode(); + +if (crd == null || node.order() < crd.cluster().localNode().order()) { +crd = g; + +if (node.order() == 1) +break; +} +} + +if (crd == null) +return; + +AffinityTopologyVersion waitTopVer = ((IgniteKernal)crd).context().discovery().topologyVersionEx(); + +if (waitTopVer.topologyVersion() <= 0) +waitTopVer = new AffinityTopologyVersion(1, 0); + for (Ignite g : G.allGrids()) { if (nodes != null && !nodes.contains(g.cluster().localNode())) continue; @@ -560,6 +581,19 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest { else startTime = g0.context().discovery().gridStartTime(); +IgniteInternalFuture exchFut = + g0.context().cache().context().exchange().affinityReadyFuture(waitTopVer); + +if (exchFut != null && !exchFut.isDone()) { +try { +exchFut.get(timeout); +} +catch (IgniteCheckedException e) { +log.error("Failed to wait for exchange [topVer=" + waitTopVer + +", node=" + g0.name() + ']', e); +} +} + for (IgniteCacheProxy c : g0.context().cache().jcaches()) { CacheConfiguration cfg = c.context().config();
[55/70] [abbrv] ignite git commit: IGNITE-4211 Update Spring dependency to latest stable version
IGNITE-4211 Update Spring dependency to latest stable version Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a51477c0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a51477c0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a51477c0 Branch: refs/heads/ignite-2893 Commit: a51477c0277785db4089467dde9c8da7132a46da Parents: 1a9b38d Author: daradurvs Authored: Wed Apr 19 16:11:56 2017 +0300 Committer: Anton Vinogradov Committed: Wed Apr 19 16:11:56 2017 +0300 -- .../test/config/loaders/grid-cfg-2-grids.xml| 6 +++--- .../apache/ignite/cache/spring/SpringCache.java | 6 ++ .../GridSpringResourceInjectionSelfTest.java| 20 ++-- parent/pom.xml | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml -- diff --git a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml index af4792a..a26423d 100644 --- a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml +++ b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml @@ -28,7 +28,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -61,4 +61,4 @@ - + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java -- diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java index 77b30c5..f35ed2a 100644 --- a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java +++ b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java @@ -18,6 +18,7 @@ package org.apache.ignite.cache.spring; import java.io.Serializable; +import java.util.concurrent.Callable; import org.apache.ignite.IgniteCache; import org.springframework.cache.Cache; import org.springframework.cache.support.SimpleValueWrapper; @@ -82,6 +83,11 @@ class SpringCache implements Cache { } /** {@inheritDoc} */ +@Override public T get(Object key, Callable valLdr) { +throw new UnsupportedOperationException(); +} + +/** {@inheritDoc} */ @Override public ValueWrapper putIfAbsent(Object key, Object val) { Object old; http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java -- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java index e70b49e..827dd72 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java @@ -105,8 +105,8 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest }, anotherGrid, null); assertTrue("Unexpected message: " + err.getMessage(), err.getMessage().startsWith("No qualifying bean of type " + - "[org.apache.ignite.internal.processors.resource.GridSpringResourceInjectionSelfTest$DummyResourceBean]" + -" is defined: expected single matching bean but found 2:")); + "'org.apache.ignite.internal.processors.resource.GridSpringResourceInjectionSelfTest$DummyResourceBean'" + +" available: expected single matching bean but found 2:")); G.stop("anotherGrid", false); } @@ -124,7 +124,7 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest return null; } -}, "No bean named 'nonExistentResource' is defined"); +}, "No bean named 'nonExistentResource' available"); } /** @@ -140,8 +140,8 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest return null; } -}, "No qualifying bean of type [org.apache.ignite.internal.processors.resource." + -"GridSpringResourceInjectionSelfTest$AnotherDummyResourceBean] is defined"); +}, "No qualif
[42/70] [abbrv] ignite git commit: IGNITE-3523 IGFS: Remove "initialize default path modes" feature. This closes #1786.
IGNITE-3523 IGFS: Remove "initialize default path modes" feature. This closes #1786. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/22d5e55b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/22d5e55b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/22d5e55b Branch: refs/heads/ignite-2893 Commit: 22d5e55bee69403c4f9f8da9c113751ce110aa2d Parents: 36e7e19 Author: tledkov-gridgain Authored: Wed Apr 19 12:54:14 2017 +0300 Committer: devozerov Committed: Wed Apr 19 12:54:14 2017 +0300 -- .../configuration/FileSystemConfiguration.java | 54 +--- .../internal/processors/igfs/IgfsImpl.java | 22 +--- .../igfs/IgfsAbstractBaseSelfTest.java | 9 -- .../igfs/IgfsDualAbstractSelfTest.java | 33 - .../processors/igfs/IgfsModesSelfTest.java | 130 --- .../igfs/HadoopFIleSystemFactorySelfTest.java | 12 +- 6 files changed, 14 insertions(+), 246 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/22d5e55b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java index 337506c..d667fe8 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java @@ -76,9 +76,6 @@ public class FileSystemConfiguration { /** Default IPC endpoint enabled flag. */ public static final boolean DFLT_IPC_ENDPOINT_ENABLED = true; -/** Default value of whether to initialize default path modes. */ -public static final boolean DFLT_INIT_DFLT_PATH_MODES = false; - /** Default value of metadata co-location flag. */ public static final boolean DFLT_COLOCATE_META = true; @@ -145,9 +142,6 @@ public class FileSystemConfiguration { /** Maximum range length. */ private long maxTaskRangeLen; -/** Whether to initialize default path modes. */ -private boolean initDfltPathModes = DFLT_INIT_DFLT_PATH_MODES; - /** Metadata co-location flag. */ private boolean colocateMeta = DFLT_COLOCATE_META; @@ -191,7 +185,6 @@ public class FileSystemConfiguration { fragmentizerThrottlingBlockLen = cfg.getFragmentizerThrottlingBlockLength(); fragmentizerThrottlingDelay = cfg.getFragmentizerThrottlingDelay(); secondaryFs = cfg.getSecondaryFileSystem(); -initDfltPathModes = cfg.isInitializeDefaultPathModes(); ipcEndpointCfg = cfg.getIpcEndpointConfiguration(); ipcEndpointEnabled = cfg.isIpcEndpointEnabled(); maxSpace = cfg.getMaxSpaceSize(); @@ -579,15 +572,6 @@ public class FileSystemConfiguration { * * If path doesn't correspond to any specified prefix or mappings are not provided, then * {@link #getDefaultMode()} is used. - * - * If {@link #isInitializeDefaultPathModes()} is set to {@code true}, the following path modes will be created - * by default: - * {@code /ignite/primary} and all it's sub-folders will always work in {@code PRIMARY} mode. - * - * And in case secondary file system URI is provided: - * {@code /ignite/proxy} and all it's sub-folders will always work in {@code PROXY} mode. - * {@code /ignite/sync} and all it's sub-folders will always work in {@code DUAL_SYNC} mode. - * {@code /ignite/async} and all it's sub-folders will always work in {@code DUAL_ASYNC} mode. * * @return Map of paths to {@code IGFS} modes. */ @@ -644,6 +628,7 @@ public class FileSystemConfiguration { * Sets delay in milliseconds for which fragmentizer is paused. * * @param fragmentizerThrottlingDelay Delay in milliseconds. + * @return {@code this} for chaining. */ public FileSystemConfiguration setFragmentizerThrottlingDelay(long fragmentizerThrottlingDelay) { this.fragmentizerThrottlingDelay = fragmentizerThrottlingDelay; @@ -759,43 +744,6 @@ public class FileSystemConfiguration { } /** - * Get whether to initialize default path modes. - * - * When set to {@code true} Ignite will automatically create the following path modes: - * - * {@code /ignite/primary} - will work in {@link IgfsMode#PRIMARY} mode; - * {@code /ignite/sync} - will work in {@link IgfsMode#DUAL_SYNC} mode (only if secondary file system - * is set); - * {@code /ignite/async} - will work in {@link IgfsMode#DUAL_ASYNC} mode (only if secondary file system - * is set); - *
[47/70] [abbrv] ignite git commit: Fixed javadoc.
Fixed javadoc. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fb1dea79 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fb1dea79 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fb1dea79 Branch: refs/heads/ignite-2893 Commit: fb1dea79e6bbdadd5152818276d71b77c5f18942 Parents: 15359bc Author: Andrey V. Mashenkov Authored: Wed Apr 19 06:45:08 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 14:03:21 2017 +0300 -- .../repository/support/IgniteRepositoryFactory.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/fb1dea79/modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java -- diff --git a/modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java b/modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java index bceee1f..de2549f 100644 --- a/modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java +++ b/modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactory.java @@ -153,11 +153,11 @@ public class IgniteRepositoryFactory extends RepositoryFactorySupport { } /** - * @param s - * @return + * @param qry Query string. + * @return {@code true} if query is SQLFieldsQuery. */ -private boolean isFieldQuery(String s) { -return s.matches("^SELECT.*") && !s.matches("^SELECT\\s+(?:\\w+\\.)?+\\*.*"); +private boolean isFieldQuery(String qry) { +return qry.matches("^SELECT.*") && !qry.matches("^SELECT\\s+(?:\\w+\\.)?+\\*.*"); } }
[70/70] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-2893
Merge remote-tracking branch 'remotes/origin/ignite-2.0' into ignite-2893 # Conflicts: # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java # modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java # modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java # modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSemaphoreImpl.java # modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteOnePhaseCommitInvokeTest.java # modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java # modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/89bfbad1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/89bfbad1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/89bfbad1 Branch: refs/heads/ignite-2893 Commit: 89bfbad19b398446320c7e519aa9d6e74d49c037 Parents: 81835e4 Author: sboikov Authored: Thu Apr 20 10:46:58 2017 +0300 Committer: sboikov Committed: Thu Apr 20 10:46:58 2017 +0300 -- .../processors/cache/transactions/IgniteTxEntry.java | 9 - .../datastructures/DataStructuresProcessor.java | 6 +++--- .../datastructures/GridCacheAtomicReferenceImpl.java | 6 -- .../datastructures/GridCacheAtomicStampedImpl.java | 6 -- .../processors/datastructures/GridCacheLockImpl.java | 11 +-- .../datastructures/GridCacheSemaphoreImpl.java | 4 ++-- 6 files changed, 10 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/89bfbad1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java index c9c4f34..163ed99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java @@ -88,15 +88,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message { /** Flag indicating that old value for 'invoke' operation was non null on primary node. */ private static final int TX_ENTRY_OLD_VAL_ON_PRIMARY = 0x04; -/** Skip store flag bit mask. */ -private static final int TX_ENTRY_SKIP_STORE_FLAG_MASK = 0x01; - -/** Keep binary flag. */ -private static final int TX_ENTRY_KEEP_BINARY_FLAG_MASK = 0x02; - -/** Flag indicating that old value for 'invoke' operation was non null on primary node. */ -private static final int TX_ENTRY_OLD_VAL_ON_PRIMARY = 0x04; - /** Prepared flag updater. */ private static final AtomicIntegerFieldUpdater PREPARED_UPD = AtomicIntegerFieldUpdater.newUpdater(IgniteTxEntry.class, "prepared"); http://git-wip-us.apache.org/repos/asf/ignite/blob/89bfbad1/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java index fb1770e..0a439dc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java @@ -629,7 +629,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen * @param name Atomic long name. * @throws IgniteCheckedException If removing failed. */ -public final void removeAtomicLong(final String name) throws IgniteCheckedException { +final void removeAtomicLong(final String name) throws IgniteCheckedException { assert name != null; assert dsCacheCtx != null; @@ -788,7 +788,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen * @param name Atomic reference name. * @throws IgniteCheckedException If removing failed. */ -public final void removeAtomicReference(final String name) throws IgniteCheckedExcepti
[23/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/Matrix.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/Matrix.java b/modules/ml/src/main/java/org/apache/ignite/math/Matrix.java deleted file mode 100644 index ee7a807..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/Matrix.java +++ /dev/null @@ -1,518 +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.math; - -import java.io.Externalizable; -import org.apache.ignite.lang.IgniteUuid; -import org.apache.ignite.math.exceptions.CardinalityException; -import org.apache.ignite.math.exceptions.IndexException; -import org.apache.ignite.math.exceptions.UnsupportedOperationException; -import org.apache.ignite.math.functions.IgniteBiFunction; -import org.apache.ignite.math.functions.IgniteDoubleFunction; -import org.apache.ignite.math.functions.IgniteFunction; -import org.apache.ignite.math.functions.IntIntToDoubleFunction; - -/** - * A matrix interface. - * - * Based on its flavor it can have vastly different implementations tailored for - * for different types of data (e.g. dense vs. sparse), different sizes of data or different operation - * optimizations. - * - * Note also that not all operations can be supported by all underlying implementations. If an operation is not - * supported a {@link UnsupportedOperationException} is thrown. This exception can also be thrown in partial cases - * where an operation is unsupported only in special cases, e.g. where a given operation cannot be deterministically - * completed in polynomial time. - * - * Based on ideas from http://mahout.apache.org/";>Apache Mahout. - */ -public interface Matrix extends MetaAttributes, Externalizable, StorageOpsMetrics, Destroyable { -/** - * Holder for matrix's element. - */ -interface Element { -/** - * Gets element's value. - * - * @return The value of this matrix element. - */ -double get(); - -/** - * Gets element's row index. - * - * @return The row index of this element. - */ -int row(); - -/** - * Gets element's column index. - * - * @return The column index of this element. - */ -int column(); - -/** - * Sets element's value. - * - * @param val Value to set. - */ -void set(double val); -} - -/** - * Gets the maximum value in this matrix. - * - * @return Maximum value in this matrix. - */ -public double maxValue(); - -/** - * Gets the minimum value in this matrix. - * - * @return Minimum value in this matrix. - */ -public double minValue(); - -/** - * Gets the maximum element in this matrix. - * - * @return Maximum element in this matrix. - */ -public Element maxElement(); - -/** - * Gets the minimum element in this matrix. - * - * @return Minimum element in this matrix. - */ -public Element minElement(); - -/** - * Gets the matrix's element at the given coordinates. - * - * @param row Row index. - * @param col Column index. - * @return Element at the given coordinates. - */ -public Element getElement(int row, int col); - -/** - * Swaps two rows in this matrix. - * - * @param row1 Row #1. - * @param row2 Row #2. - * @return This matrix. - */ -public Matrix swapRows(int row1, int row2); - -/** - * Swaps two columns in this matrix. - * - * @param col1 Column #1. - * @param col2 Column #2. - * @return This matrix. - */ -public Matrix swapColumns(int col1, int col2); - -/** - * Assigns given value to all elements of this matrix. - * - * @param val Value to assign to all elements. - * @return This matrix. - */ -public Matrix assign(double val); - -/** - * Assigns given values to this matrix. - * - * @param vals Values to assign. - * @return This matrix. - * @throws CardinalityException Thr
[53/70] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3ab6e481 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3ab6e481 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3ab6e481 Branch: refs/heads/ignite-2893 Commit: 3ab6e481abb4f19389ed51448a596e5dd6d1f232 Parents: f278dc9 52bb84d Author: devozerov Authored: Wed Apr 19 15:13:03 2017 +0300 Committer: devozerov Committed: Wed Apr 19 15:13:03 2017 +0300 -- assembly/release-fabric-base.xml| 5 - config/dotnet/default-dotnet.xml| 45 -- .../Apache.Ignite.Core.Tests.csproj | 7 + .../Binary/BinaryBuilderSelfTest.cs | 3 +- .../BinaryBuilderSelfTestDynamicRegistration.cs | 2 + .../Binary/BinaryBuilderSelfTestSimpleName.cs | 2 + .../Binary/BinaryCompactFooterInteropTest.cs| 4 +- .../BinaryConfigurationTest.cs | 4 +- .../Cache/AddArgCacheEntryProcessor.cs | 91 .../Cache/Affinity/AffinityFunctionTest.cs | 1 - .../Cache/Affinity/AffinityTest.cs | 10 +- .../BinarizableAddArgCacheEntryProcessor.cs | 53 +++ .../Cache/BinarizableTestException.cs | 51 +++ .../Cache/CacheAbstractTest.cs | 422 --- .../Cache/CacheDynamicStartTest.cs | 164 +++ .../Cache/CacheForkedTest.cs| 6 +- .../Cache/CacheTestKey.cs | 68 +++ .../Cache/NonSerializableCacheEntryProcessor.cs | 40 ++ .../Cache/NonSerializableException.cs | 40 ++ .../Cache/Query/CacheQueriesTest.cs | 35 +- .../Continuous/ContinuousQueryAbstractTest.cs | 45 +- .../Continuous/ContinuousQueryJavaFilterTest.cs | 21 +- .../Cache/Store/CacheParallelLoadStoreTest.cs | 9 +- .../Cache/Store/CacheStoreSessionTest.cs| 15 +- .../Cache/Store/CacheStoreTest.cs | 17 +- .../Cache/TestReferenceObject.cs| 40 ++ .../Compute/AbstractTaskTest.cs | 29 +- .../Compute/BinarizableClosureTaskTest.cs | 14 +- .../Compute/BinarizableTaskTest.cs | 15 - .../Compute/ComputeApiTest.cs | 9 +- .../Compute/ComputeApiTestFullFooter.cs | 4 +- .../Compute/FailoverTaskSelfTest.cs | 6 - .../Compute/ResourceTaskTest.cs | 60 +-- .../Compute/SerializableClosureTaskTest.cs | 1 + .../Compute/TaskAdapterTest.cs | 6 - .../Compute/TaskResultTest.cs | 12 - .../Dataload/DataStreamerTest.cs| 55 +-- .../Apache.Ignite.Core.Tests/DeploymentTest.cs | 4 +- .../Apache.Ignite.Core.Tests/EventsTest.cs | 65 +-- .../Apache.Ignite.Core.Tests/ExceptionsTest.cs | 13 +- .../Apache.Ignite.Core.Tests/ExecutableTest.cs | 57 +-- .../Apache.Ignite.Core.Tests/FutureTest.cs | 18 +- .../IgniteStartStopTest.cs | 55 +-- .../Apache.Ignite.Core.Tests/IgniteTestBase.cs | 51 +-- .../Apache.Ignite.Core.Tests/LifecycleTest.cs | 45 +- .../Apache.Ignite.Core.Tests/LoadDllTest.cs | 11 +- .../Apache.Ignite.Core.Tests/MessagingTest.cs | 30 +- .../Impl/Binary/BinaryUtils.cs | 207 +++-- 48 files changed, 748 insertions(+), 1219 deletions(-) --
[33/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/operation/SchemaIndexDropOperation.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/operation/SchemaIndexDropOperation.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/operation/SchemaIndexDropOperation.java new file mode 100644 index 000..da60560 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/operation/SchemaIndexDropOperation.java @@ -0,0 +1,68 @@ +/* + * 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.query.schema.operation; + +import org.apache.ignite.internal.util.typedef.internal.S; + +import java.util.UUID; + +/** + * Schema index drop operation. + */ +public class SchemaIndexDropOperation extends SchemaIndexAbstractOperation { +/** */ +private static final long serialVersionUID = 0L; + +/** Index name. */ +private final String idxName; + +/** Ignore operation if index doesn't exist. */ +private final boolean ifExists; + +/** + * Constructor. + * + * @param opId Operation id. + * @param space Space. + * @param idxName Index name. + * @param ifExists Ignore operation if index doesn't exist. + */ +public SchemaIndexDropOperation(UUID opId, String space, String idxName, boolean ifExists) { +super(opId, space); + +this.idxName = idxName; +this.ifExists = ifExists; +} + +/** {@inheritDoc} */ +@Override public String indexName() { +return idxName; +} + +/** + * @return Ignore operation if index doesn't exist. + */ +public boolean ifExists() { +return ifExists; +} + +/** {@inheritDoc} */ +@Override public String toString() { +return S.toString(SchemaIndexDropOperation.class, this, "parent", super.toString()); +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java index 1545b8c..a060f7e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java @@ -32,6 +32,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.cache.version.GridCacheVersionedEntryEx; import org.apache.ignite.internal.processors.dr.GridDrType; +import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorClosure; import org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter; import org.apache.ignite.internal.util.lang.GridTuple3; import org.jetbrains.annotations.Nullable; @@ -853,6 +854,12 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr } /** {@inheritDoc} */ +@Override public void updateIndex(SchemaIndexCacheVisitorClosure clo, long link) throws IgniteCheckedException, +GridCacheEntryRemovedException { +// No-op. +} + +/** {@inheritDoc} */ @Override public boolean deleted() { return false; } http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java index 77d0ea7..ff6
[59/70] [abbrv] ignite git commit: IGNITE-5010: DDL: additional tests for spatial dynamic indexes.
IGNITE-5010: DDL: additional tests for spatial dynamic indexes. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f923bc91 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f923bc91 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f923bc91 Branch: refs/heads/ignite-2893 Commit: f923bc91fec38ad4e024ae1b395c5bf9a0a50e12 Parents: b1822da Author: devozerov Authored: Wed Apr 19 17:54:53 2017 +0300 Committer: devozerov Committed: Wed Apr 19 17:54:53 2017 +0300 -- .../h2/GridBinaryH2IndexingGeoSelfTest.java | 35 - .../query/h2/GridH2IndexingGeoSelfTest.java | 470 - .../h2/GridH2IndexingSegmentedGeoSelfTest.java | 37 - .../query/h2/H2IndexingAbstractGeoSelfTest.java | 673 +++ .../query/h2/H2IndexingBinaryGeoSelfTest.java | 30 + .../H2IndexingBinarySegmentedGeoSelfTest.java | 30 + .../query/h2/H2IndexingGeoSelfTest.java | 30 + .../h2/H2IndexingSegmentedGeoSelfTest.java | 30 + .../testsuites/GeoSpatialIndexingTestSuite.java | 16 +- 9 files changed, 802 insertions(+), 549 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f923bc91/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridBinaryH2IndexingGeoSelfTest.java -- diff --git a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridBinaryH2IndexingGeoSelfTest.java b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridBinaryH2IndexingGeoSelfTest.java deleted file mode 100644 index e271712..000 --- a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridBinaryH2IndexingGeoSelfTest.java +++ /dev/null @@ -1,35 +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.internal.processors.query.h2; - -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.internal.binary.BinaryMarshaller; - -/** - * Geo-indexing test for binary mode. - */ -public class GridBinaryH2IndexingGeoSelfTest extends GridH2IndexingGeoSelfTest { -/** {@inheritDoc} */ -@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { -IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - -cfg.setMarshaller(new BinaryMarshaller()); - -return cfg; -} -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f923bc91/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java -- diff --git a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java deleted file mode 100644 index 4404e9c..000 --- a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java +++ /dev/null @@ -1,470 +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.internal.p
[09/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/matrix/MatrixImplementationsTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/matrix/MatrixImplementationsTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/matrix/MatrixImplementationsTest.java deleted file mode 100644 index 28abab7..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/matrix/MatrixImplementationsTest.java +++ /dev/null @@ -1,1113 +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.math.impls.matrix; - -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.function.BiConsumer; -import java.util.function.Supplier; -import org.apache.ignite.math.ExternalizeTest; -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.exceptions.CardinalityException; -import org.apache.ignite.math.exceptions.ColumnIndexException; -import org.apache.ignite.math.exceptions.IndexException; -import org.apache.ignite.math.exceptions.RowIndexException; -import org.apache.ignite.math.exceptions.UnsupportedOperationException; -import org.apache.ignite.math.impls.vector.DenseLocalOffHeapVector; -import org.apache.ignite.math.impls.vector.DenseLocalOnHeapVector; -import org.apache.ignite.math.impls.vector.RandomVector; -import org.apache.ignite.math.impls.vector.SparseLocalVector; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -/** - * Tests for {@link Matrix} implementations. - */ -public class MatrixImplementationsTest extends ExternalizeTest { -/** */ -private static final double DEFAULT_DELTA = 0.1d; - -/** */ -private void consumeSampleMatrix(BiConsumer consumer) { -new MatrixImplementationFixtures().consumeSampleMatrix(consumer); -} - -/** */ -@Test -public void externalizeTest() { -consumeSampleMatrix((m, desc) -> externalizeTest(m)); -} - -/** */ -@Test -public void testLike() { -consumeSampleMatrix((m, desc) -> { -Class cls = likeMatrixType(m); - -if (cls != null) { -Matrix like = m.like(m.rowSize(), m.columnSize()); - -assertEquals("Wrong \"like\" matrix for " + desc + "; Unexpected rows.", like.rowSize(), m.rowSize()); -assertEquals("Wrong \"like\" matrix for " + desc + "; Unexpected columns.", like.columnSize(), m.columnSize()); - -assertEquals("Wrong \"like\" matrix for " + desc -+ "; Unexpected class: " + like.getClass().toString(), -cls, -like.getClass()); - -return; -} - -boolean expECaught = false; - -try { -m.like(1, 1); -} -catch (UnsupportedOperationException uoe) { -expECaught = true; -} - -assertTrue("Expected exception was not caught for " + desc, expECaught); -}); -} - -/** */ -@Test -public void testCopy() { -consumeSampleMatrix((m, desc) -> { -Matrix cp = m.copy(); -assertTrue("Incorrect copy for empty matrix " + desc, cp.equals(m)); - -if (!readOnly(m)) -fillMatrix(m); - -cp = m.copy(); - -assertTrue("Incorrect copy for matrix " + desc, cp.equals(m)); -}); -} - -/** */ -@Test -public void testHaveLikeVector() throws InstantiationException, IllegalAccessException { -for (Class key : likeVectorTypesMap().keySet()) { -Class val = likeVectorTypesMap().get(key); - -if (val == null && !ignore(key)) -System.out.println("Missing test for implementation of likeMatrix for " + key.getSimpleName()); -} -}
[19/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java deleted file mode 100644 index 670deef..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java +++ /dev/null @@ -1,175 +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.math.impls.storage.vector; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.Ignition; -import org.apache.ignite.math.ValueMapper; -import org.apache.ignite.math.VectorKeyMapper; -import org.apache.ignite.math.VectorStorage; - -/** - * Vector storage based on existing cache and index and value mapping functions. - */ -public class CacheVectorStorage implements VectorStorage { -/** Storage size. */ -private int size; -/** Key mapper. */ -private VectorKeyMapper keyMapper; -/** Value mapper. */ -private ValueMapper valMapper; -/** Underlying ignite cache. */ -private IgniteCache cache; - -/** - * - */ -public CacheVectorStorage() { -// No-op. -} - -/** - * @param size - * @param cache - * @param keyMapper - * @param valMapper - */ -public CacheVectorStorage(int size, IgniteCache cache, VectorKeyMapper keyMapper, -ValueMapper valMapper) { -assert size > 0; -assert cache != null; -assert keyMapper != null; -assert valMapper != null; - -this.size = size; -this.cache = cache; -this.keyMapper = keyMapper; -this.valMapper = valMapper; -} - -/** - * - * - */ -public IgniteCache cache() { -return cache; -} - -/** - * - * - */ -public VectorKeyMapper keyMapper() { -return keyMapper; -} - -/** - * - * - */ -public ValueMapper valueMapper() { -return valMapper; -} - -/** {@inheritDoc} */ -@Override public int size() { -return size; -} - -/** {@inheritDoc} */ -@Override public double get(int i) { -return valMapper.toDouble(cache.get(keyMapper.apply(i))); -} - -/** {@inheritDoc} */ -@Override public void set(int i, double v) { -cache.put(keyMapper.apply(i), valMapper.fromDouble(v)); -} - -/** {@inheritDoc} */ -@Override public void writeExternal(ObjectOutput out) throws IOException { -out.writeInt(size); -out.writeObject(keyMapper); -out.writeObject(valMapper); -out.writeUTF(cache.getName()); -} - -/** {@inheritDoc} */ -@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { -size = in.readInt(); -keyMapper = (VectorKeyMapper)in.readObject(); -valMapper = (ValueMapper)in.readObject(); -cache = Ignition.localIgnite().getOrCreateCache(in.readUTF()); -} - -/** {@inheritDoc} */ -@Override public boolean isSequentialAccess() { -return false; -} - -/** {@inheritDoc} */ -@Override public boolean isDense() { -return false; -} - -/** {@inheritDoc} */ -@Override public boolean isRandomAccess() { -return true; -} - -/** {@inheritDoc} */ -@Override public boolean isDistributed() { -return true; -} - -/** {@inheritDoc} */ -@Override public boolean isArrayBased() { -return false; -} - -/** {@inheritDoc} */ -@Override public int hashCode() { -int res = 1; - -res = res * 37 + size(); -res = res * 37 + keyMapper.hashCode(); -res = res * 37 + valMapper.hashCode(); -res = res * 37 + cache.hashCode(); - -return res; -} - -/** {@inheritDoc} */ -@Override public boolean equals(Object obj) { -if (t
[37/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2edb935c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2edb935c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2edb935c Branch: refs/heads/ignite-2893 Commit: 2edb935cbf87198993c403724e26efc655710c25 Parents: 9e7421f Author: devozerov Authored: Tue Apr 18 17:11:34 2017 +0300 Committer: devozerov Committed: Tue Apr 18 17:11:36 2017 +0300 -- .../jdbc2/JdbcAbstractDmlStatementSelfTest.java | 92 +- ...BinaryMarshallerInsertStatementSelfTest.java |9 +- ...cBinaryMarshallerMergeStatementSelfTest.java |9 +- .../jdbc2/JdbcDynamicIndexAbstractSelfTest.java | 367 ...namicIndexAtomicPartitionedNearSelfTest.java | 26 + ...bcDynamicIndexAtomicPartitionedSelfTest.java | 39 + ...dbcDynamicIndexAtomicReplicatedSelfTest.java | 39 + ...dexTransactionalPartitionedNearSelfTest.java | 26 + ...icIndexTransactionalPartitionedSelfTest.java | 39 + ...micIndexTransactionalReplicatedSelfTest.java | 39 + .../jdbc2/JdbcInsertStatementSelfTest.java |4 +- .../jdbc/suite/IgniteJdbcDriverTestSuite.java |8 + .../apache/ignite/IgniteSystemProperties.java |8 + .../org/apache/ignite/cache/QueryEntity.java| 82 +- .../org/apache/ignite/cache/QueryIndex.java |9 + .../configuration/CacheConfiguration.java |7 +- .../apache/ignite/internal/GridComponent.java |5 +- .../ignite/internal/GridKernalContext.java |7 + .../ignite/internal/GridKernalContextImpl.java | 13 +- .../org/apache/ignite/internal/GridTopic.java |5 +- .../apache/ignite/internal/IgniteKernal.java| 27 +- .../org/apache/ignite/internal/IgnitionEx.java | 18 + .../managers/communication/GridIoManager.java |2 + .../communication/GridIoMessageFactory.java |6 + .../managers/communication/GridIoPolicy.java|3 + .../cache/CacheAffinitySharedManager.java |3 +- .../cache/CachePartitionExchangeWorkerTask.java |6 +- .../cache/DynamicCacheChangeRequest.java| 23 +- .../cache/DynamicCacheDescriptor.java | 50 +- .../processors/cache/GridCacheEntryEx.java | 13 +- .../processors/cache/GridCacheMapEntry.java | 17 + .../GridCachePartitionExchangeManager.java | 36 +- .../processors/cache/GridCacheProcessor.java| 135 +- .../cache/GridCacheSharedContext.java |2 + .../GridDhtPartitionsExchangeFuture.java|5 - .../cache/query/GridCacheQueryManager.java |7 +- .../cache/query/IgniteQueryErrorCode.java | 27 +- .../internal/processors/pool/PoolProcessor.java |5 + .../query/GridQueryIndexDescriptor.java |5 + .../processors/query/GridQueryIndexing.java | 43 +- .../processors/query/GridQueryProcessor.java| 1707 -- .../query/GridQueryTypeDescriptor.java |7 + .../processors/query/IgniteSQLException.java|7 + .../query/QueryIndexDescriptorImpl.java | 42 +- .../processors/query/QueryIndexKey.java | 85 + .../internal/processors/query/QuerySchema.java | 168 ++ .../query/QueryTypeDescriptorImpl.java | 150 +- .../internal/processors/query/QueryUtils.java | 219 ++- .../query/schema/SchemaExchangeWorkerTask.java | 53 + .../query/schema/SchemaIndexCacheVisitor.java | 33 + .../schema/SchemaIndexCacheVisitorClosure.java | 42 + .../schema/SchemaIndexCacheVisitorImpl.java | 197 ++ .../SchemaIndexOperationCancellationToken.java | 53 + .../processors/query/schema/SchemaKey.java | 59 + .../SchemaNodeLeaveExchangeWorkerTask.java | 53 + .../schema/SchemaOperationClientFuture.java | 52 + .../query/schema/SchemaOperationException.java | 138 ++ .../query/schema/SchemaOperationManager.java| 292 +++ .../query/schema/SchemaOperationWorker.java | 205 +++ .../message/SchemaAbstractDiscoveryMessage.java | 70 + .../message/SchemaFinishDiscoveryMessage.java | 98 + .../message/SchemaOperationStatusMessage.java | 168 ++ .../message/SchemaProposeDiscoveryMessage.java | 133 ++ .../operation/SchemaAbstractOperation.java | 67 + .../operation/SchemaIndexAbstractOperation.java | 40 + .../operation/SchemaIndexCreateOperation.java | 91 + .../operation/SchemaIndexDropOperation.java | 68 + .../processors/cache/GridCacheTestEntryEx.java |7 + .../junits/GridTestKernalContext.java |1 + .../query/h2/GridH2IndexingGeoSelfTest.java |4 +- .../query/h2/DmlStatementsProcessor.java| 49 +- .../processors/query/h2/IgniteH2Indexing.java | 678 +-- .../query/h2/ddl/DdlStatementsProcessor.java| 208 +++ .../query/h2/opt/GridH2IndexBase.java |
[04/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/matrix/MatrixImplementationsTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/matrix/MatrixImplementationsTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/matrix/MatrixImplementationsTest.java new file mode 100644 index 000..c827037 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/matrix/MatrixImplementationsTest.java @@ -0,0 +1,1113 @@ +/* + * 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.math.impls.matrix; + +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Supplier; +import org.apache.ignite.ml.math.ExternalizeTest; +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.exceptions.CardinalityException; +import org.apache.ignite.ml.math.exceptions.ColumnIndexException; +import org.apache.ignite.ml.math.exceptions.IndexException; +import org.apache.ignite.ml.math.exceptions.RowIndexException; +import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; +import org.apache.ignite.ml.math.impls.vector.DenseLocalOffHeapVector; +import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; +import org.apache.ignite.ml.math.impls.vector.RandomVector; +import org.apache.ignite.ml.math.impls.vector.SparseLocalVector; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * Tests for {@link Matrix} implementations. + */ +public class MatrixImplementationsTest extends ExternalizeTest { +/** */ +private static final double DEFAULT_DELTA = 0.1d; + +/** */ +private void consumeSampleMatrix(BiConsumer consumer) { +new MatrixImplementationFixtures().consumeSampleMatrix(consumer); +} + +/** */ +@Test +public void externalizeTest() { +consumeSampleMatrix((m, desc) -> externalizeTest(m)); +} + +/** */ +@Test +public void testLike() { +consumeSampleMatrix((m, desc) -> { +Class cls = likeMatrixType(m); + +if (cls != null) { +Matrix like = m.like(m.rowSize(), m.columnSize()); + +assertEquals("Wrong \"like\" matrix for " + desc + "; Unexpected rows.", like.rowSize(), m.rowSize()); +assertEquals("Wrong \"like\" matrix for " + desc + "; Unexpected columns.", like.columnSize(), m.columnSize()); + +assertEquals("Wrong \"like\" matrix for " + desc ++ "; Unexpected class: " + like.getClass().toString(), +cls, +like.getClass()); + +return; +} + +boolean expECaught = false; + +try { +m.like(1, 1); +} +catch (UnsupportedOperationException uoe) { +expECaught = true; +} + +assertTrue("Expected exception was not caught for " + desc, expECaught); +}); +} + +/** */ +@Test +public void testCopy() { +consumeSampleMatrix((m, desc) -> { +Matrix cp = m.copy(); +assertTrue("Incorrect copy for empty matrix " + desc, cp.equals(m)); + +if (!readOnly(m)) +fillMatrix(m); + +cp = m.copy(); + +assertTrue("Incorrect copy for matrix " + desc, cp.equals(m)); +}); +} + +/** */ +@Test +public void testHaveLikeVector() throws InstantiationException, IllegalAccessException { +for (Class key : likeVectorTypesMap().keySet()) { +Class val = likeVectorTypesMap().get(key); + +if (val == null && !ignore(key)) +System.out.println("Missing test for implementation of likeMatrix f
[48/70] [abbrv] ignite git commit: Minor corrections in tests.
Minor corrections in tests. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5dab5fb6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5dab5fb6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5dab5fb6 Branch: refs/heads/ignite-2893 Commit: 5dab5fb65d97921d7e28e04283a3d47d00c44a25 Parents: fb1dea7 Author: Alexey Goncharuk Authored: Wed Apr 19 14:22:00 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 14:22:00 2017 +0300 -- ...ServiceProcessorMultiNodeConfigSelfTest.java | 23 --- .../GridServiceProcessorMultiNodeSelfTest.java | 31 ++-- 2 files changed, 27 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/5dab5fb6/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java index 16e5e30..bd47b53 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java @@ -55,7 +55,6 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc /** {@inheritDoc} */ @Override protected ServiceConfiguration[] services() { -List cfgs = new ArrayList<>(); ServiceConfiguration cfg = new ServiceConfiguration(); @@ -64,6 +63,8 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc cfg.setTotalCount(1); cfg.setService(new DummyService()); +List cfgs = new ArrayList<>(); + cfgs.add(cfg); cfg = new ServiceConfiguration(); @@ -201,12 +202,12 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc checkCount(name, g.services().serviceDescriptors(), nodeCount()); -int extraNodes = 2; - CountDownLatch latch = new CountDownLatch(1); DummyService.exeLatch(name, latch); +int extraNodes = 2; + startExtraNodes(extraNodes); try { @@ -270,10 +271,10 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc waitForDeployment(name, nodeCount() + newNodes); +// Since we start extra nodes, there may be extra start and cancel events, +// so we check only the difference between start and cancel and +// not start and cancel events individually. assertEquals(name, newNodes, DummyService.started(name) - DummyService.cancelled(name)); -// Next may fails. Server can be restarted on unstable topology. -//assertEquals(name, newNodes, DummyService.started(name)); -//assertEquals(name, 0, DummyService.cancelled(name)); checkCount(name, g.services().serviceDescriptors(), nodeCount() + newNodes); } @@ -294,12 +295,13 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc Ignite g = randomGrid(); int servers = 2; -int clients = 2; CountDownLatch latch = new CountDownLatch(servers); DummyService.exeLatch(name, latch); +int clients = 2; + startExtraNodes(servers, clients); try { @@ -307,11 +309,10 @@ public class GridServiceProcessorMultiNodeConfigSelfTest extends GridServiceProc waitForDeployment(name, nodeCount() + servers); +// Since we start extra nodes, there may be extra start and cancel events, +// so we check only the difference between start and cancel and +// not start and cancel events individually. assertEquals(name, servers, DummyService.started(name) - DummyService.cancelled(name)); -// Next may fails. Server can be restarted on unstable topology. -//assertEquals(name, servers, DummyService.started(name)); -//assertEquals(name, 0, DummyService.cancelled(name)); - checkCount(name, g.services().serviceDescriptors(), nodeCount() + servers); } http://git-wip-us.apache.org/repos/asf/ignite/blob/5dab5fb6/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/
[24/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d78e071a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d78e071a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d78e071a Branch: refs/heads/ignite-2893 Commit: d78e071a7de1129838652e9f377ff73d3a84495d Parents: 7038af4 Author: Yury Babak Authored: Tue Apr 18 16:47:15 2017 +0300 Committer: Anton Vinogradov Committed: Tue Apr 18 16:47:17 2017 +0300 -- examples/pom-standalone.xml |4 - examples/pom.xml|4 - .../CholeskyDecompositionExample.java |8 +- .../EigenDecompositionExample.java |8 +- .../decompositions/LUDecompositionExample.java |8 +- .../SingularValueDecompositionExample.java |6 +- .../ml/math/matrix/CacheMatrixExample.java | 10 +- .../ml/math/matrix/ExampleMatrixStorage.java|4 +- .../math/matrix/MatrixCustomStorageExample.java | 12 +- .../examples/ml/math/matrix/MatrixExample.java |4 +- .../ml/math/matrix/MatrixExampleUtil.java |4 +- .../ml/math/matrix/OffHeapMatrixExample.java|4 +- .../matrix/SparseDistributedMatrixExample.java |5 +- .../ml/math/matrix/SparseMatrixExample.java |4 +- .../examples/ml/math/tracer/TracerExample.java |4 +- .../ml/math/vector/CacheVectorExample.java |8 +- .../ml/math/vector/ExampleVectorStorage.java|4 +- .../ml/math/vector/OffHeapVectorExample.java|4 +- .../ml/math/vector/SparseVectorExample.java |6 +- .../math/vector/VectorCustomStorageExample.java | 14 +- .../examples/ml/math/vector/VectorExample.java |4 +- modules/ml/pom.xml |6 - .../java/org/apache/ignite/math/Algebra.java| 571 - .../java/org/apache/ignite/math/Constants.java | 42 - .../org/apache/ignite/math/Destroyable.java | 30 - .../apache/ignite/math/IdentityValueMapper.java | 53 - .../java/org/apache/ignite/math/KeyMapper.java | 33 - .../java/org/apache/ignite/math/Matrix.java | 518 .../org/apache/ignite/math/MatrixKeyMapper.java | 30 - .../org/apache/ignite/math/MatrixStorage.java | 58 - .../org/apache/ignite/math/MetaAttributes.java | 76 -- .../java/org/apache/ignite/math/MurmurHash.java | 246 .../apache/ignite/math/StorageConstants.java| 49 - .../apache/ignite/math/StorageOpsMetrics.java | 49 - .../java/org/apache/ignite/math/Tracer.java | 456 --- .../org/apache/ignite/math/ValueMapper.java | 27 - .../java/org/apache/ignite/math/Vector.java | 498 .../org/apache/ignite/math/VectorKeyMapper.java | 29 - .../org/apache/ignite/math/VectorStorage.java | 53 - .../decompositions/CholeskyDecomposition.java | 306 - .../decompositions/DecompositionSupport.java| 105 -- .../math/decompositions/EigenDecomposition.java | 923 --- .../math/decompositions/LUDecomposition.java| 366 -- .../math/decompositions/QRDecomposition.java| 186 --- .../SingularValueDecomposition.java | 620 -- .../math/decompositions/package-info.java | 22 - .../math/exceptions/CardinalityException.java | 38 - .../math/exceptions/ColumnIndexException.java | 35 - .../ignite/math/exceptions/IndexException.java | 35 - .../NonPositiveDefiniteMatrixException.java | 20 - .../exceptions/NonSymmetricMatrixException.java | 18 - .../math/exceptions/RowIndexException.java | 35 - .../exceptions/SingularMatrixException.java | 30 - .../exceptions/UnknownProviderException.java| 35 - .../UnsupportedOperationException.java | 44 - .../ignite/math/exceptions/package-info.java| 22 - .../apache/ignite/math/functions/Functions.java | 136 --- .../ignite/math/functions/IgniteBiConsumer.java | 12 - .../ignite/math/functions/IgniteBiFunction.java | 29 - .../ignite/math/functions/IgniteConsumer.java | 29 - .../math/functions/IgniteDoubleFunction.java| 29 - .../ignite/math/functions/IgniteFunction.java | 30 - .../math/functions/IntDoubleToVoidFunction.java | 25 - .../functions/IntIntDoubleToVoidFunction.java | 28 - .../math/functions/IntIntToDoubleFunction.java | 24 - .../ignite/math/functions/package-info.java | 22 - .../apache/ignite/math/impls/CacheUtils.java| 356 -- .../math/impls/matrix/AbstractMatrix.java | 880 -- .../ignite/math/impls/matrix/CacheMatrix.java | 158 --- .../impls/matrix/DenseLocalOffHeapMatrix.java | 90 -- .../impls/matrix/DenseLocalOnHeapMatrix.java| 86 -- .../math/impls/matrix/DiagonalMatrix.java | 101
[56/70] [abbrv] ignite git commit: Rename OutOfMemoryException
Rename OutOfMemoryException Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/67d3358d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/67d3358d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/67d3358d Branch: refs/heads/ignite-2893 Commit: 67d3358d030a2e40262a7a344ef95fee607b274e Parents: a51477c Author: Sergey Chugunov Authored: Wed Apr 19 16:45:53 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 16:45:53 2017 +0300 -- .../benchmarks/jmh/tree/BPlusTreeBenchmark.java | 1 + .../MemoryPolicyConfiguration.java | 4 +- .../mem/IgniteOutOfMemoryException.java | 51 .../internal/mem/OutOfMemoryException.java | 51 .../pagemem/impl/PageMemoryNoStoreImpl.java | 16 +- .../IgniteCacheDatabaseSharedManager.java | 12 +++-- .../pagemem/impl/PageMemoryNoLoadSelfTest.java | 2 +- .../CacheMemoryPolicyConfigurationTest.java | 6 +-- .../processors/database/BPlusTreeSelfTest.java | 7 ++- .../database/FreeListImplSelfTest.java | 8 ++- .../database/MetadataStorageSelfTest.java | 2 +- .../h2/database/InlineIndexHelperTest.java | 3 ++ 12 files changed, 98 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/67d3358d/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java -- diff --git a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java index 5d02235..5833e1f 100644 --- a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java +++ b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/tree/BPlusTreeBenchmark.java @@ -213,6 +213,7 @@ public class BPlusTreeBenchmark extends JmhAbstractBenchmark { new UnsafeMemoryProvider(sizes), null, PAGE_SIZE, +null, new MemoryMetricsImpl(null), false); http://git-wip-us.apache.org/repos/asf/ignite/blob/67d3358d/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java index 2cd6d02..810ecaa 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java @@ -17,7 +17,7 @@ package org.apache.ignite.configuration; import java.io.Serializable; -import org.apache.ignite.internal.mem.OutOfMemoryException; +import org.apache.ignite.internal.mem.IgniteOutOfMemoryException; /** * This class allows defining custom memory policies' configurations with various parameters for Apache Ignite @@ -86,7 +86,7 @@ public final class MemoryPolicyConfiguration implements Serializable { * it will take empty page from the pool instead of allocating a new one. * Increase this parameter if cache can contain very big entries (total size of pages in the pool should be enough * to contain largest cache entry). - * Increase this parameter if {@link OutOfMemoryException} occurred with enabled page eviction. + * Increase this parameter if {@link IgniteOutOfMemoryException} occurred with enabled page eviction. */ private int emptyPagesPoolSize = 100; http://git-wip-us.apache.org/repos/asf/ignite/blob/67d3358d/modules/core/src/main/java/org/apache/ignite/internal/mem/IgniteOutOfMemoryException.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/mem/IgniteOutOfMemoryException.java b/modules/core/src/main/java/org/apache/ignite/internal/mem/IgniteOutOfMemoryException.java new file mode 100644 index 000..22ef795 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/mem/IgniteOutOfMemoryException.java @@ -0,0 +1,51 @@ +/* + * 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
[12/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java new file mode 100644 index 000..3c075f4 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java @@ -0,0 +1,903 @@ +/* + * 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.math.impls.vector; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Spliterator; +import java.util.function.Consumer; +import java.util.function.IntToDoubleFunction; +import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.VectorStorage; +import org.apache.ignite.ml.math.exceptions.CardinalityException; +import org.apache.ignite.ml.math.exceptions.IndexException; +import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; +import org.apache.ignite.ml.math.functions.Functions; +import org.apache.ignite.ml.math.functions.IgniteBiFunction; +import org.apache.ignite.ml.math.functions.IgniteDoubleFunction; +import org.apache.ignite.ml.math.impls.matrix.MatrixView; +import org.jetbrains.annotations.NotNull; + +/** + * This class provides a helper implementation of the {@link Vector} + * interface to minimize the effort required to implement it. + * Subclasses may override some of the implemented methods if a more + * specific or optimized implementation is desirable. + */ +public abstract class AbstractVector implements Vector { +/** Vector storage implementation. */ +private VectorStorage sto; + +/** Meta attribute storage. */ +private Map meta = new HashMap<>(); + +/** Vector's GUID. */ +private IgniteUuid guid = IgniteUuid.randomUuid(); + +/** Cached value for length squared. */ +private double lenSq = 0.0; + +/** Maximum cached element. */ +private Element maxElm = null; +/** Minimum cached element. */ +private Element minElm = null; + +/** Readonly flag (false by default). */ +private boolean readOnly = false; + +/** Read-only error message. */ +private static final String RO_MSG = "Vector is read-only."; + +/** + * + */ +private void ensureReadOnly() { +if (readOnly) +throw new UnsupportedOperationException(RO_MSG); +} + +/** + * @param sto Storage. + */ +public AbstractVector(VectorStorage sto) { +this(false, sto); +} + +/** + * @param readOnly Is read only. + * @param sto Storage. + */ +public AbstractVector(boolean readOnly, VectorStorage sto) { +assert sto != null; + +this.readOnly = readOnly; +this.sto = sto; +} + +/** + * + */ +public AbstractVector() { +// No-op. +} + +/** + * Set storage. + * + * @param sto Storage. + */ +protected void setStorage(VectorStorage sto) { +this.sto = sto; +} + +/** + * @param i Index. + * @param v Value. + */ +protected void storageSet(int i, double v) { +ensureReadOnly(); + +sto.set(i, v); + +// Reset cached values. +lenSq = 0.0; +maxElm = minElm = null; +} + +/** + * @param i Index. + * @return Value. + */ +protected double storageGet(int i) { +return sto.get(i); +} + +/** {@inheritDoc} */ +@Override public int size() { +return sto.size(); +} + +/** + * Check index bounds. + * + * @param idx Index to check. + */ +protected void checkIndex(int idx) { +if (idx < 0 || idx >= sto.size()) +throw new IndexException(idx); +} + +/** {@inheritDoc} */ +@Overr
[64/70] [abbrv] ignite git commit: ignite-2.0 - Web Console agent download dialog minor tweaks.
ignite-2.0 - Web Console agent download dialog minor tweaks. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/badf49c4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/badf49c4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/badf49c4 Branch: refs/heads/ignite-2893 Commit: badf49c44118fc09f686736ec45439cc4745e3fd Parents: 2c37eff Author: Alexey Kuznetsov Authored: Thu Apr 20 10:03:59 2017 +0700 Committer: Alexey Kuznetsov Committed: Thu Apr 20 10:03:59 2017 +0700 -- .../frontend/views/templates/agent-download.tpl.pug| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/badf49c4/modules/web-console/frontend/views/templates/agent-download.tpl.pug -- diff --git a/modules/web-console/frontend/views/templates/agent-download.tpl.pug b/modules/web-console/frontend/views/templates/agent-download.tpl.pug index 615abbc..5abc587 100644 --- a/modules/web-console/frontend/views/templates/agent-download.tpl.pug +++ b/modules/web-console/frontend/views/templates/agent-download.tpl.pug @@ -23,11 +23,11 @@ span Connection to Ignite Web Agent is not established .modal-body.agent-download p Please download and run #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] to use this functionality -p For run: +p To start: ul li Download and unzip #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] archive li Run shell file #[b ignite-web-agent.{sh|bat}] -p Refer to #[b README.txt] in agent folder for more information +p Refer to #[b README.txt] in the ignite-web-agent folder for more information. .modal-advanced-options i.fa(ng-class='showToken ? "fa-chevron-circle-down" : "fa-chevron-circle-right"' ng-click='showToken = !showToken') a(ng-click='showToken = !showToken') {{showToken ? 'Hide security token...' : 'Show security token...'}} @@ -53,7 +53,7 @@ li Ignite Grid is up and Ignite REST server started (copy "ignite-rest-http" folder from libs/optional/ to libs/) li In agent settings check URI for connect to Ignite REST server li Check agent logs for errors -li Refer to #[b README.txt] in agent folder for more information +li Refer to #[b README.txt] in the ignite-web-agent folder for more information. .modal-footer button.btn.btn-default(ng-click='ctrl.back()') {{::ctrl.backText}}
[01/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
Repository: ignite Updated Branches: refs/heads/ignite-2893 63724350c -> 89bfbad19 http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java new file mode 100644 index 000..16c2571 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java @@ -0,0 +1,376 @@ +/* + * 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.math.impls.vector; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Spliterator; +import java.util.function.BiConsumer; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.impls.MathTestConstants; +import org.junit.Test; + +import static java.util.Spliterator.ORDERED; +import static java.util.Spliterator.SIZED; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** */ +public class VectorIterableTest { +/** */ +@Test +public void allTest() { +consumeSampleVectors( +(v, desc) -> { +int expIdx = 0; + +for (Vector.Element e : v.all()) { +int actualIdx = e.index(); + +assertEquals("Unexpected index for " + desc, +expIdx, actualIdx); + +expIdx++; +} + +assertEquals("Unexpected amount of elements for " + desc, +expIdx, v.size()); +} +); +} + +/** */ +@Test +public void allTestBound() { +consumeSampleVectors( +(v, desc) -> iteratorTestBound(v.all().iterator(), desc) +); +} + +/** */ +@Test +public void nonZeroesTestBasic() { +final int size = 5; + +final double[] nonZeroesOddData = new double[size], nonZeroesEvenData = new double[size]; + +for (int idx = 0; idx < size; idx++) { +final boolean odd = (idx & 1) == 1; + +nonZeroesOddData[idx] = odd ? 1 : 0; + +nonZeroesEvenData[idx] = odd ? 0 : 1; +} + +assertTrue("Arrays failed to initialize.", +!isZero(nonZeroesEvenData[0]) +&& isZero(nonZeroesEvenData[1]) +&& isZero(nonZeroesOddData[0]) +&& !isZero(nonZeroesOddData[1])); + +final Vector nonZeroesEvenVec = new DenseLocalOnHeapVector(nonZeroesEvenData), +nonZeroesOddVec = new DenseLocalOnHeapVector(nonZeroesOddData); + +assertTrue("Vectors failed to initialize.", +!isZero(nonZeroesEvenVec.getElement(0).get()) +&& isZero(nonZeroesEvenVec.getElement(1).get()) +&& isZero(nonZeroesOddVec.getElement(0).get()) +&& !isZero(nonZeroesOddVec.getElement(1).get())); + +assertTrue("Iterator(s) failed to start.", +nonZeroesEvenVec.nonZeroes().iterator().next() != null +&& nonZeroesOddVec.nonZeroes().iterator().next() != null); + +int nonZeroesActual = 0; + +for (Vector.Element e : nonZeroesEvenVec.nonZeroes()) { +final int idx = e.index(); + +final boolean odd = (idx & 1) == 1; + +final double val = e.get(); + +assertTrue("Not an even index " + idx + ", for value " + val, !odd); + +assertTrue("Zero value " + val + " at even index " + idx, !isZero(val)); + +nonZeroesActual++; +} + +final int nonZeroesOddExp = (size + 1) / 2; + +assertEquals("Unexpected num of iterated odd non-zeroes.", nonZeroesOddExp, nonZeroesActual); + +assertEquals("Unexpected nonZeroElements of odd.", nonZeroesOddExp, nonZeroesEvenVec.nonZeroElements()); +
[35/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/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 2b957be..ceb139a 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 @@ -17,34 +17,29 @@ package org.apache.ignite.internal.processors.query; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; -import javax.cache.Cache; -import javax.cache.CacheException; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.IgniteException; import org.apache.ignite.binary.Binarylizable; +import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.QueryEntity; +import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.SqlQuery; +import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.events.CacheQueryExecutedEvent; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.managers.communication.GridMessageListener; import org.apache.ignite.internal.NodeStoppingException; import org.apache.ignite.internal.processors.GridProcessorAdapter; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.CacheObject; import org.apache.ignite.internal.processors.cache.CacheObjectContext; +import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor; +import org.apache.ignite.internal.processors.cache.GridCacheAdapter; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.IgniteCacheProxy; import org.apache.ignite.internal.processors.cache.KeyCacheObject; @@ -54,7 +49,23 @@ import org.apache.ignite.internal.processors.cache.query.CacheQueryType; import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType; import org.apache.ignite.internal.processors.cache.query.QueryCursorEx; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; +import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitor; +import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorImpl; +import org.apache.ignite.internal.processors.query.schema.SchemaIndexOperationCancellationToken; +import org.apache.ignite.internal.processors.query.schema.SchemaKey; +import org.apache.ignite.internal.processors.query.schema.SchemaOperationClientFuture; +import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; +import org.apache.ignite.internal.processors.query.schema.SchemaOperationManager; +import org.apache.ignite.internal.processors.query.schema.SchemaOperationWorker; +import org.apache.ignite.internal.processors.query.schema.message.SchemaAbstractDiscoveryMessage; +import org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessage; +import org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage; +import org.apache.ignite.internal.processors.query.schema.message.SchemaProposeDiscoveryMessage; +import org.apache.ignite.internal.processors.query.schema.operation.SchemaAbstractOperation; +import org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexCreateOperation; +import org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexDropOperation; import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor; +import org.apache.ignite.internal.util.GridBoundedConcurrentLinkedHashSet; import org.apache.ignite.internal.util.GridSpinBusyLock; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; @@ -63,17 +74,45 @@ import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.lang.IgniteOutClosureX; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.CU; +import org.apache.ignite.internal.util.typedef.T2; +import org.apache.ignite.internal.util.
[45/70] [abbrv] ignite git commit: IGNITE-4925 Fix IgniteCacheBinaryObjectsScanSelfTest.testScanNoClasses - Fixes #1750.
IGNITE-4925 Fix IgniteCacheBinaryObjectsScanSelfTest.testScanNoClasses - Fixes #1750. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b47f29d8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b47f29d8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b47f29d8 Branch: refs/heads/ignite-2893 Commit: b47f29d83f25037c5bf3cfe489b7120a238c7120 Parents: 800b8bd Author: Evgenii Zhuravlev Authored: Wed Apr 19 14:01:21 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 14:01:21 2017 +0300 -- .../cache/IgniteCacheBinaryObjectsScanSelfTest.java | 11 +-- .../cache/IgniteCacheEntryListenerAbstractTest.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b47f29d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java index 666505b..e0da1f6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java @@ -17,10 +17,12 @@ package org.apache.ignite.internal.processors.cache; +import java.util.ArrayList; import java.util.List; import javax.cache.Cache; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -127,9 +129,14 @@ public class IgniteCacheBinaryObjectsScanSelfTest extends GridCommonAbstractTest assertEquals(PERSON_CLS_NAME, entry.getValue().getClass().getName()); } -entries = cache.query(new ScanQuery<>(1023)).getAll(); +entries = new ArrayList<>(); -assertFalse(entries.isEmpty()); +int partCnt = client.affinity("testCache").partitions(); + +for (int i = 0; i < partCnt; i++) +entries.addAll(cache.query(new ScanQuery<>(i)).getAll()); + +assertEquals(100, entries.size()); for (Cache.Entry entry : entries) { assertEquals(PERSON_KEY_CLS_NAME, entry.getKey().getClass().getName()); http://git-wip-us.apache.org/repos/asf/ignite/blob/b47f29d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java index e0e2771..ef2f156 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java @@ -329,7 +329,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb if (!eagerTtl()) { U.sleep(1100); -assertNull(primaryCache(key, cache.getName()).get(key(key))); +assertNull(primaryCache(key(key), cache.getName()).get(key(key))); evtsLatch.await(5000, MILLISECONDS);
[14/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/matrix/PivotedMatrixView.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/matrix/PivotedMatrixView.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/matrix/PivotedMatrixView.java new file mode 100644 index 000..b9a3b17 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/matrix/PivotedMatrixView.java @@ -0,0 +1,243 @@ +/* + * 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.math.impls.matrix; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.MatrixStorage; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.exceptions.IndexException; +import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; +import org.apache.ignite.ml.math.impls.storage.matrix.PivotedMatrixStorage; +import org.apache.ignite.ml.math.impls.vector.PivotedVectorView; + +/** + * Pivoted (index mapped) view over another matrix implementation. + */ +public class PivotedMatrixView extends AbstractMatrix { +/** Pivoted matrix. */ +private Matrix mtx; + +/** + * + */ +public PivotedMatrixView() { +// No-op. +} + +/** + * @param mtx + * @param rowPivot + * @param colPivot + */ +public PivotedMatrixView(Matrix mtx, int[] rowPivot, int[] colPivot) { +super(new PivotedMatrixStorage(mtx == null ? null : mtx.getStorage(), rowPivot, colPivot)); + +this.mtx = mtx; +} + +/** + * @param mtx + */ +public PivotedMatrixView(Matrix mtx) { +super(new PivotedMatrixStorage(mtx == null ? null : mtx.getStorage())); + +this.mtx = mtx; +} + +/** + * @param mtx + * @param pivot + */ +public PivotedMatrixView(Matrix mtx, int[] pivot) { +super(new PivotedMatrixStorage(mtx == null ? null : mtx.getStorage(), pivot)); + +this.mtx = mtx; +} + +/** + * Swaps indexes {@code i} and {@code j} for both both row and column. + * + * @param i First index to swap. + * @param j Second index to swap. + */ +public Matrix swap(int i, int j) { +swapRows(i, j); +swapColumns(i, j); + +return this; +} + +/** {@inheritDoc} */ +@Override public Matrix swapRows(int i, int j) { +if (i < 0 || i >= storage().rowPivot().length) +throw new IndexException(i); +if (j < 0 || j >= storage().rowPivot().length) +throw new IndexException(j); + +storage().swapRows(i, j); + +return this; +} + +/** {@inheritDoc} */ +@Override public Matrix swapColumns(int i, int j) { +if (i < 0 || i >= storage().columnPivot().length) +throw new IndexException(i); +if (j < 0 || j >= storage().columnPivot().length) +throw new IndexException(j); + +storage().swapColumns(i, j); + +return this; +} + +/** {@inheritDoc} */ +@Override public Vector viewRow(int row) { +return new PivotedVectorView( +mtx.viewRow(storage().rowPivot()[row]), +storage().columnPivot(), +storage().columnUnpivot() +); +} + +/** {@inheritDoc} */ +@Override public Vector viewColumn(int col) { +return new PivotedVectorView( +mtx.viewColumn(storage().columnPivot()[col]), +storage().rowPivot(), +storage().rowUnpivot() +); +} + +/** + * + * + */ +public Matrix getBaseMatrix() { +return mtx; +} + +/** + * + * + */ +public int[] rowPivot() { +return storage().rowPivot(); +} + +/** + * + * + */ +public int[] columnPivot() { +return storage().columnPivot(); +} + +/** + * @param i + */ +public int rowPivot(int i) { +return storage().rowPivot()[i]; +} + +/** + * @param i + */ +
[26/70] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/43d6d7e7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/43d6d7e7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/43d6d7e7 Branch: refs/heads/ignite-2893 Commit: 43d6d7e7eb9eb146c48b843293849ac687ead216 Parents: d60cf53 d78e071 Author: sboikov Authored: Tue Apr 18 16:50:45 2017 +0300 Committer: sboikov Committed: Tue Apr 18 16:50:45 2017 +0300 -- examples/pom-standalone-lgpl.xml|4 - examples/pom-standalone.xml |4 - examples/pom.xml|4 - .../CholeskyDecompositionExample.java |8 +- .../EigenDecompositionExample.java |8 +- .../decompositions/LUDecompositionExample.java |8 +- .../SingularValueDecompositionExample.java |6 +- .../ml/math/matrix/CacheMatrixExample.java | 10 +- .../ml/math/matrix/ExampleMatrixStorage.java|4 +- .../math/matrix/MatrixCustomStorageExample.java | 12 +- .../examples/ml/math/matrix/MatrixExample.java |4 +- .../ml/math/matrix/MatrixExampleUtil.java |4 +- .../ml/math/matrix/OffHeapMatrixExample.java|4 +- .../matrix/SparseDistributedMatrixExample.java |5 +- .../ml/math/matrix/SparseMatrixExample.java |4 +- .../examples/ml/math/tracer/TracerExample.java |4 +- .../ml/math/vector/CacheVectorExample.java |8 +- .../ml/math/vector/ExampleVectorStorage.java|4 +- .../ml/math/vector/OffHeapVectorExample.java|4 +- .../ml/math/vector/SparseVectorExample.java |6 +- .../math/vector/VectorCustomStorageExample.java | 14 +- .../examples/ml/math/vector/VectorExample.java |4 +- modules/ml/pom.xml |6 - .../java/org/apache/ignite/math/Algebra.java| 571 - .../java/org/apache/ignite/math/Constants.java | 42 - .../org/apache/ignite/math/Destroyable.java | 30 - .../apache/ignite/math/IdentityValueMapper.java | 53 - .../java/org/apache/ignite/math/KeyMapper.java | 33 - .../java/org/apache/ignite/math/Matrix.java | 518 .../org/apache/ignite/math/MatrixKeyMapper.java | 30 - .../org/apache/ignite/math/MatrixStorage.java | 58 - .../org/apache/ignite/math/MetaAttributes.java | 76 -- .../java/org/apache/ignite/math/MurmurHash.java | 246 .../apache/ignite/math/StorageConstants.java| 49 - .../apache/ignite/math/StorageOpsMetrics.java | 49 - .../java/org/apache/ignite/math/Tracer.java | 456 --- .../org/apache/ignite/math/ValueMapper.java | 27 - .../java/org/apache/ignite/math/Vector.java | 498 .../org/apache/ignite/math/VectorKeyMapper.java | 29 - .../org/apache/ignite/math/VectorStorage.java | 53 - .../decompositions/CholeskyDecomposition.java | 306 - .../decompositions/DecompositionSupport.java| 105 -- .../math/decompositions/EigenDecomposition.java | 923 --- .../math/decompositions/LUDecomposition.java| 366 -- .../math/decompositions/QRDecomposition.java| 186 --- .../SingularValueDecomposition.java | 620 -- .../math/decompositions/package-info.java | 22 - .../math/exceptions/CardinalityException.java | 38 - .../math/exceptions/ColumnIndexException.java | 35 - .../ignite/math/exceptions/IndexException.java | 35 - .../NonPositiveDefiniteMatrixException.java | 20 - .../exceptions/NonSymmetricMatrixException.java | 18 - .../math/exceptions/RowIndexException.java | 35 - .../exceptions/SingularMatrixException.java | 30 - .../exceptions/UnknownProviderException.java| 35 - .../UnsupportedOperationException.java | 44 - .../ignite/math/exceptions/package-info.java| 22 - .../apache/ignite/math/functions/Functions.java | 136 --- .../ignite/math/functions/IgniteBiConsumer.java | 12 - .../ignite/math/functions/IgniteBiFunction.java | 29 - .../ignite/math/functions/IgniteConsumer.java | 29 - .../math/functions/IgniteDoubleFunction.java| 29 - .../ignite/math/functions/IgniteFunction.java | 30 - .../math/functions/IntDoubleToVoidFunction.java | 25 - .../functions/IntIntDoubleToVoidFunction.java | 28 - .../math/functions/IntIntToDoubleFunction.java | 24 - .../ignite/math/functions/package-info.java | 22 - .../apache/ignite/math/impls/CacheUtils.java| 356 -- .../math/impls/matrix/AbstractMatrix.java | 880 -- .../ignite/math/impls/matrix/CacheMatrix.java | 158 --- .../impls/matrix/DenseLocalOffHeapMatrix.java | 90 -- .../impls/matrix/DenseLocalOnHeapMatrix.java| 86 -- .../math/impls/matrix/DiagonalMatrix.java | 101 -- .../math/impls/matrix/Func
[16/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/DecompositionSupport.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/DecompositionSupport.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/DecompositionSupport.java new file mode 100644 index 000..20d6e79 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/DecompositionSupport.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.ml.math.decompositions; + +import org.apache.ignite.ml.math.Destroyable; +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.impls.matrix.CacheMatrix; +import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix; +import org.apache.ignite.ml.math.impls.matrix.PivotedMatrixView; +import org.apache.ignite.ml.math.impls.matrix.RandomMatrix; +import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector; + +/** + * Helper methods to support decomposition of matrix types having some functionality limited. + */ +public abstract class DecompositionSupport implements Destroyable { +/** + * Create the like matrix with read-only matrices support. + * + * @param matrix Matrix for like. + * @return Like matrix. + */ +protected Matrix like(Matrix matrix) { +if (isCopyLikeSupport(matrix)) +return new DenseLocalOnHeapMatrix(matrix.rowSize(), matrix.columnSize()); +else +return matrix.like(matrix.rowSize(), matrix.columnSize()); +} + +/** + * Create the like matrix with specified size with read-only matrices support. + * + * @param matrix Matrix for like. + * @return Like matrix. + */ +protected Matrix like(Matrix matrix, int rows, int cols) { +if (isCopyLikeSupport(matrix)) +return new DenseLocalOnHeapMatrix(rows, cols); +else +return matrix.like(rows, cols); +} + +/** + * Create the like vector with read-only matrices support. + * + * @param matrix Matrix for like. + * @param crd Cardinality of the vector. + * @return Like vector. + */ +protected Vector likeVector(Matrix matrix, int crd) { +if (isCopyLikeSupport(matrix)) +return new DenseLocalOnHeapVector(crd); +else +return matrix.likeVector(crd); +} + +/** + * Create the like vector with read-only matrices support. + * + * @param matrix Matrix for like. + * @return Like vector. + */ +protected Vector likeVector(Matrix matrix) { +return likeVector(matrix, matrix.rowSize()); +} + +/** + * Create the copy of matrix with read-only matrices support. + * + * @param matrix Matrix for copy. + * @return Copy. + */ +protected Matrix copy(Matrix matrix) { +if (isCopyLikeSupport(matrix)) { +DenseLocalOnHeapMatrix cp = new DenseLocalOnHeapMatrix(matrix.rowSize(), matrix.columnSize()); + +cp.assign(matrix); + +return cp; +} +else +return matrix.copy(); +} + +/** */ +private boolean isCopyLikeSupport(Matrix matrix) { +return matrix instanceof RandomMatrix || matrix instanceof PivotedMatrixView || matrix instanceof CacheMatrix; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/EigenDecomposition.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/EigenDecomposition.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/EigenDecomposition.java new file mode 100644 index 000..01af989 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/decompositions/EigenDecomposition.java @@ -0,0 +1,923 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contribut
[03/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java new file mode 100644 index 000..7c2d415 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java @@ -0,0 +1,126 @@ +/* + * 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.math.impls.storage.matrix; + +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.impls.MathTestConstants; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.apache.ignite.testframework.junits.common.GridCommonTest; + +/** + * Tests for {@link SparseDistributedMatrixStorage}. + */ +@GridCommonTest(group = "Distributed Models") +public class SparseDistributedMatrixStorageTest extends GridCommonAbstractTest { +/** Number of nodes in grid */ +private static final int NODE_COUNT = 3; +/** Cache name. */ +private static final String CACHE_NAME = "test-cache"; +/** */ +private static final String UNEXPECTED_ATTRIBUTE_VALUE = "Unexpected attribute value."; +/** Grid instance. */ +private Ignite ignite; + +/** + * Default constructor. + */ +public SparseDistributedMatrixStorageTest() { +super(false); +} + +/** {@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(); +} + +/** + * {@inheritDoc} + */ +@Override protected void beforeTest() throws Exception { +ignite = grid(NODE_COUNT); + +ignite.configuration().setPeerClassLoadingEnabled(true); +} + +/** {@inheritDoc} */ +@Override protected void afterTest() throws Exception { +ignite.destroyCache(CACHE_NAME); +} + +/** */ +public void testCacheCreation() throws Exception { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +assertNotNull("SparseDistributedMatrixStorage cache is null.", storage.cache()); +} + +/** */ +public void testSetGet() throws Exception { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +for (int i = 0; i < rows; i++) { +for (int j = 0; j < cols; j++) { +double v = Math.random(); +storage.set(i, j, v); + +assert Double.compare(v, storage.get(i, j)) == 0; +assert Double.compare(v, storage.get(i, j)) == 0; +} +} +} + +/** */ +public void testAttributes() { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +
[62/70] [abbrv] ignite git commit: IGNITE-4949 - Fixed CacheJdbcPojoStore for BinaryMarshaller. This closes #1803.
IGNITE-4949 - Fixed CacheJdbcPojoStore for BinaryMarshaller. This closes #1803. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0cb2c921 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0cb2c921 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0cb2c921 Branch: refs/heads/ignite-2893 Commit: 0cb2c92152ea944d3313aa493bfce1f5191bc263 Parents: 1cd3cac Author: Dmitriy Govorukhin Authored: Wed Apr 19 19:44:49 2017 +0300 Committer: Alexey Goncharuk Committed: Wed Apr 19 19:45:40 2017 +0300 -- .../store/jdbc/CacheAbstractJdbcStore.java | 37 +++-- .../cache/store/jdbc/CacheJdbcPojoStore.java| 1 - .../store/jdbc/CacheJdbcPojoStoreTest.java | 147 ++- .../ignite/testframework/junits/IgniteMock.java | 4 + 4 files changed, 129 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0cb2c921/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java index 1c7e9dd..625d3cd 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java @@ -537,23 +537,36 @@ public abstract class CacheAbstractJdbcStore implements CacheStore, /** * @param type Type name to check. + * @param binarySupported True if binary marshaller enable. * @return {@code True} if class not found. */ -protected TypeKind kindForName(String type) { +protected TypeKind kindForName(String type, boolean binarySupported) { if (BUILT_IN_TYPES.contains(type)) return TypeKind.BUILT_IN; +if (binarySupported) +return TypeKind.BINARY; + try { Class.forName(type); return TypeKind.POJO; } -catch(ClassNotFoundException ignored) { -return TypeKind.BINARY; +catch (ClassNotFoundException e) { +throw new CacheException("Failed to find class " + type + +" (make sure the class is present in classPath or use BinaryMarshaller)", e); } } /** + * @param type Type name to check. + * @return {@code True} if class not found. + */ +protected TypeKind kindForName(String type) { +return kindForName(type, ignite.configuration().getMarshaller() instanceof BinaryMarshaller); +} + +/** * @param cacheName Cache name to check mappings for. * @return Type mappings for specified cache name. * @throws CacheException If failed to initialize cache mappings. @@ -587,11 +600,7 @@ public abstract class CacheAbstractJdbcStore implements CacheStore, String keyType = type.getKeyType(); String valType = type.getValueType(); -TypeKind keyKind = kindForName(keyType); - -if (!binarySupported && keyKind == TypeKind.BINARY) -throw new CacheException("Key type has no class [cache=" + U.maskName(cacheName) + -", type=" + keyType + "]"); +TypeKind keyKind = kindForName(keyType, binarySupported); checkTypeConfiguration(cacheName, keyKind, keyType, type.getKeyFields()); @@ -601,21 +610,11 @@ public abstract class CacheAbstractJdbcStore implements CacheStore, throw new CacheException("Key type must be unique in type metadata [cache=" + U.maskName(cacheName) + ", type=" + keyType + "]"); -TypeKind valKind = kindForName(valType); +TypeKind valKind = kindForName(valType, binarySupported); checkTypeConfiguration(cacheName, valKind, valType, type.getValueFields()); entryMappings.put(keyTypeId, new EntryMapping(cacheName, dialect, type, keyKind, valKind, sqlEscapeAll)); - -// Add one more binding to binary typeId for POJOs, -// because object could be passed to store in binary format. -if (binarySupported && keyKind == TypeKind.POJO) { -keyTypeId = typeIdForTypeName(TypeKind.BINARY, keyType); - -valKind = valKind == TypeKind.POJO ? TypeKind.BINARY : valKind; - -entryMappings.put(keyTypeId, new EntryMapping(cacheName, dialect, type, TypeKind.BINARY, valKind, sqlEscapeAll)); -
[11/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html -- diff --git a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html b/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html deleted file mode 100644 index 19a907a..000 --- a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html +++ /dev/null @@ -1,128 +0,0 @@ - - - -IgniteML - -body { -margin: 0 15px; -} - -p { -margin: 10px 0 !important; -} - -.name { -font-size: 20px; -font-weight: 400; -font-family: monospace; -} - -.swatch { -display: inline-block; -width: 25px; -height: 25px; -margin-left: 5px; -vertical-align: bottom; -} - - -https://ignite.apache.org/images/logo3.png";> -https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js";> - -/*@DATA@*/ -var data = [[{d: 2.256, r: 198, g: 128, b: 128}, {d: 0.123, r: 218, g: 228, b: 18}], [{ -d: 2.256, -r: 108, -g: 28, -b: 108 -}, {d: 0.123, r: 228, g: 228, b: 228}]]; -/*@MAX@*/ -var max = {d: 2.256, r: 128, g: 128, b: 128}; -/*@MIN@*/ -var min = {d: 0.123, r: 228, g: 228, b: 228}; -/*@NAME@*/ -var name = "Matrix"; - -var rows = data.length; -var cols = data[0].length; - -var range = max.d - min.d; - -var rw, rh; -var W, H; - -if (cols > W) { -rw = 1; -W = cols; -} -else { -W = 1000; -rw = Math.min(Math.round(W / cols), 10); -} - -if (rows > H) { -rh = 1; -H = rows; -} -else { -H = 1000; -rh = Math.min(Math.round(H / rows), 10); -} - -d3.selectAll("body") -.append("p") -.text(name + " (" + rows + "x" + cols + ")") -.attr("class", "name"); - -d3.selectAll("body") -.append("p") -.attr("class", "name") -.text("Max: " + max.d) -.append("span") -.attr("class", "swatch") -.attr("style", "background-color: rgb(" + max.r + ", " + max.g + ", " + max.b + ")"); - -d3.selectAll("body") -.append("p") -.attr("class", "name") -.text("Min: " + min.d) -.append("span") -.attr("class", "swatch") -.attr("style", "background-color: rgb(" + min.r + ", " + min.g + ", " + min.b + ")"); - -var svg = d3.select("body").append("svg") -.attr("width", W) -.attr("height", H); - -var y = 0; - -for (var row = 0; row < rows; row++) -svg.selectAll("div") -.data(data[row]) -.enter() -.append("rect") -.attr("x", function (d, i) { -return i * rw -}) -.attr("y", rh * row) -.attr("fill", function (d) { -return "rgb(" + d.r + ", " + d.g + ", " + d.b + ")"; -}) -.attr("width", rw) -.attr("height", rh); - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html -- diff --git a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html b/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html deleted file mode 100644 index 7644481..000 --- a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html +++ /dev/null @@ -1,111 +0,0 @@ - - - -IgniteML - -body { -margin: 0 15px; -} - -p { -margin: 10px 0 !important; -} - -.name { -font-size: 20px; -font-weight: 400; -font-family: monospace; -} - -.swatch { -display: inline-block; -width: 25px; -height: 25px; -margin-left: 5px; -vertical-align: bottom; -} - - -https://ignite.apache.org/images/logo3.png";> -https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js";> - -/*@DATA@*/ -var data = [{d: 2.256, r: 128, g: 128, b: 128}, {d: 0.123, r: 228, g: 228, b: 228}]; -/*@MAX@*/ -var max = {d: 2.256, r: 128, g: 128, b: 128}; -/*@MIN@*/ -var min = {d: 0.123, r: 228, g: 228, b: 228}; -/*@NAME@*/ -var name = "Vector"; - -var W, H = 1000; - -var range = max.d - min.d; - -var rh = 20; // Constant. - -var rw; - -if (data.length > W) { -rw = 1; -W = data.length; -} -else { -W = 1000; -rw = Math.min(Math.round(W / data.length), 5); -} - -d3.selectAll("body") -.append("p") -.text(name + " (size: " + data.length + ")") -.attr("class", "name"); - -d3.selectAll("body") -.append("p") -.attr("cla
[67/70] [abbrv] ignite git commit: ignite-4929 Fixed issue with incorrect return value on backup for one-phase tx invoke (anyway old value is sent on backups on changed topology, use this value on bac
ignite-4929 Fixed issue with incorrect return value on backup for one-phase tx invoke (anyway old value is sent on backups on changed topology, use this value on backup for invoke) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a4c39707 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4c39707 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4c39707 Branch: refs/heads/ignite-2893 Commit: a4c397076954d10cfb200fe30060ed0d118a3fc1 Parents: a508826 Author: sboikov Authored: Thu Apr 20 10:26:09 2017 +0300 Committer: sboikov Committed: Thu Apr 20 10:26:09 2017 +0300 -- .../processors/cache/GridCacheUtils.java| 9 - .../distributed/GridDistributedLockRequest.java | 14 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 26 +-- .../near/GridNearSingleGetRequest.java | 4 +- .../cache/transactions/IgniteTxAdapter.java | 16 +- .../cache/transactions/IgniteTxEntry.java | 39 ++-- .../IgfsMetaDirectoryListingAddProcessor.java | 5 +- .../internal/TestRecordingCommunicationSpi.java | 9 + .../cache/IgniteOnePhaseCommitInvokeTest.java | 213 +++ .../IgniteCachePutRetryAbstractSelfTest.java| 25 +-- ...gniteCachePutRetryTransactionalSelfTest.java | 2 +- .../atomic/IgniteCacheAtomicProtocolTest.java | 16 +- .../testframework/junits/GridAbstractTest.java | 9 +- .../junits/common/GridCommonAbstractTest.java | 79 +++ .../testsuites/IgniteCacheTestSuite2.java | 3 + 15 files changed, 360 insertions(+), 109 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a4c39707/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 51a95a6..5abb6de 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -196,15 +196,6 @@ public class GridCacheUtils { /** Expire time: must be calculated based on TTL value. */ public static final long EXPIRE_TIME_CALCULATE = -1L; -/** Skip store flag bit mask. */ -public static final int SKIP_STORE_FLAG_MASK = 0x1; - -/** Keep serialized flag. */ -public static final int KEEP_BINARY_FLAG_MASK = 0x2; - -/** Flag indicating that old value for 'invoke' operation was non null on primary node. */ -public static final int OLD_VAL_ON_PRIMARY = 0x4; - /** Empty predicate array. */ private static final IgnitePredicate[] EMPTY = new IgnitePredicate[0]; http://git-wip-us.apache.org/repos/asf/ignite/blob/a4c39707/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index b1c2c27..74f34a9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -38,9 +38,6 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.internal.processors.cache.GridCacheUtils.KEEP_BINARY_FLAG_MASK; -import static org.apache.ignite.internal.processors.cache.GridCacheUtils.SKIP_STORE_FLAG_MASK; - /** * Lock request message. */ @@ -48,6 +45,12 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage { /** */ private static final long serialVersionUID = 0L; +/** Skip store flag bit mask. */ +private static final int SKIP_STORE_FLAG_MASK = 0x01; + +/** Keep binary flag. */ +private static final int KEEP_BINARY_FLAG_MASK = 0x02; + /** Sender node ID. */ private UUID nodeId; @@ -90,10 +93,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage { /** Key count. */ private int txSize; -/** - * Additional flags. - * GridCacheUtils.SKIP_STORE_FLAG_MASK - for skipStore flag value. - */ +/** Additional flags. */ private byte flags; /** http://git-wip-us
[17/70] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/IdentityValueMapper.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/IdentityValueMapper.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/IdentityValueMapper.java new file mode 100644 index 000..00bf915 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/IdentityValueMapper.java @@ -0,0 +1,53 @@ +/* + * 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.math; + +/** + * Identity value mapper. + */ +public class IdentityValueMapper implements ValueMapper { +/** */ private static final long serialVersionUID = -8010078306142216389L; + +/** {@inheritDoc} */ +@Override public Double fromDouble(double v) { +return v; +} + +/** {@inheritDoc} */ +@Override public double toDouble(Double v) { +assert v != null; + +return v; +} + +/** {@inheritDoc} */ +@Override public int hashCode() { +return Long.hashCode(serialVersionUID); +} + +/** {@inheritDoc} */ +@Override public boolean equals(Object o) { +if (this == o) +return true; + +if (o == null || getClass() != o.getClass()) +return false; + +return true; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/KeyMapper.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/KeyMapper.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/KeyMapper.java new file mode 100644 index 000..1ac2f3d --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/KeyMapper.java @@ -0,0 +1,33 @@ +/* + * 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.math; + +import java.io.Serializable; + +/** + * Maps key objects to index in {@link Vector} or {@link Matrix}. + */ +public interface KeyMapper extends Serializable { +/** + * Checks given cache key corresponds to a valid index in vector or matrix. + * + * @param k Key to check. + * @return {@code true} if there is a valid index, {@code false} otherwise. + */ +public boolean isValid(K k); +} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/Matrix.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/Matrix.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/Matrix.java new file mode 100644 index 000..1039484 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/Matrix.java @@ -0,0 +1,518 @@ +/* + * 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 + * distribute
[36/70] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index 7841f06..da6ebc1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -60,7 +60,12 @@ import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.configuration.TransactionConfiguration; import org.apache.ignite.events.EventType; import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.processors.query.QuerySchema; import org.apache.ignite.internal.processors.query.QueryUtils; +import org.apache.ignite.internal.processors.query.schema.message.SchemaAbstractDiscoveryMessage; +import org.apache.ignite.internal.processors.query.schema.SchemaExchangeWorkerTask; +import org.apache.ignite.internal.processors.query.schema.SchemaNodeLeaveExchangeWorkerTask; +import org.apache.ignite.internal.processors.query.schema.message.SchemaProposeDiscoveryMessage; import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions; import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException; import org.apache.ignite.internal.IgniteComponentType; @@ -343,6 +348,13 @@ public class GridCacheProcessor extends GridProcessorAdapter { * @return Task or {@code null} if message doesn't require any special processing. */ public CachePartitionExchangeWorkerTask exchangeTaskForCustomDiscoveryMessage(DiscoveryCustomMessage msg) { +if (msg instanceof SchemaAbstractDiscoveryMessage) { +SchemaAbstractDiscoveryMessage msg0 = (SchemaAbstractDiscoveryMessage)msg; + +if (msg0.exchange()) +return new SchemaExchangeWorkerTask(msg0); +} + return null; } @@ -352,7 +364,24 @@ public class GridCacheProcessor extends GridProcessorAdapter { * @param task Task. */ public void processCustomExchangeTask(CachePartitionExchangeWorkerTask task) { -// No-op. +if (task instanceof SchemaExchangeWorkerTask) { +SchemaAbstractDiscoveryMessage msg = ((SchemaExchangeWorkerTask)task).message(); + +if (msg instanceof SchemaProposeDiscoveryMessage) { +SchemaProposeDiscoveryMessage msg0 = (SchemaProposeDiscoveryMessage)msg; + +ctx.query().onSchemaPropose(msg0); +} +else +U.warn(log, "Unsupported schema discovery message: " + msg); +} +else if (task instanceof SchemaNodeLeaveExchangeWorkerTask) { +SchemaNodeLeaveExchangeWorkerTask task0 = (SchemaNodeLeaveExchangeWorkerTask)task; + +ctx.query().onNodeLeave(task0.node()); +} +else +U.warn(log, "Unsupported custom exchange task: " + task); } /** @@ -719,7 +748,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { cfg, cacheType, template, -IgniteUuid.randomUuid()); +IgniteUuid.randomUuid(), +new QuerySchema(cfg.getQueryEntities())); desc.locallyConfigured(true); desc.staticallyConfigured(true); @@ -755,7 +785,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { cfg, cacheType, true, -IgniteUuid.randomUuid()); +IgniteUuid.randomUuid(), +new QuerySchema(cfg.getQueryEntities())); desc0.locallyConfigured(true); desc0.staticallyConfigured(true); @@ -831,6 +862,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { // Must start database before start first cache. sharedCtx.database().onKernalStart(false); +ctx.query().onCacheKernalStart(); + // Start dynamic caches received from collect discovery data. for (DynamicCacheDescriptor desc : cacheDescriptors()) { if (ctx.config().isDaemon()) @@ -866,7 +899,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { caches.put(maskNull(name), cache); -startCache(cache); +startCache(cache, desc.schema()); jCacheProxies.put(maskNull(name), new IgniteCacheProxy(ctx, cache, null, false)); } @@ -1177,10 +1210,11 @@ public class GridCacheProcessor extends GridProcessorAdapter { /** * @param cache Cache to start. + * @param schema Cache sch
[50/70] [abbrv] ignite git commit: IGNITE-5001 .NET: Tests cleanup
IGNITE-5001 .NET: Tests cleanup Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d76a7299 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d76a7299 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d76a7299 Branch: refs/heads/ignite-2893 Commit: d76a7299a209c0282b9d7c1c97ea9f8c783d9ce6 Parents: 5dab5fb Author: Pavel Tupitsyn Authored: Wed Apr 19 15:02:59 2017 +0300 Committer: Pavel Tupitsyn Committed: Wed Apr 19 15:02:59 2017 +0300 -- .../Apache.Ignite.Core.Tests.csproj | 7 + .../Binary/BinaryBuilderSelfTest.cs | 3 +- .../BinaryBuilderSelfTestDynamicRegistration.cs | 2 + .../Binary/BinaryBuilderSelfTestSimpleName.cs | 2 + .../Binary/BinaryCompactFooterInteropTest.cs| 4 +- .../BinaryConfigurationTest.cs | 4 +- .../Cache/AddArgCacheEntryProcessor.cs | 91 .../Cache/Affinity/AffinityFunctionTest.cs | 1 - .../Cache/Affinity/AffinityTest.cs | 10 +- .../BinarizableAddArgCacheEntryProcessor.cs | 53 +++ .../Cache/BinarizableTestException.cs | 51 +++ .../Cache/CacheAbstractTest.cs | 422 --- .../Cache/CacheDynamicStartTest.cs | 164 +++ .../Cache/CacheForkedTest.cs| 6 +- .../Cache/CacheTestKey.cs | 68 +++ .../Cache/NonSerializableCacheEntryProcessor.cs | 40 ++ .../Cache/NonSerializableException.cs | 40 ++ .../Cache/Query/CacheQueriesTest.cs | 35 +- .../Continuous/ContinuousQueryAbstractTest.cs | 45 +- .../Continuous/ContinuousQueryJavaFilterTest.cs | 21 +- .../Cache/Store/CacheParallelLoadStoreTest.cs | 9 +- .../Cache/Store/CacheStoreSessionTest.cs| 15 +- .../Cache/Store/CacheStoreTest.cs | 17 +- .../Cache/TestReferenceObject.cs| 40 ++ .../Compute/AbstractTaskTest.cs | 29 +- .../Compute/BinarizableClosureTaskTest.cs | 14 +- .../Compute/BinarizableTaskTest.cs | 15 - .../Compute/ComputeApiTest.cs | 9 +- .../Compute/ComputeApiTestFullFooter.cs | 4 +- .../Compute/FailoverTaskSelfTest.cs | 6 - .../Compute/ResourceTaskTest.cs | 60 +-- .../Compute/SerializableClosureTaskTest.cs | 1 + .../Compute/TaskAdapterTest.cs | 6 - .../Compute/TaskResultTest.cs | 12 - .../Dataload/DataStreamerTest.cs| 55 +-- .../Apache.Ignite.Core.Tests/DeploymentTest.cs | 4 +- .../Apache.Ignite.Core.Tests/EventsTest.cs | 65 +-- .../Apache.Ignite.Core.Tests/ExceptionsTest.cs | 13 +- .../Apache.Ignite.Core.Tests/ExecutableTest.cs | 57 +-- .../Apache.Ignite.Core.Tests/FutureTest.cs | 18 +- .../IgniteStartStopTest.cs | 55 +-- .../Apache.Ignite.Core.Tests/IgniteTestBase.cs | 51 +-- .../Apache.Ignite.Core.Tests/LifecycleTest.cs | 45 +- .../Apache.Ignite.Core.Tests/LoadDllTest.cs | 11 +- .../Apache.Ignite.Core.Tests/MessagingTest.cs | 30 +- .../Impl/Binary/BinaryUtils.cs | 207 +++-- 46 files changed, 748 insertions(+), 1169 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj index a13878a..232b033 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj @@ -85,10 +85,16 @@ + + + + + + @@ -96,6 +102,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/d76a7299/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs index e8d0049..951f5d2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs @@ -135,8 +135,7 @@ namespace Apache.Ignite.Core.Tests.Binary [TestFixtureTearDown] public void TearDown() { -if (_grid != null) -Ig
ignite git commit: ignite-4984
Repository: ignite Updated Branches: refs/heads/ignite-4984 14582779f -> 75ca6a56d ignite-4984 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/75ca6a56 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/75ca6a56 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/75ca6a56 Branch: refs/heads/ignite-4984 Commit: 75ca6a56dc747a8e8257763489f5e702d09f9210 Parents: 1458277 Author: sboikov Authored: Thu Apr 20 10:54:39 2017 +0300 Committer: sboikov Committed: Thu Apr 20 10:54:39 2017 +0300 -- .../distributed/dht/GridPartitionedSingleGetFuture.java | 3 --- .../dht/atomic/GridDhtAtomicAbstractUpdateFuture.java| 3 --- .../dht/atomic/GridDhtAtomicSingleUpdateFuture.java | 3 --- .../dht/atomic/GridDhtAtomicUpdateFuture.java| 3 --- .../dht/atomic/GridNearAtomicAbstractUpdateFuture.java | 11 +-- .../dht/atomic/GridNearAtomicUpdateFuture.java | 1 + .../processors/cache/local/GridLocalLockFuture.java | 3 --- 7 files changed, 10 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/75ca6a56/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 3dfae6f..dbf1fe1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -63,9 +63,6 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh */ public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter implements GridCacheFuture, CacheGetFuture { -/** */ -private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference logRef = new AtomicReference<>(); http://git-wip-us.apache.org/repos/asf/ignite/blob/75ca6a56/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java index 87ef091..5c7c027 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java @@ -60,9 +60,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC */ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridCacheFutureAdapter implements GridCacheAtomicFuture { -/** */ -private static final long serialVersionUID = 0L; - /** Logger. */ protected static IgniteLogger log; http://git-wip-us.apache.org/repos/asf/ignite/blob/75ca6a56/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java index 8ebe9c3..f053d21 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java @@ -37,9 +37,6 @@ import org.jetbrains.annotations.Nullable; */ class GridDhtAtomicSingleUpdateFuture extends GridDhtAtomicAbstractUpdateFuture { /** */ -private static final long serialVersionUID = 0L; - -/** */ private boolean allUpdated; /** http://git-wip-us.apache.org/repos/asf/ignite/blob/75ca6a56/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.ja
ignite git commit: GridCacheMapEntry: fixed assert message in versionCheck
Repository: ignite Updated Branches: refs/heads/ignite-2.0 a4c397076 -> 88ce993f7 GridCacheMapEntry: fixed assert message in versionCheck Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/88ce993f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/88ce993f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/88ce993f Branch: refs/heads/ignite-2.0 Commit: 88ce993f7b2a9e8d1c23781f880b46cf4994dbaf Parents: a4c3970 Author: sboikov Authored: Thu Apr 20 11:06:11 2017 +0300 Committer: sboikov Committed: Thu Apr 20 11:06:11 2017 +0300 -- .../apache/ignite/internal/processors/cache/GridCacheMapEntry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/88ce993f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ddec684..856ac993 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -4767,7 +4767,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme } else assert entry.isStartVersion() || ATOMIC_VER_COMPARATOR.compare(entry.ver, newVer) <= 0 : -"Invalid version for inner update [isNew=" + entry.isStartVersion() + ", entry=" + this + ", newVer=" + newVer + ']'; +"Invalid version for inner update [isNew=" + entry.isStartVersion() + ", entry=" + entry + ", newVer=" + newVer + ']'; } /**
ignite git commit: ignite-2.0 - Javadoc
Repository: ignite Updated Branches: refs/heads/ignite-2.0 88ce993f7 -> f4404805f ignite-2.0 - Javadoc Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f4404805 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f4404805 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f4404805 Branch: refs/heads/ignite-2.0 Commit: f4404805fbebaf3907fcc2639e133894dcd24a96 Parents: 88ce993 Author: Alexey Goncharuk Authored: Thu Apr 20 11:22:40 2017 +0300 Committer: Alexey Goncharuk Committed: Thu Apr 20 11:23:24 2017 +0300 -- .../configuration/MemoryConfiguration.java | 15 + .../MemoryPolicyConfiguration.java | 32 +++- 2 files changed, 26 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f4404805/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java index de8fdbf..cd7c1fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java @@ -171,16 +171,19 @@ public class MemoryConfiguration implements Serializable { } /** - * TODO: document - * @return Concurrency level. + * Returns the number of concurrent segments in Ignite internal page mapping tables. By default equals + * to the number of available CPUs multiplied by 4. + * + * @return Mapping table concurrency level. */ public int getConcurrencyLevel() { return concLvl; } /** - * TODO: document - * @param concLvl Concurrency level. + * Sets the number of concurrent segments in Ignite internal page mapping tables. + * + * @param concLvl Mapping table oncurrency level. */ public MemoryConfiguration setConcurrencyLevel(int concLvl) { this.concLvl = concLvl; @@ -191,7 +194,7 @@ public class MemoryConfiguration implements Serializable { /** * Gets a name of default memory policy. * - * @return A name of a custom memory policy configured with {@link MemoryConfiguration} or {@code null} of the + * @return A name of a custom memory policy configured with {@code MemoryConfiguration} or {@code null} of the * default policy is used. */ public String getDefaultMemoryPolicyName() { @@ -202,7 +205,7 @@ public class MemoryConfiguration implements Serializable { * Sets the name for the default memory policy that will initialize the default memory region. * To set own default memory policy, create the policy first, pass it to * {@link MemoryConfiguration#setMemoryPolicies(MemoryPolicyConfiguration...)} method and change the name of the - * default memory policy with {@link MemoryConfiguration#setDefaultMemoryPolicyName(String)}. + * default memory policy with {@code MemoryConfiguration#setDefaultMemoryPolicyName(String)}. * * @param dfltMemPlcName Name of a memory policy to be used as default one. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/f4404805/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java index 810ecaa..6d5fe8c 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java @@ -78,16 +78,7 @@ public final class MemoryPolicyConfiguration implements Serializable { */ private double evictionThreshold = 0.9; -/** - * TODO: not clear description. - * - * When {@link #evictionThreshold} is reached, allocation of new data pages is prevented by maintaining this - * amount of evicted data pages in the pool. If any thread needs free page to store cache entry, - * it will take empty page from the pool instead of allocating a new one. - * Increase this parameter if cache can contain very big entries (total size of pages in the pool should be enough - * to contain largest cache entry). - * Increase this parameter if {@link IgniteOutOfMemoryException} occurred with enabled page eviction. - */ +/** Minimum number of empty pages in reuse lists. */ private int
[06/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java deleted file mode 100644 index 7a64c85..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/vector/VectorIterableTest.java +++ /dev/null @@ -1,376 +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.math.impls.vector; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Spliterator; -import java.util.function.BiConsumer; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.impls.MathTestConstants; -import org.junit.Test; - -import static java.util.Spliterator.ORDERED; -import static java.util.Spliterator.SIZED; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -/** */ -public class VectorIterableTest { -/** */ -@Test -public void allTest() { -consumeSampleVectors( -(v, desc) -> { -int expIdx = 0; - -for (Vector.Element e : v.all()) { -int actualIdx = e.index(); - -assertEquals("Unexpected index for " + desc, -expIdx, actualIdx); - -expIdx++; -} - -assertEquals("Unexpected amount of elements for " + desc, -expIdx, v.size()); -} -); -} - -/** */ -@Test -public void allTestBound() { -consumeSampleVectors( -(v, desc) -> iteratorTestBound(v.all().iterator(), desc) -); -} - -/** */ -@Test -public void nonZeroesTestBasic() { -final int size = 5; - -final double[] nonZeroesOddData = new double[size], nonZeroesEvenData = new double[size]; - -for (int idx = 0; idx < size; idx++) { -final boolean odd = (idx & 1) == 1; - -nonZeroesOddData[idx] = odd ? 1 : 0; - -nonZeroesEvenData[idx] = odd ? 0 : 1; -} - -assertTrue("Arrays failed to initialize.", -!isZero(nonZeroesEvenData[0]) -&& isZero(nonZeroesEvenData[1]) -&& isZero(nonZeroesOddData[0]) -&& !isZero(nonZeroesOddData[1])); - -final Vector nonZeroesEvenVec = new DenseLocalOnHeapVector(nonZeroesEvenData), -nonZeroesOddVec = new DenseLocalOnHeapVector(nonZeroesOddData); - -assertTrue("Vectors failed to initialize.", -!isZero(nonZeroesEvenVec.getElement(0).get()) -&& isZero(nonZeroesEvenVec.getElement(1).get()) -&& isZero(nonZeroesOddVec.getElement(0).get()) -&& !isZero(nonZeroesOddVec.getElement(1).get())); - -assertTrue("Iterator(s) failed to start.", -nonZeroesEvenVec.nonZeroes().iterator().next() != null -&& nonZeroesOddVec.nonZeroes().iterator().next() != null); - -int nonZeroesActual = 0; - -for (Vector.Element e : nonZeroesEvenVec.nonZeroes()) { -final int idx = e.index(); - -final boolean odd = (idx & 1) == 1; - -final double val = e.get(); - -assertTrue("Not an even index " + idx + ", for value " + val, !odd); - -assertTrue("Zero value " + val + " at even index " + idx, !isZero(val)); - -nonZeroesActual++; -} - -final int nonZeroesOddExp = (size + 1) / 2; - -assertEquals("Unexpected num of iterated odd non-zeroes.", nonZeroesOddExp, nonZeroesActual); - -assertEquals("Unexpected nonZeroElements of odd.", nonZeroesOddExp, nonZeroesEvenVec.nonZeroElements()); - -nonZeroesActual = 0; - -for (Vector.Element e : nonZeroesOddVec.nonZeroes()) { -
[03/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java new file mode 100644 index 000..7c2d415 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java @@ -0,0 +1,126 @@ +/* + * 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.math.impls.storage.matrix; + +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.impls.MathTestConstants; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.apache.ignite.testframework.junits.common.GridCommonTest; + +/** + * Tests for {@link SparseDistributedMatrixStorage}. + */ +@GridCommonTest(group = "Distributed Models") +public class SparseDistributedMatrixStorageTest extends GridCommonAbstractTest { +/** Number of nodes in grid */ +private static final int NODE_COUNT = 3; +/** Cache name. */ +private static final String CACHE_NAME = "test-cache"; +/** */ +private static final String UNEXPECTED_ATTRIBUTE_VALUE = "Unexpected attribute value."; +/** Grid instance. */ +private Ignite ignite; + +/** + * Default constructor. + */ +public SparseDistributedMatrixStorageTest() { +super(false); +} + +/** {@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(); +} + +/** + * {@inheritDoc} + */ +@Override protected void beforeTest() throws Exception { +ignite = grid(NODE_COUNT); + +ignite.configuration().setPeerClassLoadingEnabled(true); +} + +/** {@inheritDoc} */ +@Override protected void afterTest() throws Exception { +ignite.destroyCache(CACHE_NAME); +} + +/** */ +public void testCacheCreation() throws Exception { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +assertNotNull("SparseDistributedMatrixStorage cache is null.", storage.cache()); +} + +/** */ +public void testSetGet() throws Exception { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +for (int i = 0; i < rows; i++) { +for (int j = 0; j < cols; j++) { +double v = Math.random(); +storage.set(i, j, v); + +assert Double.compare(v, storage.get(i, j)) == 0; +assert Double.compare(v, storage.get(i, j)) == 0; +} +} +} + +/** */ +public void testAttributes() { + IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); + +final int rows = MathTestConstants.STORAGE_SIZE; +final int cols = MathTestConstants.STORAGE_SIZE; + +SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); + +
[01/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
Repository: ignite Updated Branches: refs/heads/ignite-4535 939ff399d -> 924930cdf http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java new file mode 100644 index 000..16c2571 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/impls/vector/VectorIterableTest.java @@ -0,0 +1,376 @@ +/* + * 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.math.impls.vector; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Spliterator; +import java.util.function.BiConsumer; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.impls.MathTestConstants; +import org.junit.Test; + +import static java.util.Spliterator.ORDERED; +import static java.util.Spliterator.SIZED; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** */ +public class VectorIterableTest { +/** */ +@Test +public void allTest() { +consumeSampleVectors( +(v, desc) -> { +int expIdx = 0; + +for (Vector.Element e : v.all()) { +int actualIdx = e.index(); + +assertEquals("Unexpected index for " + desc, +expIdx, actualIdx); + +expIdx++; +} + +assertEquals("Unexpected amount of elements for " + desc, +expIdx, v.size()); +} +); +} + +/** */ +@Test +public void allTestBound() { +consumeSampleVectors( +(v, desc) -> iteratorTestBound(v.all().iterator(), desc) +); +} + +/** */ +@Test +public void nonZeroesTestBasic() { +final int size = 5; + +final double[] nonZeroesOddData = new double[size], nonZeroesEvenData = new double[size]; + +for (int idx = 0; idx < size; idx++) { +final boolean odd = (idx & 1) == 1; + +nonZeroesOddData[idx] = odd ? 1 : 0; + +nonZeroesEvenData[idx] = odd ? 0 : 1; +} + +assertTrue("Arrays failed to initialize.", +!isZero(nonZeroesEvenData[0]) +&& isZero(nonZeroesEvenData[1]) +&& isZero(nonZeroesOddData[0]) +&& !isZero(nonZeroesOddData[1])); + +final Vector nonZeroesEvenVec = new DenseLocalOnHeapVector(nonZeroesEvenData), +nonZeroesOddVec = new DenseLocalOnHeapVector(nonZeroesOddData); + +assertTrue("Vectors failed to initialize.", +!isZero(nonZeroesEvenVec.getElement(0).get()) +&& isZero(nonZeroesEvenVec.getElement(1).get()) +&& isZero(nonZeroesOddVec.getElement(0).get()) +&& !isZero(nonZeroesOddVec.getElement(1).get())); + +assertTrue("Iterator(s) failed to start.", +nonZeroesEvenVec.nonZeroes().iterator().next() != null +&& nonZeroesOddVec.nonZeroes().iterator().next() != null); + +int nonZeroesActual = 0; + +for (Vector.Element e : nonZeroesEvenVec.nonZeroes()) { +final int idx = e.index(); + +final boolean odd = (idx & 1) == 1; + +final double val = e.get(); + +assertTrue("Not an even index " + idx + ", for value " + val, !odd); + +assertTrue("Zero value " + val + " at even index " + idx, !isZero(val)); + +nonZeroesActual++; +} + +final int nonZeroesOddExp = (size + 1) / 2; + +assertEquals("Unexpected num of iterated odd non-zeroes.", nonZeroesOddExp, nonZeroesActual); + +assertEquals("Unexpected nonZeroElements of odd.", nonZeroesOddExp, nonZeroesEvenVec.nonZeroElements()); +
[05/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java b/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java new file mode 100644 index 000..d283ce7 --- /dev/null +++ b/modules/ml/src/test/java/org/apache/ignite/ml/math/decompositions/EigenDecompositionTest.java @@ -0,0 +1,193 @@ +/* + * 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.math.decompositions; + +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +/** + * Tests for {@link EigenDecomposition} + */ +public class EigenDecompositionTest { +/** */ +private static final double EPSILON = 1e-11; + +/** */ +@Test +public void testMatrixWithRealEigenvalues() { +test(new double[][] { +{1.0d, 0.0d, 0.0d, 0.0d}, +{0.0d, 1.0d, 0.0d, 0.0d}, +{0.0d, 0.0d, 2.0d, 0.0d}, +{1.0d, 1.0d, 0.0d, 2.0d}}, +new double[] {1, 2, 2, 1}); +} + +/** */ +@Test +public void testSymmetricMatrix() { +EigenDecomposition decomposition = new EigenDecomposition(new DenseLocalOnHeapMatrix(new double[][] { +{1.0d, 0.0d, 0.0d, 1.0d}, +{0.0d, 1.0d, 0.0d, 1.0d}, +{0.0d, 0.0d, 2.0d, 0.0d}, +{1.0d, 1.0d, 0.0d, 2.0d}})); + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertNotNull("Matrix d is expected to be not null.", d); +assertNotNull("Matrix v is expected to be not null.", v); + +assertEquals("Unexpected rows in d matrix.", 4, d.rowSize()); +assertEquals("Unexpected cols in d matrix.", 4, d.columnSize()); + +assertEquals("Unexpected rows in v matrix.", 4, v.rowSize()); +assertEquals("Unexpected cols in v matrix.", 4, v.columnSize()); + +assertIsDiagonalNonZero(d); + +decomposition.destroy(); +} + +/** */ +@Test +public void testNonSquareMatrix() { +EigenDecomposition decomposition = new EigenDecomposition(new DenseLocalOnHeapMatrix(new double[][] { +{1.0d, 0.0d, 0.0d}, +{0.0d, 1.0d, 0.0d}, +{0.0d, 0.0d, 2.0d}, +{1.0d, 1.0d, 0.0d}})); +// todo find out why decomposition of 3X4 matrix throws row index exception + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertNotNull("Matrix d is expected to be not null.", d); +assertNotNull("Matrix v is expected to be not null.", v); + +assertEquals("Unexpected rows in d matrix.", 4, d.rowSize()); +assertEquals("Unexpected cols in d matrix.", 4, d.columnSize()); + +assertEquals("Unexpected rows in v matrix.", 4, v.rowSize()); +assertEquals("Unexpected cols in v matrix.", 3, v.columnSize()); + +assertIsDiagonal(d, true); + +decomposition.destroy(); +} + +/** */ +private void test(double[][] mRaw, double[] expRealEigenValues) { +DenseLocalOnHeapMatrix m = new DenseLocalOnHeapMatrix(mRaw); +EigenDecomposition decomposition = new EigenDecomposition(m); + +Matrix d = decomposition.getD(); +Matrix v = decomposition.getV(); + +assertIsDiagonalNonZero(d); + +// check that d's diagonal consists of eigenvalues of m. +assertDiagonalConsistsOfEigenvalues(m, d, v); + +// m = v d v^{-1} is equivalent to +// m v = v d +assertMatricesAreEqual(m.times(v), v.times(d)); + +assertEigenvalues(decomposition, expRealEigenValues); + +decomposition.destroy(); +} + +/** */ +private void assertEigenvalues(EigenDecomposition decomposit
[10/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java b/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java deleted file mode 100644 index d0b89f8..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/decompositions/SingularValueDecompositionTest.java +++ /dev/null @@ -1,120 +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.math.decompositions; - -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.impls.matrix.DenseLocalOnHeapMatrix; -import org.apache.ignite.math.impls.matrix.PivotedMatrixView; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** */ -public class SingularValueDecompositionTest { -/** */ -@Test -public void basicTest() { -basicTest(new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d}, -{0.0d, -1.0d, 2.0d} -})); -} - -/** - * Test for {@link DecompositionSupport} features. - */ -@Test -public void decompositionSupportTest() { -basicTest(new PivotedMatrixView(new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d}, -{0.0d, -1.0d, 2.0d} -}))); -} - -/** */ -@Test -public void rowsLessThanColumnsTest() { -DenseLocalOnHeapMatrix m = new DenseLocalOnHeapMatrix(new double[][] { -{2.0d, -1.0d, 0.0d}, -{-1.0d, 2.0d, -1.0d} -}); - -SingularValueDecomposition dec = new SingularValueDecomposition(m); -assertEquals("Unexpected value for singular values size.", -2, dec.getSingularValues().length); - -Matrix s = dec.getS(); -Matrix u = dec.getU(); -Matrix v = dec.getV(); -Matrix covariance = dec.getCovariance(0.5); - -assertNotNull("Matrix s is expected to be not null.", s); -assertNotNull("Matrix u is expected to be not null.", u); -assertNotNull("Matrix v is expected to be not null.", v); -assertNotNull("Covariance matrix is expected to be not null.", covariance); - -dec.destroy(); -} - -/** */ -@Test(expected = AssertionError.class) -public void nullMatrixTest() { -new SingularValueDecomposition(null); -} - -/** */ -private void basicTest(Matrix m) { -SingularValueDecomposition dec = new SingularValueDecomposition(m); -assertEquals("Unexpected value for singular values size.", -3, dec.getSingularValues().length); - -Matrix s = dec.getS(); -Matrix u = dec.getU(); -Matrix v = dec.getV(); -Matrix covariance = dec.getCovariance(0.5); - -assertNotNull("Matrix s is expected to be not null.", s); -assertNotNull("Matrix u is expected to be not null.", u); -assertNotNull("Matrix v is expected to be not null.", v); -assertNotNull("Covariance matrix is expected to be not null.", covariance); - -assertTrue("Decomposition cond is expected to be positive.", dec.cond() > 0); -assertTrue("Decomposition norm2 is expected to be positive.", dec.norm2() > 0); -assertEquals("Decomposition rank differs from expected.", 3, dec.rank()); -assertEquals("Decomposition singular values size differs from expected.", -3, dec.getSingularValues().length); - -Matrix recomposed = (u.times(s).times(v.transpose())); - -for (int row = 0; row < m.rowSize(); row++) -for (int col = 0; col < m.columnSize(); col++) -assertEquals("Unexpected recomposed matrix value at (" + row + "," + col + ").", -m.get(row, col), recomposed.get(row, col), 0.001); - -for (int row = 0; row < cov
[12/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java new file mode 100644 index 000..3c075f4 --- /dev/null +++ b/modules/ml/src/main/java/org/apache/ignite/ml/math/impls/vector/AbstractVector.java @@ -0,0 +1,903 @@ +/* + * 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.math.impls.vector; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Spliterator; +import java.util.function.Consumer; +import java.util.function.IntToDoubleFunction; +import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.ml.math.Matrix; +import org.apache.ignite.ml.math.Vector; +import org.apache.ignite.ml.math.VectorStorage; +import org.apache.ignite.ml.math.exceptions.CardinalityException; +import org.apache.ignite.ml.math.exceptions.IndexException; +import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; +import org.apache.ignite.ml.math.functions.Functions; +import org.apache.ignite.ml.math.functions.IgniteBiFunction; +import org.apache.ignite.ml.math.functions.IgniteDoubleFunction; +import org.apache.ignite.ml.math.impls.matrix.MatrixView; +import org.jetbrains.annotations.NotNull; + +/** + * This class provides a helper implementation of the {@link Vector} + * interface to minimize the effort required to implement it. + * Subclasses may override some of the implemented methods if a more + * specific or optimized implementation is desirable. + */ +public abstract class AbstractVector implements Vector { +/** Vector storage implementation. */ +private VectorStorage sto; + +/** Meta attribute storage. */ +private Map meta = new HashMap<>(); + +/** Vector's GUID. */ +private IgniteUuid guid = IgniteUuid.randomUuid(); + +/** Cached value for length squared. */ +private double lenSq = 0.0; + +/** Maximum cached element. */ +private Element maxElm = null; +/** Minimum cached element. */ +private Element minElm = null; + +/** Readonly flag (false by default). */ +private boolean readOnly = false; + +/** Read-only error message. */ +private static final String RO_MSG = "Vector is read-only."; + +/** + * + */ +private void ensureReadOnly() { +if (readOnly) +throw new UnsupportedOperationException(RO_MSG); +} + +/** + * @param sto Storage. + */ +public AbstractVector(VectorStorage sto) { +this(false, sto); +} + +/** + * @param readOnly Is read only. + * @param sto Storage. + */ +public AbstractVector(boolean readOnly, VectorStorage sto) { +assert sto != null; + +this.readOnly = readOnly; +this.sto = sto; +} + +/** + * + */ +public AbstractVector() { +// No-op. +} + +/** + * Set storage. + * + * @param sto Storage. + */ +protected void setStorage(VectorStorage sto) { +this.sto = sto; +} + +/** + * @param i Index. + * @param v Value. + */ +protected void storageSet(int i, double v) { +ensureReadOnly(); + +sto.set(i, v); + +// Reset cached values. +lenSq = 0.0; +maxElm = minElm = null; +} + +/** + * @param i Index. + * @return Value. + */ +protected double storageGet(int i) { +return sto.get(i); +} + +/** {@inheritDoc} */ +@Override public int size() { +return sto.size(); +} + +/** + * Check index bounds. + * + * @param idx Index to check. + */ +protected void checkIndex(int idx) { +if (idx < 0 || idx >= sto.size()) +throw new IndexException(idx); +} + +/** {@inheritDoc} */ +@Overr
[11/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html -- diff --git a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html b/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html deleted file mode 100644 index 19a907a..000 --- a/modules/ml/src/main/resources/org/apache/ignite/math/d3-matrix-template.html +++ /dev/null @@ -1,128 +0,0 @@ - - - -IgniteML - -body { -margin: 0 15px; -} - -p { -margin: 10px 0 !important; -} - -.name { -font-size: 20px; -font-weight: 400; -font-family: monospace; -} - -.swatch { -display: inline-block; -width: 25px; -height: 25px; -margin-left: 5px; -vertical-align: bottom; -} - - -https://ignite.apache.org/images/logo3.png";> -https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js";> - -/*@DATA@*/ -var data = [[{d: 2.256, r: 198, g: 128, b: 128}, {d: 0.123, r: 218, g: 228, b: 18}], [{ -d: 2.256, -r: 108, -g: 28, -b: 108 -}, {d: 0.123, r: 228, g: 228, b: 228}]]; -/*@MAX@*/ -var max = {d: 2.256, r: 128, g: 128, b: 128}; -/*@MIN@*/ -var min = {d: 0.123, r: 228, g: 228, b: 228}; -/*@NAME@*/ -var name = "Matrix"; - -var rows = data.length; -var cols = data[0].length; - -var range = max.d - min.d; - -var rw, rh; -var W, H; - -if (cols > W) { -rw = 1; -W = cols; -} -else { -W = 1000; -rw = Math.min(Math.round(W / cols), 10); -} - -if (rows > H) { -rh = 1; -H = rows; -} -else { -H = 1000; -rh = Math.min(Math.round(H / rows), 10); -} - -d3.selectAll("body") -.append("p") -.text(name + " (" + rows + "x" + cols + ")") -.attr("class", "name"); - -d3.selectAll("body") -.append("p") -.attr("class", "name") -.text("Max: " + max.d) -.append("span") -.attr("class", "swatch") -.attr("style", "background-color: rgb(" + max.r + ", " + max.g + ", " + max.b + ")"); - -d3.selectAll("body") -.append("p") -.attr("class", "name") -.text("Min: " + min.d) -.append("span") -.attr("class", "swatch") -.attr("style", "background-color: rgb(" + min.r + ", " + min.g + ", " + min.b + ")"); - -var svg = d3.select("body").append("svg") -.attr("width", W) -.attr("height", H); - -var y = 0; - -for (var row = 0; row < rows; row++) -svg.selectAll("div") -.data(data[row]) -.enter() -.append("rect") -.attr("x", function (d, i) { -return i * rw -}) -.attr("y", rh * row) -.attr("fill", function (d) { -return "rgb(" + d.r + ", " + d.g + ", " + d.b + ")"; -}) -.attr("width", rw) -.attr("height", rh); - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html -- diff --git a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html b/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html deleted file mode 100644 index 7644481..000 --- a/modules/ml/src/main/resources/org/apache/ignite/math/d3-vector-template.html +++ /dev/null @@ -1,111 +0,0 @@ - - - -IgniteML - -body { -margin: 0 15px; -} - -p { -margin: 10px 0 !important; -} - -.name { -font-size: 20px; -font-weight: 400; -font-family: monospace; -} - -.swatch { -display: inline-block; -width: 25px; -height: 25px; -margin-left: 5px; -vertical-align: bottom; -} - - -https://ignite.apache.org/images/logo3.png";> -https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js";> - -/*@DATA@*/ -var data = [{d: 2.256, r: 128, g: 128, b: 128}, {d: 0.123, r: 228, g: 228, b: 228}]; -/*@MAX@*/ -var max = {d: 2.256, r: 128, g: 128, b: 128}; -/*@MIN@*/ -var min = {d: 0.123, r: 228, g: 228, b: 228}; -/*@NAME@*/ -var name = "Vector"; - -var W, H = 1000; - -var range = max.d - min.d; - -var rh = 20; // Constant. - -var rw; - -if (data.length > W) { -rw = 1; -W = data.length; -} -else { -W = 1000; -rw = Math.min(Math.round(W / data.length), 5); -} - -d3.selectAll("body") -.append("p") -.text(name + " (size: " + data.length + ")") -.attr("class", "name"); - -d3.selectAll("body") -.append("p") -.attr("cla
[52/71] [abbrv] ignite git commit: IGNITE-4898: Added ODBC installers paths to README. This closes #1753.
IGNITE-4898: Added ODBC installers paths to README. This closes #1753. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f278dc96 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f278dc96 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f278dc96 Branch: refs/heads/ignite-4535 Commit: f278dc969a69ad3c166fc863de5b0ffcd46a19c6 Parents: 5dab5fb Author: isapego Authored: Wed Apr 19 15:12:42 2017 +0300 Committer: devozerov Committed: Wed Apr 19 15:12:42 2017 +0300 -- modules/platforms/cpp/odbc/README.txt | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f278dc96/modules/platforms/cpp/odbc/README.txt -- diff --git a/modules/platforms/cpp/odbc/README.txt b/modules/platforms/cpp/odbc/README.txt index fe40a5c..3a83f84 100644 --- a/modules/platforms/cpp/odbc/README.txt +++ b/modules/platforms/cpp/odbc/README.txt @@ -19,13 +19,13 @@ arguments: 1. Address of the node to connect to: SERVER=; - + 2. Port on which OdbcProcessor of the node is listening: PORT=; - + 3. Datagrid cache to connect to: CACHE=; - + All arguments are case-insensitive so "SERVER", "Server" and "server" all are valid server address arguments. @@ -46,11 +46,11 @@ ODBC driver you should perfrom the following steps: $ ldd /usr/local/lib/libignite-odbc.so. If there is unresolved links to other libraries you may want to add directories with these libraries to the LD_LIBRARY_PATH. - + 2. Edit file $IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini and ensure that "Driver" parameter of the "Apache Ignite" section points to the right location where libignite-odbc.so is located. - + 3. To install Apache Ignite ODBC driver use the following command: $ odbcinst -i -d -f $IGNITE_HOME/platforms/cpp/odbc/install/ignite-odbc-install.ini To perform this command you most likely will need root privileges. @@ -67,9 +67,12 @@ There are two ways to install ODBC driver currently. The first one is to use 32-bit or 64-bit installer. This is the most simple way and you are recommended to stick to it by default. +32-bit installer : $IGNITE_HOME/platforms/cpp/bin/odbc/ignite-odbc-x86.msi +64-bit installer : $IGNITE_HOME/platforms/cpp/bin/odbc/ignite-odbc-amd64.msi + However there is also another way to install driver manually using scripts. If you choose this method you should first choose a directory on your filesystem -where your driver or drivers will be located. Once you have choosen the place +where your driver or drivers will be located. Once you have chosen the place you should put your driver there and ensure that all driver dependencies can be resolved i.e. they can be found either in the %PATH% or in the same directory as the driver. @@ -88,7 +91,7 @@ Thats it. Your driver/drivers are installed. After the installation === - + Now Apache Ignite ODBC driver is installed and ready for use. You can connect to it and use it like to any other ODBC driver.
[30/71] [abbrv] ignite git commit: IGNITE-4565: Implemented CREATE INDEX and DROP INDEX. This closes #1773. This closes #1804.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java new file mode 100644 index 000..85a8837 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexTransactionalReplicatedSelfTest.java @@ -0,0 +1,39 @@ +/* + * 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.index; + +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; + +/** */ +public class H2DynamicIndexTransactionalReplicatedSelfTest extends H2DynamicIndexAbstractSelfTest { +/** {@inheritDoc} */ +@Override protected CacheMode cacheMode() { +return CacheMode.REPLICATED; +} + +/** {@inheritDoc} */ +@Override protected CacheAtomicityMode atomicityMode() { +return CacheAtomicityMode.TRANSACTIONAL; +} + +/** {@inheritDoc} */ +@Override protected boolean nearCache() { +return false; +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2edb935c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java new file mode 100644 index 000..95ad2f1 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SchemaExchangeSelfTest.java @@ -0,0 +1,589 @@ +/* + * 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.index; + +import org.apache.ignite.IgniteClientDisconnectedException; +import org.apache.ignite.Ignition; +import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl; +import org.apache.ignite.internal.util.lang.GridAbsPredicate; +import org.apache.ignite.internal.util.typedef.F; +import org.apache.ignite.lang.IgniteFuture; +import org.apache.ignite.lang.IgnitePredicate; +import org.apache.ignite.testframework.GridTestUtils; + +import java.util.Collections; +import java.util.Map; + +/** + * Tests for schema exchange between nodes. + */ +public class SchemaExchangeSelfTest extends AbstractSchemaSelfTest { +/** Node on which filter should be applied (if any). */ +private static String filterNodeName; + +/** {@inheritDoc} */ +@Override protected void afterTest() throws Exception { +stopAllGrids(); + +filterNodeName = null; + +super.afterTest(); +} + +/** + * Test propagation o
[08/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java -- diff --git a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java b/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java deleted file mode 100644 index 66fe9b4..000 --- a/modules/ml/src/test/java/org/apache/ignite/math/impls/storage/matrix/SparseDistributedMatrixStorageTest.java +++ /dev/null @@ -1,126 +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.math.impls.storage.matrix; - -import org.apache.ignite.Ignite; -import org.apache.ignite.internal.util.IgniteUtils; -import org.apache.ignite.math.StorageConstants; -import org.apache.ignite.math.impls.MathTestConstants; -import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; -import org.apache.ignite.testframework.junits.common.GridCommonTest; - -/** - * Tests for {@link SparseDistributedMatrixStorage}. - */ -@GridCommonTest(group = "Distributed Models") -public class SparseDistributedMatrixStorageTest extends GridCommonAbstractTest { -/** Number of nodes in grid */ -private static final int NODE_COUNT = 3; -/** Cache name. */ -private static final String CACHE_NAME = "test-cache"; -/** */ -private static final String UNEXPECTED_ATTRIBUTE_VALUE = "Unexpected attribute value."; -/** Grid instance. */ -private Ignite ignite; - -/** - * Default constructor. - */ -public SparseDistributedMatrixStorageTest() { -super(false); -} - -/** {@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(); -} - -/** - * {@inheritDoc} - */ -@Override protected void beforeTest() throws Exception { -ignite = grid(NODE_COUNT); - -ignite.configuration().setPeerClassLoadingEnabled(true); -} - -/** {@inheritDoc} */ -@Override protected void afterTest() throws Exception { -ignite.destroyCache(CACHE_NAME); -} - -/** */ -public void testCacheCreation() throws Exception { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -assertNotNull("SparseDistributedMatrixStorage cache is null.", storage.cache()); -} - -/** */ -public void testSetGet() throws Exception { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -for (int i = 0; i < rows; i++) { -for (int j = 0; j < cols; j++) { -double v = Math.random(); -storage.set(i, j, v); - -assert Double.compare(v, storage.get(i, j)) == 0; -assert Double.compare(v, storage.get(i, j)) == 0; -} -} -} - -/** */ -public void testAttributes() { - IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName()); - -final int rows = MathTestConstants.STORAGE_SIZE; -final int cols = MathTestConstants.STORAGE_SIZE; - -SparseDistributedMatrixStorage storage = new SparseDistributedMatrixStorage(rows, cols, StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE); - -assertEqu
[70/71] [abbrv] ignite git commit: Merge branch 'ignite-2.0' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-4535
Merge branch 'ignite-2.0' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-4535 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c9c1bc19 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c9c1bc19 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c9c1bc19 Branch: refs/heads/ignite-4535 Commit: c9c1bc196923cb6bef3d075edd3eb57309d2ba2b Parents: 939ff39 f440480 Author: Alexey Goncharuk Authored: Thu Apr 20 11:26:07 2017 +0300 Committer: Alexey Goncharuk Committed: Thu Apr 20 11:26:07 2017 +0300 -- assembly/release-fabric-base.xml|5 - config/dotnet/default-dotnet.xml| 45 - examples/pom-standalone-lgpl.xml|4 - examples/pom-standalone.xml |4 - examples/pom.xml|4 - .../CholeskyDecompositionExample.java |8 +- .../EigenDecompositionExample.java |8 +- .../decompositions/LUDecompositionExample.java |8 +- .../SingularValueDecompositionExample.java |6 +- .../ml/math/matrix/CacheMatrixExample.java | 10 +- .../ml/math/matrix/ExampleMatrixStorage.java|4 +- .../math/matrix/MatrixCustomStorageExample.java | 12 +- .../examples/ml/math/matrix/MatrixExample.java |4 +- .../ml/math/matrix/MatrixExampleUtil.java |4 +- .../ml/math/matrix/OffHeapMatrixExample.java|4 +- .../matrix/SparseDistributedMatrixExample.java |5 +- .../ml/math/matrix/SparseMatrixExample.java |4 +- .../examples/ml/math/tracer/TracerExample.java |4 +- .../ml/math/vector/CacheVectorExample.java |8 +- .../ml/math/vector/ExampleVectorStorage.java|4 +- .../ml/math/vector/OffHeapVectorExample.java|4 +- .../ml/math/vector/SparseVectorExample.java |6 +- .../math/vector/VectorCustomStorageExample.java | 14 +- .../examples/ml/math/vector/VectorExample.java |4 +- .../benchmarks/jmh/tree/BPlusTreeBenchmark.java |1 + .../store/cassandra/datasource/DataSource.java | 50 +- .../cassandra/session/CassandraSessionImpl.java | 23 +- .../cassandra/session/pool/SessionPool.java |6 +- .../cassandra/session/pool/SessionWrapper.java | 15 +- .../jdbc2/JdbcAbstractDmlStatementSelfTest.java | 92 +- ...BinaryMarshallerInsertStatementSelfTest.java |9 +- ...cBinaryMarshallerMergeStatementSelfTest.java |9 +- .../jdbc2/JdbcDynamicIndexAbstractSelfTest.java | 367 ...namicIndexAtomicPartitionedNearSelfTest.java | 26 + ...bcDynamicIndexAtomicPartitionedSelfTest.java | 39 + ...dbcDynamicIndexAtomicReplicatedSelfTest.java | 39 + ...dexTransactionalPartitionedNearSelfTest.java | 26 + ...icIndexTransactionalPartitionedSelfTest.java | 39 + ...micIndexTransactionalReplicatedSelfTest.java | 39 + .../jdbc2/JdbcInsertStatementSelfTest.java |4 +- .../JettyRestProcessorAbstractSelfTest.java | 10 + .../jdbc/suite/IgniteJdbcDriverTestSuite.java |8 + .../org/apache/ignite/IgniteFileSystem.java |2 +- .../apache/ignite/IgniteSystemProperties.java |8 + .../org/apache/ignite/cache/QueryEntity.java| 82 +- .../org/apache/ignite/cache/QueryIndex.java |9 + .../store/jdbc/CacheAbstractJdbcStore.java | 37 +- .../cache/store/jdbc/CacheJdbcPojoStore.java|1 - .../configuration/CacheConfiguration.java | 57 +- .../configuration/FileSystemConfiguration.java | 234 +-- .../configuration/MemoryConfiguration.java | 15 +- .../MemoryPolicyConfiguration.java | 34 +- .../apache/ignite/internal/GridComponent.java |5 +- .../ignite/internal/GridKernalContext.java |7 + .../ignite/internal/GridKernalContextImpl.java | 13 +- .../org/apache/ignite/internal/GridTopic.java |5 +- .../org/apache/ignite/internal/IgniteEx.java|2 +- .../apache/ignite/internal/IgniteKernal.java| 35 +- .../org/apache/ignite/internal/IgnitionEx.java | 18 + .../managers/communication/GridIoManager.java |2 + .../communication/GridIoMessageFactory.java | 14 +- .../managers/communication/GridIoPolicy.java|3 + .../mem/IgniteOutOfMemoryException.java | 51 + .../internal/mem/OutOfMemoryException.java | 51 - .../pagemem/impl/PageMemoryNoStoreImpl.java | 16 +- .../cache/CacheAffinitySharedManager.java |3 +- .../cache/CachePartitionExchangeWorkerTask.java |6 +- .../cache/DynamicCacheChangeRequest.java| 23 +- .../cache/DynamicCacheDescriptor.java | 50 +- .../processors/cache/GridCacheAdapter.java |5 +- .../processors/cache/GridCacheEntryEx.java | 13 +- .../processors/cache/GridCacheMapEntry.java | 19 +- .../GridCachePartitionExchangeManager.java | 36 +- .../processors/cache/GridCacheProcess
[18/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java deleted file mode 100644 index 0e9b26f..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/CacheVector.java +++ /dev/null @@ -1,140 +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.math.impls.vector; - -import org.apache.ignite.IgniteCache; -import org.apache.ignite.math.Matrix; -import org.apache.ignite.math.ValueMapper; -import org.apache.ignite.math.Vector; -import org.apache.ignite.math.VectorKeyMapper; -import org.apache.ignite.math.exceptions.UnsupportedOperationException; -import org.apache.ignite.math.functions.IgniteBiFunction; -import org.apache.ignite.math.functions.IgniteDoubleFunction; -import org.apache.ignite.math.functions.IgniteFunction; -import org.apache.ignite.math.impls.CacheUtils; -import org.apache.ignite.math.impls.storage.vector.CacheVectorStorage; - -/** - * Vector based on existing cache and index and value mapping functions. - */ -public class CacheVector extends AbstractVector { -/** - * - */ -public CacheVector() { -// No-op. -} - -/** - * Creates new vector over existing cache. - * - * @param size - * @param cache - * @param keyFunc - * @param valMapper - */ -public CacheVector( -int size, -IgniteCache cache, -VectorKeyMapper keyFunc, -ValueMapper valMapper) { -setStorage(new CacheVectorStorage<>(size, cache, keyFunc, valMapper)); -} - -/** - * @param mapper - */ -private Vector mapOverCache(IgniteFunction mapper) { -CacheVectorStorage sto = storage(); - -CacheUtils.map(sto.cache().getName(), sto.keyMapper(), sto.valueMapper(), mapper); - -return this; -} - -/** {@inheritDoc} */ -@Override public double minValue() { -CacheVectorStorage sto = storage(); - -return CacheUtils.min(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public double maxValue() { -CacheVectorStorage sto = storage(); - -return CacheUtils.max(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public Vector map(IgniteDoubleFunction fun) { -return mapOverCache(fun::apply); -} - -/** {@inheritDoc} */ -@Override public Vector map(IgniteBiFunction fun, double y) { -// TODO: provide cache-optimized implementation. -return super.map(fun, y); // TODO -} - -/** {@inheritDoc} */ -@Override public double sum() { -CacheVectorStorage sto = storage(); - -return CacheUtils.sum(sto.cache().getName(), sto.keyMapper(), sto.valueMapper()); -} - -/** {@inheritDoc} */ -@Override public Vector assign(double val) { -return mapOverCache((Double d) -> val); -} - -/** {@inheritDoc} */ -@Override public Vector plus(double x) { -return mapOverCache((Double d) -> d + x); -} - -/** {@inheritDoc} */ -@Override public Vector divide(double x) { -return mapOverCache((Double d) -> d / x); -} - -/** {@inheritDoc} */ -@Override public Vector times(double x) { -return mapOverCache((Double d) -> d * x); -} - -/** - * - * - */ -@SuppressWarnings({"unchecked"}) -private CacheVectorStorage storage() { -return (CacheVectorStorage)getStorage(); -} - -/** {@inheritDoc} */ -@Override public Vector like(int crd) { -throw new UnsupportedOperationException(); -} - -/** {@inheritDoc} */ -@Override public Matrix likeMatrix(int rows, int cols) { -throw new UnsupportedOperationException(); -} -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/vector/ConstantVector.java --
[69/71] [abbrv] ignite git commit: ignite-2.0 - Javadoc
ignite-2.0 - Javadoc Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f4404805 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f4404805 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f4404805 Branch: refs/heads/ignite-4535 Commit: f4404805fbebaf3907fcc2639e133894dcd24a96 Parents: 88ce993 Author: Alexey Goncharuk Authored: Thu Apr 20 11:22:40 2017 +0300 Committer: Alexey Goncharuk Committed: Thu Apr 20 11:23:24 2017 +0300 -- .../configuration/MemoryConfiguration.java | 15 + .../MemoryPolicyConfiguration.java | 32 +++- 2 files changed, 26 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f4404805/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java index de8fdbf..cd7c1fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java @@ -171,16 +171,19 @@ public class MemoryConfiguration implements Serializable { } /** - * TODO: document - * @return Concurrency level. + * Returns the number of concurrent segments in Ignite internal page mapping tables. By default equals + * to the number of available CPUs multiplied by 4. + * + * @return Mapping table concurrency level. */ public int getConcurrencyLevel() { return concLvl; } /** - * TODO: document - * @param concLvl Concurrency level. + * Sets the number of concurrent segments in Ignite internal page mapping tables. + * + * @param concLvl Mapping table oncurrency level. */ public MemoryConfiguration setConcurrencyLevel(int concLvl) { this.concLvl = concLvl; @@ -191,7 +194,7 @@ public class MemoryConfiguration implements Serializable { /** * Gets a name of default memory policy. * - * @return A name of a custom memory policy configured with {@link MemoryConfiguration} or {@code null} of the + * @return A name of a custom memory policy configured with {@code MemoryConfiguration} or {@code null} of the * default policy is used. */ public String getDefaultMemoryPolicyName() { @@ -202,7 +205,7 @@ public class MemoryConfiguration implements Serializable { * Sets the name for the default memory policy that will initialize the default memory region. * To set own default memory policy, create the policy first, pass it to * {@link MemoryConfiguration#setMemoryPolicies(MemoryPolicyConfiguration...)} method and change the name of the - * default memory policy with {@link MemoryConfiguration#setDefaultMemoryPolicyName(String)}. + * default memory policy with {@code MemoryConfiguration#setDefaultMemoryPolicyName(String)}. * * @param dfltMemPlcName Name of a memory policy to be used as default one. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/f4404805/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java index 810ecaa..6d5fe8c 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java @@ -78,16 +78,7 @@ public final class MemoryPolicyConfiguration implements Serializable { */ private double evictionThreshold = 0.9; -/** - * TODO: not clear description. - * - * When {@link #evictionThreshold} is reached, allocation of new data pages is prevented by maintaining this - * amount of evicted data pages in the pool. If any thread needs free page to store cache entry, - * it will take empty page from the pool instead of allocating a new one. - * Increase this parameter if cache can contain very big entries (total size of pages in the pool should be enough - * to contain largest cache entry). - * Increase this parameter if {@link IgniteOutOfMemoryException} occurred with enabled page eviction. - */ +/** Minimum number of empty pages in reuse lists. */ private int emptyPagesPoolSize = 100; /** @@ -121,8 +112,8 @@ public final class MemoryPol
[38/71] [abbrv] ignite git commit: master - Mute test with a correct link
master - Mute test with a correct link Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9b21c85d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9b21c85d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9b21c85d Branch: refs/heads/ignite-4535 Commit: 9b21c85d6ec0cdbba8cbf2382559a8ef5a82e15c Parents: 2edb935 Author: Alexey Goncharuk Authored: Tue Apr 18 18:40:27 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 18 18:43:21 2017 +0300 -- .../cache/IgniteCacheJoinPartitionedAndReplicatedTest.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9b21c85d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java index d4772c1..37b21c9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java @@ -161,6 +161,8 @@ public class IgniteCacheJoinPartitionedAndReplicatedTest extends GridCommonAbstr * @throws Exception If failed. */ public void testJoin() throws Exception { +fail("https://issues.apache.org/jira/browse/IGNITE-5016";); + Ignite client = grid(2); IgniteCache personCache = client.cache(PERSON_CACHE);
[66/71] [abbrv] ignite git commit: ignite-1561 Fixed tx prepare for cross cache tx with near + colocated cache
ignite-1561 Fixed tx prepare for cross cache tx with near + colocated cache Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a5088265 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5088265 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5088265 Branch: refs/heads/ignite-4535 Commit: a5088265d7927aab702425249b3f0d6996cb989e Parents: badf49c Author: sboikov Authored: Thu Apr 20 08:29:42 2017 +0300 Committer: sboikov Committed: Thu Apr 20 08:29:42 2017 +0300 -- .../cache/GridCacheSharedContext.java | 6 +- .../processors/cache/GridCacheUtils.java| 83 +-- .../distributed/GridDistributedTxMapping.java | 68 +- .../GridDistributedTxRemoteAdapter.java | 2 +- .../cache/distributed/dht/GridDhtTxLocal.java | 2 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 2 + ...arOptimisticSerializableTxPrepareFuture.java | 218 --- .../near/GridNearOptimisticTxPrepareFuture.java | 95 ++-- .../GridNearPessimisticTxPrepareFuture.java | 186 ++-- .../near/GridNearTxFinishFuture.java| 6 +- .../cache/distributed/near/GridNearTxLocal.java | 30 +-- .../near/GridNearTxPrepareFutureAdapter.java| 30 +-- .../cache/transactions/IgniteTxHandler.java | 49 + .../IgniteTxImplicitSingleStateImpl.java| 6 + .../transactions/IgniteTxLocalAdapter.java | 7 +- .../cache/transactions/IgniteTxLocalState.java | 10 + .../cache/transactions/IgniteTxManager.java | 7 +- .../cache/transactions/IgniteTxState.java | 2 +- .../cache/transactions/IgniteTxStateImpl.java | 52 +++-- .../lang/gridfunc/PredicateCollectionView.java | 7 +- .../util/lang/gridfunc/PredicateMapView.java| 6 - .../util/lang/gridfunc/PredicateSetView.java| 6 - .../lang/gridfunc/ReadOnlyCollectionView.java | 6 - .../lang/gridfunc/ReadOnlyCollectionView2X.java | 6 - .../lang/gridfunc/TransformCollectionView.java | 7 +- .../util/lang/gridfunc/TransformMapView.java| 6 - ...sCacheTxNearEnabledRandomOperationsTest.java | 28 +++ .../cache/CrossCacheTxRandomOperationsTest.java | 23 +- .../dht/GridNearCacheTxNodeFailureSelfTest.java | 31 --- .../dht/IgniteCrossCacheTxSelfTest.java | 8 + .../IgniteCacheFailoverTestSuite.java | 2 - .../testsuites/IgniteCacheTestSuite2.java | 2 + 32 files changed, 631 insertions(+), 368 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java index 34bb321..79083e0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java @@ -52,7 +52,7 @@ import org.apache.ignite.internal.processors.cache.transactions.TransactionMetri import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager; import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor; -import org.apache.ignite.internal.util.GridLongList; +import org.apache.ignite.internal.util.GridIntList; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.tostring.GridToStringExclude; @@ -742,7 +742,7 @@ public class GridCacheSharedContext { * @param cacheCtx Cache context. * @return Error message if transactions are incompatible. */ -@Nullable public String verifyTxCompatibility(IgniteInternalTx tx, GridLongList activeCacheIds, +@Nullable public String verifyTxCompatibility(IgniteInternalTx tx, GridIntList activeCacheIds, GridCacheContext cacheCtx) { if (cacheCtx.systemTx() && !tx.system()) return "system cache can be enlisted only in system transaction"; @@ -751,7 +751,7 @@ public class GridCacheSharedContext { return "non-system cache can't be enlisted in system transaction"; for (int i = 0; i < activeCacheIds.size(); i++) { -int cacheId = (int)activeCacheIds.get(i); +int cacheId = activeCacheIds.get(i); GridCacheContext activeCacheCtx = cacheContext(cacheId); http://git-wip-us.apache.org/repos/asf/ignite/blob/a5088265/modules/core/src/main/
[26/71] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/43d6d7e7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/43d6d7e7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/43d6d7e7 Branch: refs/heads/ignite-4535 Commit: 43d6d7e7eb9eb146c48b843293849ac687ead216 Parents: d60cf53 d78e071 Author: sboikov Authored: Tue Apr 18 16:50:45 2017 +0300 Committer: sboikov Committed: Tue Apr 18 16:50:45 2017 +0300 -- examples/pom-standalone-lgpl.xml|4 - examples/pom-standalone.xml |4 - examples/pom.xml|4 - .../CholeskyDecompositionExample.java |8 +- .../EigenDecompositionExample.java |8 +- .../decompositions/LUDecompositionExample.java |8 +- .../SingularValueDecompositionExample.java |6 +- .../ml/math/matrix/CacheMatrixExample.java | 10 +- .../ml/math/matrix/ExampleMatrixStorage.java|4 +- .../math/matrix/MatrixCustomStorageExample.java | 12 +- .../examples/ml/math/matrix/MatrixExample.java |4 +- .../ml/math/matrix/MatrixExampleUtil.java |4 +- .../ml/math/matrix/OffHeapMatrixExample.java|4 +- .../matrix/SparseDistributedMatrixExample.java |5 +- .../ml/math/matrix/SparseMatrixExample.java |4 +- .../examples/ml/math/tracer/TracerExample.java |4 +- .../ml/math/vector/CacheVectorExample.java |8 +- .../ml/math/vector/ExampleVectorStorage.java|4 +- .../ml/math/vector/OffHeapVectorExample.java|4 +- .../ml/math/vector/SparseVectorExample.java |6 +- .../math/vector/VectorCustomStorageExample.java | 14 +- .../examples/ml/math/vector/VectorExample.java |4 +- modules/ml/pom.xml |6 - .../java/org/apache/ignite/math/Algebra.java| 571 - .../java/org/apache/ignite/math/Constants.java | 42 - .../org/apache/ignite/math/Destroyable.java | 30 - .../apache/ignite/math/IdentityValueMapper.java | 53 - .../java/org/apache/ignite/math/KeyMapper.java | 33 - .../java/org/apache/ignite/math/Matrix.java | 518 .../org/apache/ignite/math/MatrixKeyMapper.java | 30 - .../org/apache/ignite/math/MatrixStorage.java | 58 - .../org/apache/ignite/math/MetaAttributes.java | 76 -- .../java/org/apache/ignite/math/MurmurHash.java | 246 .../apache/ignite/math/StorageConstants.java| 49 - .../apache/ignite/math/StorageOpsMetrics.java | 49 - .../java/org/apache/ignite/math/Tracer.java | 456 --- .../org/apache/ignite/math/ValueMapper.java | 27 - .../java/org/apache/ignite/math/Vector.java | 498 .../org/apache/ignite/math/VectorKeyMapper.java | 29 - .../org/apache/ignite/math/VectorStorage.java | 53 - .../decompositions/CholeskyDecomposition.java | 306 - .../decompositions/DecompositionSupport.java| 105 -- .../math/decompositions/EigenDecomposition.java | 923 --- .../math/decompositions/LUDecomposition.java| 366 -- .../math/decompositions/QRDecomposition.java| 186 --- .../SingularValueDecomposition.java | 620 -- .../math/decompositions/package-info.java | 22 - .../math/exceptions/CardinalityException.java | 38 - .../math/exceptions/ColumnIndexException.java | 35 - .../ignite/math/exceptions/IndexException.java | 35 - .../NonPositiveDefiniteMatrixException.java | 20 - .../exceptions/NonSymmetricMatrixException.java | 18 - .../math/exceptions/RowIndexException.java | 35 - .../exceptions/SingularMatrixException.java | 30 - .../exceptions/UnknownProviderException.java| 35 - .../UnsupportedOperationException.java | 44 - .../ignite/math/exceptions/package-info.java| 22 - .../apache/ignite/math/functions/Functions.java | 136 --- .../ignite/math/functions/IgniteBiConsumer.java | 12 - .../ignite/math/functions/IgniteBiFunction.java | 29 - .../ignite/math/functions/IgniteConsumer.java | 29 - .../math/functions/IgniteDoubleFunction.java| 29 - .../ignite/math/functions/IgniteFunction.java | 30 - .../math/functions/IntDoubleToVoidFunction.java | 25 - .../functions/IntIntDoubleToVoidFunction.java | 28 - .../math/functions/IntIntToDoubleFunction.java | 24 - .../ignite/math/functions/package-info.java | 22 - .../apache/ignite/math/impls/CacheUtils.java| 356 -- .../math/impls/matrix/AbstractMatrix.java | 880 -- .../ignite/math/impls/matrix/CacheMatrix.java | 158 --- .../impls/matrix/DenseLocalOffHeapMatrix.java | 90 -- .../impls/matrix/DenseLocalOnHeapMatrix.java| 86 -- .../math/impls/matrix/DiagonalMatrix.java | 101 -- .../math/impls/matrix/Func
[29/71] [abbrv] ignite git commit: Merge branch 'master' into ignite-2.0
Merge branch 'master' into ignite-2.0 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e7421f2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e7421f2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e7421f2 Branch: refs/heads/ignite-4535 Commit: 9e7421f261354b28119094b3b53b9490fd817b24 Parents: 8ea9f83 735ce60 Author: devozerov Authored: Tue Apr 18 17:04:43 2017 +0300 Committer: devozerov Committed: Tue Apr 18 17:04:43 2017 +0300 -- .../store/cassandra/datasource/DataSource.java | 50 ++-- .../cassandra/session/CassandraSessionImpl.java | 23 + .../cassandra/session/pool/SessionPool.java | 6 +-- .../cassandra/session/pool/SessionWrapper.java | 15 +++--- 4 files changed, 62 insertions(+), 32 deletions(-) --
[51/71] [abbrv] ignite git commit: IGNITE-5028 .NET: Remove default-dotnet.xml
IGNITE-5028 .NET: Remove default-dotnet.xml Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/52bb84db Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/52bb84db Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/52bb84db Branch: refs/heads/ignite-4535 Commit: 52bb84dba83916ea0b22b793f4359f82e8ee4573 Parents: d76a729 Author: Pavel Tupitsyn Authored: Wed Apr 19 15:07:41 2017 +0300 Committer: Pavel Tupitsyn Committed: Wed Apr 19 15:07:41 2017 +0300 -- assembly/release-fabric-base.xml | 5 config/dotnet/default-dotnet.xml | 45 --- 2 files changed, 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/52bb84db/assembly/release-fabric-base.xml -- diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml index b374ab4..5007785 100644 --- a/assembly/release-fabric-base.xml +++ b/assembly/release-fabric-base.xml @@ -59,11 +59,6 @@ NOTICE / - - -config/dotnet/default-dotnet.xml -/config/dotnet - http://git-wip-us.apache.org/repos/asf/ignite/blob/52bb84db/config/dotnet/default-dotnet.xml -- diff --git a/config/dotnet/default-dotnet.xml b/config/dotnet/default-dotnet.xml deleted file mode 100644 index 897c4e5..000 --- a/config/dotnet/default-dotnet.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - -http://www.springframework.org/schema/beans"; - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd";> - - - - - - - - - - - - - - - - - - -
[19/71] [abbrv] ignite git commit: IGNITE-5000 Rename Ignite Math module to Ignite ML module added missed licenses renamed packages fixed wrong ml profile activation
http://git-wip-us.apache.org/repos/asf/ignite/blob/d78e071a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java b/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java deleted file mode 100644 index 670deef..000 --- a/modules/ml/src/main/java/org/apache/ignite/math/impls/storage/vector/CacheVectorStorage.java +++ /dev/null @@ -1,175 +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.math.impls.storage.vector; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.Ignition; -import org.apache.ignite.math.ValueMapper; -import org.apache.ignite.math.VectorKeyMapper; -import org.apache.ignite.math.VectorStorage; - -/** - * Vector storage based on existing cache and index and value mapping functions. - */ -public class CacheVectorStorage implements VectorStorage { -/** Storage size. */ -private int size; -/** Key mapper. */ -private VectorKeyMapper keyMapper; -/** Value mapper. */ -private ValueMapper valMapper; -/** Underlying ignite cache. */ -private IgniteCache cache; - -/** - * - */ -public CacheVectorStorage() { -// No-op. -} - -/** - * @param size - * @param cache - * @param keyMapper - * @param valMapper - */ -public CacheVectorStorage(int size, IgniteCache cache, VectorKeyMapper keyMapper, -ValueMapper valMapper) { -assert size > 0; -assert cache != null; -assert keyMapper != null; -assert valMapper != null; - -this.size = size; -this.cache = cache; -this.keyMapper = keyMapper; -this.valMapper = valMapper; -} - -/** - * - * - */ -public IgniteCache cache() { -return cache; -} - -/** - * - * - */ -public VectorKeyMapper keyMapper() { -return keyMapper; -} - -/** - * - * - */ -public ValueMapper valueMapper() { -return valMapper; -} - -/** {@inheritDoc} */ -@Override public int size() { -return size; -} - -/** {@inheritDoc} */ -@Override public double get(int i) { -return valMapper.toDouble(cache.get(keyMapper.apply(i))); -} - -/** {@inheritDoc} */ -@Override public void set(int i, double v) { -cache.put(keyMapper.apply(i), valMapper.fromDouble(v)); -} - -/** {@inheritDoc} */ -@Override public void writeExternal(ObjectOutput out) throws IOException { -out.writeInt(size); -out.writeObject(keyMapper); -out.writeObject(valMapper); -out.writeUTF(cache.getName()); -} - -/** {@inheritDoc} */ -@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { -size = in.readInt(); -keyMapper = (VectorKeyMapper)in.readObject(); -valMapper = (ValueMapper)in.readObject(); -cache = Ignition.localIgnite().getOrCreateCache(in.readUTF()); -} - -/** {@inheritDoc} */ -@Override public boolean isSequentialAccess() { -return false; -} - -/** {@inheritDoc} */ -@Override public boolean isDense() { -return false; -} - -/** {@inheritDoc} */ -@Override public boolean isRandomAccess() { -return true; -} - -/** {@inheritDoc} */ -@Override public boolean isDistributed() { -return true; -} - -/** {@inheritDoc} */ -@Override public boolean isArrayBased() { -return false; -} - -/** {@inheritDoc} */ -@Override public int hashCode() { -int res = 1; - -res = res * 37 + size(); -res = res * 37 + keyMapper.hashCode(); -res = res * 37 + valMapper.hashCode(); -res = res * 37 + cache.hashCode(); - -return res; -} - -/** {@inheritDoc} */ -@Override public boolean equals(Object obj) { -if (t
[39/71] [abbrv] ignite git commit: master - Fix mvcc tests after CLOCK mode removal
master - Fix mvcc tests after CLOCK mode removal Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f82ed018 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f82ed018 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f82ed018 Branch: refs/heads/ignite-4535 Commit: f82ed01807c80b36b7e361a5800ea131c1431c14 Parents: 9b21c85 Author: Alexey Goncharuk Authored: Tue Apr 18 18:40:55 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Apr 18 18:43:28 2017 +0300 -- .../cache/GridCacheMvccPartitionedSelfTest.java | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f82ed018/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java index 2fb5d25..0c53fee 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java @@ -604,9 +604,9 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { public void testSerializableReadLocksAdd() throws Exception { GridCacheAdapter cache = grid.internalCache(); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); { GridCacheMvcc mvcc = new GridCacheMvcc(cache.context()); @@ -681,9 +681,9 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { public void testSerializableReadLocksAssign() throws Exception { GridCacheAdapter cache = grid.internalCache(); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); { GridCacheMvcc mvcc = new GridCacheMvcc(cache.context()); @@ -883,10 +883,10 @@ public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest { GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1"); -GridCacheVersion serOrder1 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder2 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder3 = new GridCacheVersion(0, 0, 1); -GridCacheVersion serOrder4 = new GridCacheVersion(0, 0, 1); +GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1); +GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1); +GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1); +GridCacheVersion serOrder4 = new GridCacheVersion(0, 30, 1); GridCacheVersion ver1 = incVer ? version(1) : version(4); GridCacheVersion ver2 = incVer ? version(2) : version(3);
[55/71] [abbrv] ignite git commit: IGNITE-4211 Update Spring dependency to latest stable version
IGNITE-4211 Update Spring dependency to latest stable version Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a51477c0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a51477c0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a51477c0 Branch: refs/heads/ignite-4535 Commit: a51477c0277785db4089467dde9c8da7132a46da Parents: 1a9b38d Author: daradurvs Authored: Wed Apr 19 16:11:56 2017 +0300 Committer: Anton Vinogradov Committed: Wed Apr 19 16:11:56 2017 +0300 -- .../test/config/loaders/grid-cfg-2-grids.xml| 6 +++--- .../apache/ignite/cache/spring/SpringCache.java | 6 ++ .../GridSpringResourceInjectionSelfTest.java| 20 ++-- parent/pom.xml | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml -- diff --git a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml index af4792a..a26423d 100644 --- a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml +++ b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml @@ -28,7 +28,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -61,4 +61,4 @@ - + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java -- diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java index 77b30c5..f35ed2a 100644 --- a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java +++ b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java @@ -18,6 +18,7 @@ package org.apache.ignite.cache.spring; import java.io.Serializable; +import java.util.concurrent.Callable; import org.apache.ignite.IgniteCache; import org.springframework.cache.Cache; import org.springframework.cache.support.SimpleValueWrapper; @@ -82,6 +83,11 @@ class SpringCache implements Cache { } /** {@inheritDoc} */ +@Override public T get(Object key, Callable valLdr) { +throw new UnsupportedOperationException(); +} + +/** {@inheritDoc} */ @Override public ValueWrapper putIfAbsent(Object key, Object val) { Object old; http://git-wip-us.apache.org/repos/asf/ignite/blob/a51477c0/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java -- diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java index e70b49e..827dd72 100644 --- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridSpringResourceInjectionSelfTest.java @@ -105,8 +105,8 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest }, anotherGrid, null); assertTrue("Unexpected message: " + err.getMessage(), err.getMessage().startsWith("No qualifying bean of type " + - "[org.apache.ignite.internal.processors.resource.GridSpringResourceInjectionSelfTest$DummyResourceBean]" + -" is defined: expected single matching bean but found 2:")); + "'org.apache.ignite.internal.processors.resource.GridSpringResourceInjectionSelfTest$DummyResourceBean'" + +" available: expected single matching bean but found 2:")); G.stop("anotherGrid", false); } @@ -124,7 +124,7 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest return null; } -}, "No bean named 'nonExistentResource' is defined"); +}, "No bean named 'nonExistentResource' available"); } /** @@ -140,8 +140,8 @@ public class GridSpringResourceInjectionSelfTest extends GridCommonAbstractTest return null; } -}, "No qualifying bean of type [org.apache.ignite.internal.processors.resource." + -"GridSpringResourceInjectionSelfTest$AnotherDummyResourceBean] is defined"); +}, "No qualif