[29/49] ignite git commit: IGNITE-5694 - Added retries for getCollection in DataStructuresProcessor - Fixes #2240.
IGNITE-5694 - Added retries for getCollection in DataStructuresProcessor - Fixes #2240. Signed-off-by: Alexey Goncharuk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17694c16 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17694c16 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17694c16 Branch: refs/heads/ignite-2.1 Commit: 17694c16d449dea4d4e39a271dd39e838c581858 Parents: 36716fb Author: Ilya Lantukh Authored: Mon Jul 10 11:59:19 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 11:59:19 2017 +0300 -- .../processors/datastructures/DataStructuresProcessor.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17694c16/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 5564b79..33a2fd2 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 @@ -1031,7 +1031,11 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen } } -return c.applyx(cache.context()); +return retryTopologySafe(new IgniteOutClosureX() { +@Override public T applyx() throws IgniteCheckedException { +return c.applyx(cache.context()); +} +}); } /**
[09/49] ignite git commit: IGNITE-5159: DDL example. This closes #2227.
IGNITE-5159: DDL example. This closes #2227. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a5390b1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a5390b1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a5390b1 Branch: refs/heads/ignite-2.1 Commit: 2a5390b1c083819f059e449b34a5979ec35b7755 Parents: 99fd75d Author: Alexander Paschenko Authored: Fri Jul 7 15:01:43 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:01:43 2017 +0300 -- .../examples/datagrid/CacheQueryDdlExample.java | 119 +++ .../ignite/examples/CacheExamplesSelfTest.java | 8 ++ 2 files changed, 127 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2a5390b1/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java new file mode 100644 index 000..84a67cd --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.examples.datagrid; + +import java.util.List; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.Ignition; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.examples.ExampleNodeStartup; + +/** + * Example to showcase DDL capabilities of Ignite's SQL engine. + * + * Remote nodes could be started from command line as follows: + * {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}. + * + * Alternatively you can run {@link ExampleNodeStartup} in either same or another JVM. + */ +public class CacheQueryDdlExample { +/** Dummy cache name. */ +private static final String DUMMY_CACHE_NAME = "dummy_cache"; + +/** + * Executes example. + * + * @param args Command line arguments, none required. + * @throws Exception If example execution failed. + */ +@SuppressWarnings({"unused", "ThrowFromFinallyBlock"}) +public static void main(String[] args) throws Exception { +try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { +print("Cache query DDL example started."); + +// Create dummy cache to act as an entry point for SQL queries (new SQL API which do not require this +// will appear in future versions, JDBC and ODBC drivers do not require it already). +CacheConfiguration cacheCfg = new CacheConfiguration<>(DUMMY_CACHE_NAME) +.setSqlSchema("PUBLIC").setIndexedTypes(Integer.class, Integer.class); + +try ( +IgniteCache cache = ignite.getOrCreateCache(cacheCfg) +) { +// Create table based on PARTITIONED template with one backup. +cache.query(new SqlFieldsQuery( +"CREATE TABLE person (id LONG PRIMARY KEY, name VARCHAR, city_id LONG) " + +"WITH \"backups=1\"")).getAll(); + +// Create reference City table based on REPLICATED template. +cache.query(new SqlFieldsQuery( +"CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=replicated\"")).getAll(); + +// Create an index. +cache.query(new SqlFieldsQuery("CREATE INDEX on Person (city_id)")).getAll(); + +print("Created database objects."); + +SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); + +cache.query(qry.setArgs(1L, "John Doe", 3L)).getAll(); +cache.query(qry.setArgs(2L, "Jane Roe", 2L)).getAll(); +cache.query(qry.setArgs(3L,
[17/49] ignite git commit: IGNITE-5204: SQL: fixed incorrect partition calculation in case of unicast optimization, when WHERE clause argument type was different from key or affinity key type. This cl
IGNITE-5204: SQL: fixed incorrect partition calculation in case of unicast optimization, when WHERE clause argument type was different from key or affinity key type. This close #2107. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99713fee Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99713fee Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99713fee Branch: refs/heads/ignite-2.1 Commit: 99713feea764fc8c3e5b247a24698a2c04d3bcf4 Parents: 55a5ca0 Author: Sergey Kalashnikov Authored: Fri Jul 7 16:30:37 2017 +0300 Committer: devozerov Committed: Fri Jul 7 16:30:37 2017 +0300 -- .../cache/query/CacheQueryPartitionInfo.java| 46 +++- .../query/h2/DmlStatementsProcessor.java| 9 +- .../internal/processors/query/h2/H2Utils.java | 27 +++ .../processors/query/h2/IgniteH2Indexing.java | 30 ++- .../query/h2/sql/GridSqlQuerySplitter.java | 5 +- .../processors/query/IgniteSqlRoutingTest.java | 211 +-- 6 files changed, 290 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/99713fee/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java index 1329d5c..42bf070 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java @@ -39,22 +39,35 @@ import org.apache.ignite.internal.util.typedef.internal.S; */ public class CacheQueryPartitionInfo { /** */ -private int partId; +private final int partId; /** */ -private String cacheName; +private final String cacheName; /** */ -private int paramIdx; +private final String tableName; + +/** */ +private final int dataType; + +/** */ +private final int paramIdx; /** * @param partId Partition id, or -1 if parameter binding required. * @param cacheName Cache name required for partition calculation. + * @param tableName Table name required for proper type conversion. + * @param dataType Required data type id for the query parameter. * @param paramIdx Query parameter index required for partition calculation. */ -public CacheQueryPartitionInfo(int partId, String cacheName, int paramIdx) { +public CacheQueryPartitionInfo(int partId, String cacheName, String tableName, int dataType, int paramIdx) { +// In case partition is not known, both cacheName and tableName must be provided. +assert (partId >= 0) ^ ((cacheName != null) && (tableName != null)); + this.partId = partId; this.cacheName = cacheName; +this.tableName = tableName; +this.dataType = dataType; this.paramIdx = paramIdx; } @@ -73,6 +86,20 @@ public class CacheQueryPartitionInfo { } /** + * @return Table name. + */ +public String tableName() { +return tableName; +} + +/** + * @return Required data type for the query parameter. + */ +public int dataType() { +return dataType; +} + +/** * @return Query parameter index required for partition calculation. */ public int paramIdx() { @@ -81,7 +108,9 @@ public class CacheQueryPartitionInfo { /** {@inheritDoc} */ @Override public int hashCode() { -return partId ^ paramIdx ^ (cacheName == null ? 0 : cacheName.hashCode()); +return partId ^ dataType ^ paramIdx ^ +(cacheName == null ? 0 : cacheName.hashCode()) ^ +(tableName == null ? 0 : tableName.hashCode()); } /** {@inheritDoc} */ @@ -97,10 +126,13 @@ public class CacheQueryPartitionInfo { if (partId >= 0) return partId == other.partId; -if (other.cacheName == null) +if (other.cacheName == null || other.tableName == null) return false; -return other.cacheName.equals(cacheName) && other.paramIdx == paramIdx; +return other.cacheName.equals(cacheName) && +other.tableName.equals(tableName) && +other.dataType == dataType && +other.paramIdx == paramIdx; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/99713fee/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java -
[33/49] ignite git commit: GridDhtPartitionsExchangeFuture minor: removed duplicated updateAlives call.
GridDhtPartitionsExchangeFuture minor: removed duplicated updateAlives call. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/313f86e5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/313f86e5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/313f86e5 Branch: refs/heads/ignite-2.1 Commit: 313f86e5536f82cf34a9a95ad16fa1afbe37a63e Parents: b085fa0 Author: sboikov Authored: Mon Jul 10 13:01:02 2017 +0300 Committer: sboikov Committed: Mon Jul 10 13:01:02 2017 +0300 -- .../distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/313f86e5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 90c8aaf..21a3a13 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -545,8 +545,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte AffinityTopologyVersion topVer = topologyVersion(); -discoCache.updateAlives(cctx.discovery()); - srvNodes = new ArrayList<>(discoCache.serverNodes()); remaining.addAll(F.nodeIds(F.view(srvNodes, F.remoteNodes(cctx.localNodeId();
[11/49] ignite git commit: IGNITE-5717 .NET: Reduce MemoryPolicyConfiguration.MaxSize for persistence tests as a workaround for OOM on default settings
IGNITE-5717 .NET: Reduce MemoryPolicyConfiguration.MaxSize for persistence tests as a workaround for OOM on default settings Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9387ade Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9387ade Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9387ade Branch: refs/heads/ignite-2.1 Commit: a9387adef490086406b05fe961ff0f3151045caa Parents: d232648 Author: Pavel Tupitsyn Authored: Fri Jul 7 15:21:20 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 15:21:20 2017 +0300 -- .../Cache/PersistentStoreTest.cs| 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a9387ade/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs index 96ae47c..e9cbce8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Tests.Cache { using System.IO; +using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.PersistentStore; @@ -51,7 +52,7 @@ namespace Apache.Ignite.Core.Tests.Cache [Test] public void TestCacheDataSurvivesNodeRestart() { -var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration()) +var cfg = new IgniteConfiguration(GetTestConfiguration()) { PersistentStoreConfiguration = new PersistentStoreConfiguration { @@ -106,7 +107,7 @@ namespace Apache.Ignite.Core.Tests.Cache [Test] public void TestGridActivationWithPersistence() { -var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration()) +var cfg = new IgniteConfiguration(GetTestConfiguration()) { PersistentStoreConfiguration = new PersistentStoreConfiguration() }; @@ -177,5 +178,36 @@ namespace Apache.Ignite.Core.Tests.Cache ex.Message.Substring(0, 62)); } } + +/// +/// Gets the test configuration. +/// +private static IgniteConfiguration GetTestConfiguration() +{ +return new IgniteConfiguration(TestUtils.GetTestConfiguration()) +{ +MemoryConfiguration = GetMemoryConfig() +}; +} + +/// +/// Gets the memory configuration with reduced MaxMemory to work around persistence bug. +/// +private static MemoryConfiguration GetMemoryConfig() +{ +// TODO: Remove this method and use default config (IGNITE-5717). +return new MemoryConfiguration +{ +MemoryPolicies = new[] +{ +new MemoryPolicyConfiguration +{ +Name = MemoryConfiguration.DefaultDefaultMemoryPolicyName, +InitialSize = 512*1024*1024, +MaxSize = 512*1024*1024 +} +} +}; +} } }
[18/49] ignite git commit: IGNITE-5582: Implemented Compute::Broadcast for C++
IGNITE-5582: Implemented Compute::Broadcast for C++ (cherry picked from commit fa974286e8f066a8d6aa57519edf5ec7761be095) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3c887378 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3c887378 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3c887378 Branch: refs/heads/ignite-2.1 Commit: 3c887378eb64d2d236073410070082e5699e8334 Parents: 99713fe Author: Igor Sapego Authored: Fri Jul 7 16:52:31 2017 +0300 Committer: Igor Sapego Committed: Fri Jul 7 16:52:31 2017 +0300 -- .../cpp/core-test/src/compute_test.cpp | 91 ++- modules/platforms/cpp/core/include/Makefile.am | 2 + .../cpp/core/include/ignite/compute/compute.h | 66 + .../include/ignite/impl/compute/compute_impl.h | 161 +++ .../ignite/impl/compute/compute_job_result.h| 54 +++- .../ignite/impl/compute/compute_task_holder.h | 204 +- .../compute/multiple_job_compute_task_holder.h | 265 +++ .../compute/single_job_compute_task_holder.h| 212 +++ .../platforms/cpp/core/project/vs/core.vcxproj | 2 + .../cpp/core/project/vs/core.vcxproj.filters| 6 + 10 files changed, 811 insertions(+), 252 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3c887378/modules/platforms/cpp/core-test/src/compute_test.cpp -- diff --git a/modules/platforms/cpp/core-test/src/compute_test.cpp b/modules/platforms/cpp/core-test/src/compute_test.cpp index 8c57ef1..1fd7670 100644 --- a/modules/platforms/cpp/core-test/src/compute_test.cpp +++ b/modules/platforms/cpp/core-test/src/compute_test.cpp @@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE(IgniteRunAsyncLocalError) BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); } -BOOST_AUTO_TEST_CASE(IgniteRunTestRemote) +BOOST_AUTO_TEST_CASE(IgniteRunRemote) { Ignite node2 = MakeNode("ComputeNode2"); Compute compute = node.GetCompute(); @@ -489,7 +489,7 @@ BOOST_AUTO_TEST_CASE(IgniteRunTestRemote) BOOST_CHECK_EQUAL(Func3::res, "42.24"); } -BOOST_AUTO_TEST_CASE(IgniteRunTestRemoteError) +BOOST_AUTO_TEST_CASE(IgniteRunRemoteError) { Ignite node2 = MakeNode("ComputeNode2"); Compute compute = node.GetCompute(); @@ -509,5 +509,92 @@ BOOST_AUTO_TEST_CASE(IgniteRunTestRemoteError) BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); } +BOOST_AUTO_TEST_CASE(IgniteBroadcastLocalSync) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting");; +std::vector res = compute.Broadcast(Func2(8, 5)); + +BOOST_CHECK_EQUAL(res.size(), 1); +BOOST_CHECK_EQUAL(res[0], "8.5"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastLocalAsync) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting");; +Future< std::vector > res = compute.BroadcastAsync(Func2(312, 245)); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +std::vector value = res.GetValue(); + +BOOST_CHECK_EQUAL(value.size(), 1); +BOOST_CHECK_EQUAL(value[0], "312.245"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastSyncLocalError) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); + +BOOST_CHECK_EXCEPTION(compute.Broadcast(Func2(MakeTestError())), IgniteError, IsTestError); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastAsyncLocalError) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +Future res = compute.BroadcastAsync(Func2(MakeTestError())); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastRemote) +{ +Ignite node2 = MakeNode("ComputeNode2"); +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +std::vector res = compute.Broadcast(Func2(8, 5)); + +BOOST_CHECK_EQUAL(res.size(), 2); +BOOST_CHECK_EQUAL(res[0], "8.5"); +BOOST_CHECK_EQUAL(res[1], "8.5"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastRemoteError) +{ +Ignite node2 = MakeNode("ComputeNode2"); +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +Future< std::vector > res = compute.BroadcastAsync(Func2(MakeTestError())); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); +} BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file http://gi
[46/49] ignite git commit: IGNITE-5662 Primary index name should contain type ID or name - Fixes #2275.
IGNITE-5662 Primary index name should contain type ID or name - Fixes #2275. Signed-off-by: Alexey Goncharuk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b3e6298a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b3e6298a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b3e6298a Branch: refs/heads/ignite-2.1 Commit: b3e6298a099f684a293a61b97e7623f5400cc5d0 Parents: d2fe437 Author: Eduard Shangareev Authored: Mon Jul 10 20:44:29 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 20:44:29 2017 +0300 -- .../internal/processors/query/QueryUtils.java | 8 +- ...oreQueryWithMultipleClassesPerCacheTest.java | 185 +++ .../IgnitePdsWithIndexingTestSuite.java | 2 + 3 files changed, 193 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b3e6298a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java index 022d121..320b25a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java @@ -421,10 +421,12 @@ public class QueryUtils { QueryTypeIdKey typeId; QueryTypeIdKey altTypeId = null; +int valTypeId = ctx.cacheObjects().typeId(qryEntity.findValueType()); + if (valCls == null || (binaryEnabled && !keyOrValMustDeserialize)) { processBinaryMeta(ctx, qryEntity, desc); -typeId = new QueryTypeIdKey(cacheName, ctx.cacheObjects().typeId(qryEntity.findValueType())); +typeId = new QueryTypeIdKey(cacheName, valTypeId); if (valCls != null) altTypeId = new QueryTypeIdKey(cacheName, valCls); @@ -471,9 +473,11 @@ public class QueryUtils { } typeId = new QueryTypeIdKey(cacheName, valCls); -altTypeId = new QueryTypeIdKey(cacheName, ctx.cacheObjects().typeId(qryEntity.findValueType())); +altTypeId = new QueryTypeIdKey(cacheName, valTypeId); } +desc.typeId(valTypeId); + return new QueryTypeCandidate(typeId, altTypeId, desc); } http://git-wip-us.apache.org/repos/asf/ignite/blob/b3e6298a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java new file mode 100644 index 000..432f41f --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java @@ -0,0 +1,185 @@ +/* + * 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.database; + +import java.io.Serializable; +import java.util.List; +import java.util.UUID; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.configuration.PersistentStoreConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.util.typedef.internal.U; +import or
[25/49] ignite git commit: .NET: Remove unused import and redundant cast
.NET: Remove unused import and redundant cast Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cb5ae961 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cb5ae961 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cb5ae961 Branch: refs/heads/ignite-2.1 Commit: cb5ae9617af900e953e0f6f065adcd707d2b3830 Parents: 82e5f8a Author: Pavel Tupitsyn Authored: Fri Jul 7 20:15:47 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 20:15:47 2017 +0300 -- .../Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/cb5ae961/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs index f5a5179..d08a191 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs @@ -27,7 +27,6 @@ namespace Apache.Ignite.Core.Cache.Configuration using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; -using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cache.Affinity; using Apache.Ignite.Core.Cache.Affinity.Rendezvous; @@ -242,7 +241,7 @@ namespace Apache.Ignite.Core.Cache.Configuration private void Read(BinaryReader reader) { // Make sure system marshaller is used. -Debug.Assert(((BinaryReader) reader).Marshaller == BinaryUtils.Marshaller); +Debug.Assert(reader.Marshaller == BinaryUtils.Marshaller); AtomicityMode = (CacheAtomicityMode) reader.ReadInt(); Backups = reader.ReadInt();
[26/49] ignite git commit: .NET: Fix IgniteConfigurationTest
.NET: Fix IgniteConfigurationTest Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17904cb1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17904cb1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17904cb1 Branch: refs/heads/ignite-2.1 Commit: 17904cb174a340ec928f4a7a4b12d294c2240d0f Parents: cb5ae96 Author: Pavel Tupitsyn Authored: Fri Jul 7 20:18:35 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 20:18:35 2017 +0300 -- .../dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17904cb1/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs index 578d923..5e5cb1c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs @@ -683,7 +683,7 @@ namespace Apache.Ignite.Core.Tests new MemoryPolicyConfiguration { Name = "myDefaultPlc", -PageEvictionMode = DataPageEvictionMode.Random2Lru, +PageEvictionMode = DataPageEvictionMode.Disabled, InitialSize = 340 * 1024 * 1024, MaxSize = 345 * 1024 * 1024, EvictionThreshold = 0.88, @@ -695,7 +695,7 @@ namespace Apache.Ignite.Core.Tests new MemoryPolicyConfiguration { Name = "customPlc", -PageEvictionMode = DataPageEvictionMode.RandomLru, +PageEvictionMode = DataPageEvictionMode.Disabled, MaxSize = 456 * 1024 * 1024, EvictionThreshold = 0.77, EmptyPagesPoolSize = 66,
[48/49] ignite git commit: IGNITE-5684 - Fixed update sequence handling in GridDhtPartitionFullMap
IGNITE-5684 - Fixed update sequence handling in GridDhtPartitionFullMap Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f3b69c7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f3b69c7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f3b69c7 Branch: refs/heads/ignite-2.1 Commit: 4f3b69c7018913618e7bbc724ab83ac6c274bc1f Parents: 2a2c803 Author: Pavel Kovalenko Authored: Tue Jul 11 11:27:57 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Jul 11 11:27:57 2017 +0300 -- .../dht/GridClientPartitionTopology.java| 71 +--- .../dht/GridDhtPartitionTopologyImpl.java | 27 +--- .../dht/preloader/GridDhtPartitionFullMap.java | 24 +-- .../CacheLateAffinityAssignmentTest.java| 2 +- 4 files changed, 67 insertions(+), 57 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/4f3b69c7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index e751961..f4ed517 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -572,56 +572,66 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { } } +/** + * Checks should current partition map overwritten by new partition map + * Method returns true if topology version or update sequence of new map are greater than of current map. + * + * @param currentMap Current partition map. + * @param newMap New partition map. + * @return True if current partition map should be overwritten by new partition map, false in other case. + */ +private boolean shouldOverridePartitionMap(GridDhtPartitionMap currentMap, GridDhtPartitionMap newMap) { +return newMap != null && +(newMap.topologyVersion().compareTo(currentMap.topologyVersion()) > 0 || + newMap.topologyVersion().compareTo(currentMap.topologyVersion()) == 0 && newMap.updateSequence() > currentMap.updateSequence()); +} + /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) @Override public boolean update( -@Nullable AffinityTopologyVersion exchVer, +@Nullable AffinityTopologyVersion exchangeVer, GridDhtPartitionFullMap partMap, Map> cntrMap, Set partsToReload ) { if (log.isDebugEnabled()) -log.debug("Updating full partition map [exchVer=" + exchVer + ", parts=" + fullMapString() + ']'); +log.debug("Updating full partition map [exchVer=" + exchangeVer + ", parts=" + fullMapString() + ']'); lock.writeLock().lock(); try { -if (exchVer != null && lastExchangeVer != null && lastExchangeVer.compareTo(exchVer) >= 0) { +if (exchangeVer != null && lastExchangeVer != null && lastExchangeVer.compareTo(exchangeVer) >= 0) { if (log.isDebugEnabled()) log.debug("Stale exchange id for full partition map update (will ignore) [lastExchId=" + -lastExchangeVer + ", exchVer=" + exchVer + ']'); - -return false; -} - -if (node2part != null && node2part.compareTo(partMap) >= 0) { -if (log.isDebugEnabled()) -log.debug("Stale partition map for full partition map update (will ignore) [lastExchId=" + -lastExchangeVer + ", exchVer=" + exchVer + ", curMap=" + node2part + ", newMap=" + partMap + ']'); +lastExchangeVer + ", exchVer=" + exchangeVer + ']'); return false; } -updateSeq.incrementAndGet(); - -if (exchVer != null) -lastExchangeVer = exchVer; +boolean fullMapUpdated = (node2part == null); if (node2part != null) { for (GridDhtPartitionMap part : node2part.values()) { GridDhtPartitionMap newPart = partMap.get(part.nodeId()); -// If for some nodes current partition has a newer map, -// then we keep the newer value. -if (newPart != null && newPart.updateSequence() < part.updateSequence()) { -
[45/49] ignite git commit: IGNITE-5688: Fix SparseDistributedMatrixTest::testCacheBehaviour crash. This closes #2272
IGNITE-5688: Fix SparseDistributedMatrixTest::testCacheBehaviour crash. This closes #2272 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2fe4374 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2fe4374 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2fe4374 Branch: refs/heads/ignite-2.1 Commit: d2fe437426399e2cf36b00ce6f527731da88613e Parents: 33ae472 Author: artemmalykh Authored: Mon Jul 10 18:16:49 2017 +0300 Committer: artemmalykh Committed: Mon Jul 10 18:22:49 2017 +0300 -- modules/ml/pom.xml | 3 +- .../main/java/org/apache/ignite/ml/Model.java | 1 - .../ml/clustering/BaseKMeansClusterer.java | 2 - .../apache/ignite/ml/clustering/Clusterer.java | 3 +- .../clustering/KMeansDistributedClusterer.java | 46 ++-- .../ml/clustering/KMeansLocalClusterer.java | 11 +++-- .../apache/ignite/ml/math/DistanceMeasure.java | 1 - .../ignite/ml/math/EuclideanDistance.java | 2 +- .../java/org/apache/ignite/ml/math/Matrix.java | 2 - .../java/org/apache/ignite/ml/math/Tracer.java | 1 - .../org/apache/ignite/ml/math/VectorUtils.java | 4 +- .../math/exceptions/ConvergenceException.java | 5 +-- .../exceptions/MathIllegalStateException.java | 4 +- .../ignite/ml/math/functions/Functions.java | 8 +--- .../apache/ignite/ml/math/impls/CacheUtils.java | 23 ++ .../ml/math/impls/matrix/AbstractMatrix.java| 2 - .../impls/matrix/SparseDistributedMatrix.java | 4 +- .../impls/storage/matrix/MapWrapperStorage.java | 7 ++- .../matrix/SparseDistributedMatrixStorage.java | 7 ++- .../vector/SparseLocalOnHeapVectorStorage.java | 8 ++-- .../ml/math/impls/vector/MapWrapperVector.java | 3 +- .../apache/ignite/ml/math/util/MatrixUtil.java | 1 - .../ignite/ml/math/d3-matrix-template.html | 2 + .../ignite/ml/math/d3-vector-template.html | 2 + .../org/apache/ignite/ml/IgniteMLTestSuite.java | 4 +- .../ml/clustering/ClusteringTesetSuite.java | 32 -- .../ml/clustering/ClusteringTestSuite.java | 32 ++ .../KMeansDistributedClustererTest.java | 28 .../ignite/ml/math/MathImplLocalTestSuite.java | 1 - .../org/apache/ignite/ml/math/TracerTest.java | 3 ++ .../matrix/SparseDistributedMatrixTest.java | 24 ++ .../OLSMultipleLinearRegressionTest.java| 2 +- 32 files changed, 144 insertions(+), 134 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/pom.xml -- diff --git a/modules/ml/pom.xml b/modules/ml/pom.xml index 75ebf1b..d619719 100644 --- a/modules/ml/pom.xml +++ b/modules/ml/pom.xml @@ -19,7 +19,8 @@ -http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> +http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> 4.0.0 http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/src/main/java/org/apache/ignite/ml/Model.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/Model.java b/modules/ml/src/main/java/org/apache/ignite/ml/Model.java index e4d2117..4dc1aca 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/Model.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/Model.java @@ -19,7 +19,6 @@ package org.apache.ignite.ml; import java.util.function.BiFunction; - /** Basic interface for all models. */ @FunctionalInterface public interface Model { http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java index a6acb8e..570ea7e 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java @@ -18,14 +18,12 @@ package org.apache.ignite.ml.clustering; import java.util.List; - import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.ml.math.DistanceMeasure; import org.apache.ignite.ml.math.Matrix; import org.apache.ignite.ml.math.Vector; import org.apache.ignite.ml.math.exceptions.ConvergenceException; impo
[01/49] ignite git commit: 2.1 More simple tx cancel on node stop
Repository: ignite Updated Branches: refs/heads/ignite-2.1 31e9d3b17 -> a668a224a 2.1 More simple tx cancel on node stop Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ab526713 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ab526713 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ab526713 Branch: refs/heads/ignite-2.1 Commit: ab5267134966b466a2d4bfba15d0c7e3ebe91139 Parents: 31e9d3b Author: sboikov Authored: Fri Jul 7 13:14:18 2017 +0300 Committer: sboikov Committed: Fri Jul 7 13:14:18 2017 +0300 -- .../processors/cache/GridCacheProcessor.java | 2 ++ .../cache/distributed/dht/GridDhtTxFinishFuture.java | 4 +++- .../distributed/near/GridNearTxFinishFuture.java | 4 ++-- .../cache/transactions/IgniteTxAdapter.java | 4 ++-- .../cache/transactions/IgniteTxLocalAdapter.java | 15 +-- 5 files changed, 18 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/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 716482e..321e6dd 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 @@ -964,6 +964,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { // No new caches should be added after this point. exch.onKernalStop(cancel); +sharedCtx.mvcc().onStop(); + for (CacheGroupContext grp : cacheGrps.values()) grp.onKernalStop(); http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java index d8180b4..5311ddc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java @@ -225,7 +225,9 @@ public final class GridDhtTxFinishFuture extends GridCacheCompoundIdentity if (this.tx.onePhaseCommit() && (this.tx.state() == COMMITTING)) { try { -this.tx.tmFinish(err == null); +boolean nodeStop = err != null && X.hasCause(err, NodeStoppingException.class); + +this.tx.tmFinish(err == null, nodeStop); } catch (IgniteCheckedException finishErr) { U.error(log, "Failed to finish tx: " + tx, e); http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java index 7f6f793..c45eb7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java @@ -327,7 +327,7 @@ public final class GridNearTxFinishFuture extends GridCacheCompoundIdentit finishOnePhase(commit); try { -tx.tmFinish(commit); +tx.tmFinish(commit, nodeStop); } catch (IgniteCheckedException e) { U.error(log, "Failed to finish tx: " + tx, e); @@ -338,7 +338,7 @@ public final class GridNearTxFinishFuture extends GridCacheCompoundIdentit } if (super.onDone(tx0, err)) { -if (error() instanceof IgniteTxHeuristicCheckedException) { +if (error() instanceof IgniteTxHeuristicCheckedException && !nodeStop) {
[23/49] ignite git commit: IGNITE-5369 Added support for _key and _val names on QueryEntity XML and code generation.
IGNITE-5369 Added support for _key and _val names on QueryEntity XML and code generation. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eb37f538 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eb37f538 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eb37f538 Branch: refs/heads/ignite-2.1 Commit: eb37f538f55a471258e49ee2fbf0e8f234829def Parents: e5c2ec5 Author: vsisko Authored: Fri Jul 7 23:22:59 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 23:22:59 2017 +0700 -- .../internal/visor/query/VisorQueryEntity.java | 32 +-- modules/web-console/backend/app/mongo.js| 2 ++ .../generator/AbstractTransformer.js| 4 +-- .../generator/ConfigurationGenerator.js | 33 +++- .../states/configuration/domains/query.pug | 9 ++ .../frontend/controllers/domains-controller.js | 7 +++-- 6 files changed, 73 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java index 9f4dfe7..c67918a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java @@ -58,6 +58,12 @@ public class VisorQueryEntity extends VisorDataTransferObject { /** Table name. */ private String tblName; +/** Key name. Can be used in field list to denote the key as a whole. */ +private String keyFieldName; + +/** Value name. Can be used in field list to denote the entire value. */ +private String valFieldName; + /** Fields to create group indexes for. */ private List grps; @@ -108,6 +114,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { for (QueryIndex qryIdx : qryIdxs) grps.add(new VisorQueryIndex(qryIdx)); + +tblName = q.getTableName(); +keyFieldName = q.getKeyFieldName(); +valFieldName = q.getValueFieldName(); } /** @@ -153,6 +163,20 @@ public class VisorQueryEntity extends VisorDataTransferObject { } /** + * @return Key name. Can be used in field list to denote the key as a whole. + */ +public String getKeyFieldName() { +return keyFieldName; +} + +/** + * @return Value name. Can be used in field list to denote the entire value. + */ +public String getValueFieldName() { +return valFieldName; +} + +/** * @return Fields to create group indexes for. */ public List getGroups() { @@ -166,8 +190,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { U.writeCollection(out, keyFields); IgfsUtils.writeStringMap(out, qryFlds); U.writeMap(out, aliases); -U.writeString(out, tblName); U.writeCollection(out, grps); +U.writeString(out, tblName); +U.writeString(out, keyFieldName); +U.writeString(out, valFieldName); } /** {@inheritDoc} */ @@ -177,8 +203,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { keyFields = U.readList(in); qryFlds = IgfsUtils.readStringMap(in); aliases = U.readMap(in); -tblName = U.readString(in); grps = U.readList(in); +tblName = U.readString(in); +keyFieldName = U.readString(in); +valFieldName = U.readString(in); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/web-console/backend/app/mongo.js -- diff --git a/modules/web-console/backend/app/mongo.js b/modules/web-console/backend/app/mongo.js index 32796e6..aa11e0b 100644 --- a/modules/web-console/backend/app/mongo.js +++ b/modules/web-console/backend/app/mongo.js @@ -106,6 +106,8 @@ module.exports.factory = function(passportMongo, settings, pluginMongo, mongoose queryMetadata: {type: String, enum: ['Annotations', 'Configuration']}, kind: {type: String, enum: ['query', 'store', 'both']}, tableName: String, +keyFieldName: String, +valueFieldName: String, databaseSchema: String, databaseTable: String, keyType: String, http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js ---
[03/49] ignite git commit: Rename ActionData -> CacheActionData.
Rename ActionData -> CacheActionData. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f589628f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f589628f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f589628f Branch: refs/heads/ignite-2.1 Commit: f589628f4846f14efc8e702b61856cc90a3d0dc7 Parents: 85d8c65 Author: sboikov Authored: Fri Jul 7 13:52:38 2017 +0300 Committer: sboikov Committed: Fri Jul 7 13:52:38 2017 +0300 -- .../cache/CacheAffinitySharedManager.java | 10 +++--- .../processors/cache/ClusterCachesInfo.java | 2 +- .../processors/cache/ExchangeActions.java | 34 ++-- .../processors/cache/GridCacheProcessor.java| 2 +- .../GridDhtPartitionsExchangeFuture.java| 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f589628f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java index 8d08c3f..548d795 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java @@ -701,7 +701,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap } }); -for (ExchangeActions.ActionData action : exchActions.cacheStartRequests()) { +for (ExchangeActions.CacheActionData action : exchActions.cacheStartRequests()) { DynamicCacheDescriptor cacheDesc = action.descriptor(); DynamicCacheChangeRequest req = action.request(); @@ -768,7 +768,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap Set gprs = new HashSet<>(); -for (ExchangeActions.ActionData action : exchActions.cacheStartRequests()) { +for (ExchangeActions.CacheActionData action : exchActions.cacheStartRequests()) { Integer grpId = action.descriptor().groupId(); if (gprs.add(grpId)) { @@ -786,7 +786,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap } } -for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) +for (ExchangeActions.CacheActionData action : exchActions.cacheStopRequests()) cctx.cache().blockGateway(action.request().cacheName(), true, action.request().restart()); for (ExchangeActions.CacheGroupActionData action : exchActions.cacheGroupsToStop()) { @@ -2308,10 +2308,10 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap assert old == null : old; } -for (ExchangeActions.ActionData req : exchActions.cacheStopRequests()) +for (ExchangeActions.CacheActionData req : exchActions.cacheStopRequests()) registeredCaches.remove(req.descriptor().cacheId()); -for (ExchangeActions.ActionData req : exchActions.cacheStartRequests()) +for (ExchangeActions.CacheActionData req : exchActions.cacheStartRequests()) registeredCaches.put(req.descriptor().cacheId(), req.descriptor()); } http://git-wip-us.apache.org/repos/asf/ignite/blob/f589628f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 5aca8c9..738e4ac 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -624,7 +624,7 @@ class ClusterCachesInfo { // If all caches in group will be destroyed it is not necessary to destroy single cache // because group will be stopped anyway. if (req.destroy()) { -for (ExchangeActions.ActionData action : exchangeActions.cacheStopRequests()) { +for (ExchangeActions.CacheActionData action : exchangeActions.cacheStopRequests()) { if (action.descriptor().groupId() == gr
[15/49] ignite git commit: Removed unused method GridDhtPartitionTopology.checkEvictions().
Removed unused method GridDhtPartitionTopology.checkEvictions(). Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a1cac1b7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a1cac1b7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a1cac1b7 Branch: refs/heads/ignite-2.1 Commit: a1cac1b7cc1c3afdcc12afb08bf1ecdcb6f28828 Parents: ea4420e Author: sboikov Authored: Fri Jul 7 15:55:18 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:55:18 2017 +0300 -- .../dht/GridClientPartitionTopology.java| 5 --- .../dht/GridDhtPartitionTopology.java | 7 ++-- .../dht/GridDhtPartitionTopologyImpl.java | 36 3 files changed, 2 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index 9e9f4fb..e751961 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -828,11 +828,6 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { return Collections.emptyList(); } -/** {@inheritDoc} */ -@Override public void checkEvictions() { -// No-op. -} - /** * Updates value for single partition. * http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java index bf4e844..5f76d12 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java @@ -280,11 +280,6 @@ public interface GridDhtPartitionTopology { public Collection lostPartitions(); /** - * - */ -public void checkEvictions(); - -/** * @param skipZeros If {@code true} then filters out zero counters. * @return Partition update counters. */ @@ -324,6 +319,7 @@ public interface GridDhtPartitionTopology { /** * Make nodes from provided set owners for a given partition. * State of all current owners that aren't contained in the set will be reset to MOVING. + * * @param p Partition ID. * @param updateSeq If should increment sequence when updated. * @param owners Set of new owners. @@ -333,6 +329,7 @@ public interface GridDhtPartitionTopology { /** * Callback on exchange done. + * * @param assignment New affinity assignment. */ public void onExchangeDone(AffinityAssignment assignment); http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index f49dccf..cf0dd5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -1745,42 +1745,6 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** * @param updateSeq Update sequence. - * @return {@code True} if state changed. - */ -private boolean checkEvictions(long updateSeq) { -AffinityTopologyVersion affVer = grp.affinity().lastVersion(); - -boolean changed = false; - -if (!affVer.equals(AffinityTopologyVersion.NONE) && affVer.compareT
[06/49] ignite git commit: Fixed formatting.
Fixed formatting. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4fc8124d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4fc8124d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4fc8124d Branch: refs/heads/ignite-2.1 Commit: 4fc8124d9538625cb0a95c918634b43ec1319bee Parents: ab52671 Author: sboikov Authored: Fri Jul 7 14:43:28 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:43:28 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 40 ++-- 1 file changed, 20 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/4fc8124d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 3e98b01..320ef06 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -440,18 +440,16 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { U.writeLock(lock); -try { - - -if (stopping) -return; +try { +if (stopping) +return; -GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + -topVer + ", exchId=" + exchId + ']'; +GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + +topVer + ", exchId=" + exchId + ']'; if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent()) removeNode(exchId.nodeId()); - + ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache(); if (log.isDebugEnabled()) @@ -461,10 +459,11 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { cntrMap.clear(); -boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. -if (oldest != null && (loc.equals(oldest) || grpStarted)) { -if (node2part == null) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); +boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. + +if (oldest != null && (loc.equals(oldest) || grpStarted)) { +if (node2part == null) { +node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); if (log.isDebugEnabled()) log.debug("Created brand new full topology map on oldest node [exchId=" + @@ -486,16 +485,17 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } } -if (grpStarted || -exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT || -exchFut.serverNodeDiscoveryEvent()) {if (affReady) -initPartitions0(exchFut, updateSeq); -else { -List> aff = grp.affinity().idealAssignment(); +if (grpStarted || +exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT || +exchFut.serverNodeDiscoveryEvent()) { +if (affReady) +initPartitions0(exchFut, updateSeq); +else { +List> aff = grp.affinity().idealAssignment(); -createPartitions(aff, updateSeq); +createPartitions(aff, updateSeq); +} } -} consistencyCheck();
[07/49] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/984ab5bd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/984ab5bd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/984ab5bd Branch: refs/heads/ignite-2.1 Commit: 984ab5bd3c08b2af9222964451acc281b92814b8 Parents: 4fc8124 99fd75d Author: sboikov Authored: Fri Jul 7 14:43:50 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:43:50 2017 +0300 -- .../pagemem/snapshot/SnapshotOperation.java | 17 +- .../cache/CacheAffinitySharedManager.java | 10 ++-- .../processors/cache/ClusterCachesInfo.java | 2 +- .../processors/cache/ExchangeActions.java | 34 ++-- .../processors/cache/GridCacheProcessor.java| 2 +- .../GridDhtPartitionsExchangeFuture.java| 2 +- .../IgniteChangeGlobalStateFailOverTest.java| 56 +--- .../query/h2/DmlStatementsProcessor.java| 19 +++ .../processors/query/h2/H2DatabaseType.java | 10 .../processors/query/h2/H2RowDescriptor.java| 13 + 10 files changed, 120 insertions(+), 45 deletions(-) --
[24/49] ignite git commit: IGNITE-5716 .NET: Fix 2-byte field offset handling
IGNITE-5716 .NET: Fix 2-byte field offset handling Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/82e5f8a6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/82e5f8a6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/82e5f8a6 Branch: refs/heads/ignite-2.1 Commit: 82e5f8a6553323e793c01c54e24dda6d47188ce6 Parents: eb37f53 Author: Pavel Tupitsyn Authored: Fri Jul 7 19:28:54 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 19:28:54 2017 +0300 -- .../Apache.Ignite.Core.Tests.csproj | 1 + .../Binary/BinaryFooterTest.cs | 146 +++ .../Binary/BinarySelfTest.cs| 32 .../Impl/Binary/BinaryObject.cs | 2 +- .../Impl/Binary/BinaryObjectBuilder.cs | 2 +- .../Impl/Binary/BinaryObjectSchemaField.cs | 3 + .../Impl/Binary/BinaryObjectSchemaSerializer.cs | 93 +--- .../Impl/Binary/BinaryReader.cs | 49 +-- 8 files changed, 228 insertions(+), 100 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/82e5f8a6/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 09eac70..d91f0e6 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 @@ -72,6 +72,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/82e5f8a6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs new file mode 100644 index 000..36f2f65 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs @@ -0,0 +1,146 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Core.Tests.Binary +{ +using System; +using System.Linq; +using Apache.Ignite.Core.Binary; +using Apache.Ignite.Core.Impl; +using Apache.Ignite.Core.Impl.Binary; +using NUnit.Framework; + +/// +/// Tests binary footer integrity (field offsets). +/// Writes objects of various sizes to test schema compaction +/// (where field offsets can be stored as 1, 2 or 4 bytes). +/// +public class BinaryFooterTest +{ +/// +/// Tears down the test. +/// +[TearDown] +public void TearDown() +{ +Ignition.StopAll(true); +} + +/// +/// Tests full footers in offline mode. +/// +[Test] +public void TestFullFooterOffline() +{ +// Register type to avoid unregistered type name in binary object. +// Use new marshaller to read and write to avoid schema caching. + +TestOffsets(() => new Marshaller(new BinaryConfiguration(typeof(OffsetTest)) +{ +// Compact footers do not work in offline mode. +CompactFooter = false +})); +} + +/// +/// Tests the full footer online. +/// +[Test] +public void TestFullFooterOnline() +{ +var ignite = Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration()) +{ +BinaryConfiguration = new BinaryConfiguration +{ +CompactFooter = false +} +}); + +TestOffsets(() => ((Ignite) ignite).Marshaller); +} + +/// +///
[38/49] ignite git commit: ignite-5075 Rename cacheId -> groupId
http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java index 665bb56..8fc2bdb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java @@ -74,7 +74,7 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public void read(int cacheId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { +@Override public void read(int grpId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { } @@ -84,35 +84,35 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public void readHeader(int cacheId, int partId, ByteBuffer buf) throws IgniteCheckedException { +@Override public void readHeader(int grpId, int partId, ByteBuffer buf) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void write(int cacheId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { +@Override public void write(int grpId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void sync(int cacheId, int partId) throws IgniteCheckedException { +@Override public void sync(int grpId, int partId) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void ensure(int cacheId, int partId) throws IgniteCheckedException { +@Override public void ensure(int grpId, int partId) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public long pageOffset(int cacheId, long pageId) throws IgniteCheckedException { +@Override public long pageOffset(int grpId, long pageId) throws IgniteCheckedException { return 0; } /** {@inheritDoc} */ -@Override public long allocatePage(int cacheId, int partId, byte flags) throws IgniteCheckedException { +@Override public long allocatePage(int grpId, int partId, byte flags) throws IgniteCheckedException { long root = PageIdUtils.pageId(partId, flags, 0); -FullPageId fullId = new FullPageId(root, cacheId); +FullPageId fullId = new FullPageId(root, grpId); AtomicInteger allocator = allocators.get(fullId); @@ -123,10 +123,10 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public int pages(int cacheId, int partId) throws IgniteCheckedException { +@Override public int pages(int grpId, int partId) throws IgniteCheckedException { long root = PageIdUtils.pageId(partId, (byte)0, 0); -FullPageId fullId = new FullPageId(root, cacheId); +FullPageId fullId = new FullPageId(root, grpId); AtomicInteger allocator = allocators.get(fullId); @@ -137,7 +137,7 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public long metaPageId(int cacheId) { +@Override public long metaPageId(int grpId) { return 1; }
[12/49] ignite git commit: 2.1 Fixed assert (cacheName can be null here).
2.1 Fixed assert (cacheName can be null here). Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/13399d53 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/13399d53 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/13399d53 Branch: refs/heads/ignite-2.1 Commit: 13399d530f3458c3bf59634857cb05f801e8cc34 Parents: d232648 Author: sboikov Authored: Fri Jul 7 15:24:09 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:24:09 2017 +0300 -- .../processors/datastructures/DataStructuresProcessor.java | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/13399d53/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 4399fe2..5564b79 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 @@ -326,12 +326,10 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen * @return {@code True} if cache with such name is used to store data structures. */ public static boolean isDataStructureCache(String cacheName) { -assert cacheName != null; - -return cacheName.startsWith(ATOMICS_CACHE_NAME) || +return cacheName != null && (cacheName.startsWith(ATOMICS_CACHE_NAME) || cacheName.startsWith(DS_CACHE_NAME_PREFIX) || cacheName.equals(DEFAULT_DS_GROUP_NAME) || -cacheName.equals(DEFAULT_VOLATILE_DS_GROUP_NAME); +cacheName.equals(DEFAULT_VOLATILE_DS_GROUP_NAME)); } /**
[20/49] ignite git commit: IGNITE-5554 ServiceProcessor may process failed reassignments in timeout thread
IGNITE-5554 ServiceProcessor may process failed reassignments in timeout thread Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/517a23d2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/517a23d2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/517a23d2 Branch: refs/heads/ignite-2.1 Commit: 517a23d252078e62a8addca55ca78497e5226b5b Parents: 3314a45 Author: mcherkasov Authored: Fri Jun 30 20:23:55 2017 +0300 Committer: mcherkasov Committed: Fri Jul 7 17:44:16 2017 +0300 -- .../service/GridServiceProcessor.java | 24 +--- 1 file changed, 11 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/517a23d2/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java index d67f2d1..23a29f8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; @@ -1509,18 +1510,11 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite } @Override public void onTimeout() { -GridSpinBusyLock busyLock = GridServiceProcessor.this.busyLock; - -if (busyLock == null || !busyLock.enterBusy()) -return; - -try { -// Try again. -onDeployment(dep, topVer); -} -finally { -busyLock.leaveBusy(); -} +depExe.execute(new DepRunnable() { +@Override public void run0() { +onDeployment(dep, topVer); +} +}); } }); } @@ -1716,7 +1710,11 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite } @Override public void onTimeout() { -onReassignmentFailed(topVer, retries); +depExe.execute(new Runnable() { +public void run() { +onReassignmentFailed(topVer, retries); +} +}); } }); }
[37/49] ignite git commit: Fixed NPE when test kernal context is used
Fixed NPE when test kernal context is used Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/56868102 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/56868102 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/56868102 Branch: refs/heads/ignite-2.1 Commit: 56868102ef46e37a914593fa0f81317ccb8e4cc4 Parents: 17d881b Author: Alexey Goncharuk Authored: Mon Jul 10 14:02:30 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 14:02:30 2017 +0300 -- .../testframework/junits/GridTestKernalContext.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/56868102/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 3d3de22..6b39faa 100644 --- 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 @@ -17,6 +17,7 @@ package org.apache.ignite.testframework.junits; +import java.util.Collections; import java.util.List; import java.util.ListIterator; import java.util.concurrent.ExecutorService; @@ -28,8 +29,10 @@ import org.apache.ignite.internal.GridKernalContextImpl; import org.apache.ignite.internal.GridKernalGatewayImpl; import org.apache.ignite.internal.GridLoggerProxy; import org.apache.ignite.internal.IgniteKernal; +import org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.plugin.PluginProvider; import org.apache.ignite.testframework.GridTestUtils; /** @@ -41,6 +44,13 @@ public class GridTestKernalContext extends GridKernalContextImpl { */ public GridTestKernalContext(IgniteLogger log) { this(log, new IgniteConfiguration()); + +try { +add(new IgnitePluginProcessor(this, config(), Collections.emptyList())); +} +catch (IgniteCheckedException e) { +throw new IllegalStateException("Must not fail for empty plugins list.", e); +} } /**
[22/49] ignite git commit: ignite-2.1 Minor.
ignite-2.1 Minor. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e5c2ec5a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e5c2ec5a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e5c2ec5a Branch: refs/heads/ignite-2.1 Commit: e5c2ec5a62c0d5fc268275ea9277f6933a582966 Parents: 993f7fb Author: Alexey Kuznetsov Authored: Fri Jul 7 23:06:52 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 23:06:52 2017 +0700 -- .../ignite/internal/visor/cache/VisorCacheMetrics.java | 12 ++-- .../visor/node/VisorMemoryPolicyConfiguration.java | 11 ++- .../src/main/resources/META-INF/classnames.properties | 11 +-- 3 files changed, 13 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c2ec5a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java index d99e0c9..5d8bc81 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java @@ -639,11 +639,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { } /** {@inheritDoc} */ -@Override public byte getProtocolVersion() { -return V2; -} - -/** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeString(out, name); U.writeEnum(out, mode); @@ -690,6 +685,7 @@ public class VisorCacheMetrics extends VisorDataTransferObject { out.writeLong(heapEntriesCnt); out.writeLong(offHeapAllocatedSize); out.writeLong(offHeapEntriesCnt); +out.writeLong(offHeapPrimaryEntriesCnt); out.writeInt(totalPartsCnt); out.writeInt(rebalancingPartsCnt); @@ -698,8 +694,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { out.writeLong(rebalancingBytesRate); out.writeObject(qryMetrics); - -out.writeLong(offHeapPrimaryEntriesCnt); } /** {@inheritDoc} */ @@ -748,6 +742,7 @@ public class VisorCacheMetrics extends VisorDataTransferObject { heapEntriesCnt = in.readLong(); offHeapAllocatedSize = in.readLong(); offHeapEntriesCnt = in.readLong(); +offHeapPrimaryEntriesCnt = in.readLong(); totalPartsCnt = in.readInt(); rebalancingPartsCnt = in.readInt(); @@ -756,9 +751,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { rebalancingBytesRate = in.readLong(); qryMetrics = (VisorQueryMetrics)in.readObject(); - -if (protoVer >= V2) -offHeapPrimaryEntriesCnt = in.readLong(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c2ec5a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java index d3153a6..bed4c4b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java @@ -131,32 +131,25 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject { } /** {@inheritDoc} */ -@Override public byte getProtocolVersion() { -return V2; -} - -/** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeString(out, name); +out.writeLong(initSize); out.writeLong(maxSize); U.writeString(out, swapFilePath); U.writeEnum(out, pageEvictionMode); out.writeDouble(evictionThreshold); out.writeInt(emptyPagesPoolSize); -out.writeLong(initSize); } /** {@inheritDoc} */ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException { name = U.readString(in); +initSize = in.readLong(); maxSize = in.readLong(); swapFilePath = U.readString(in); pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte()); evictionThreshold = in.readDouble();
[10/49] ignite git commit: Merge remote-tracking branch 'upstream/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'upstream/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2326487 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2326487 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2326487 Branch: refs/heads/ignite-2.1 Commit: d232648711c882ed304eae89ae19f151067649fd Parents: 2a5390b 7adb111 Author: devozerov Authored: Fri Jul 7 15:02:29 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:02:29 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 84 1 file changed, 50 insertions(+), 34 deletions(-) --
[02/49] ignite git commit: IGNITE-5520 - Fixed IgniteChangeGlobalStateFailoverTest
IGNITE-5520 - Fixed IgniteChangeGlobalStateFailoverTest Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/85d8c657 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/85d8c657 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/85d8c657 Branch: refs/heads/ignite-2.1 Commit: 85d8c6572d78c7d6796906d92b566e2fa5b116be Parents: ab52671 Author: Dmitriy Govorukhin Authored: Fri Jul 7 13:13:55 2017 +0300 Committer: Alexey Goncharuk Committed: Fri Jul 7 13:15:26 2017 +0300 -- .../IgniteChangeGlobalStateFailOverTest.java| 56 +--- 1 file changed, 37 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/85d8c657/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java index 92d1f21..02a21f4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java @@ -21,11 +21,11 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.util.typedef.internal.U; import static java.lang.Thread.sleep; import static org.apache.ignite.testframework.GridTestUtils.runAsync; @@ -144,8 +144,6 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState * @throws Exception If failed. */ public void testActivateDeActivateOnJoiningNode() throws Exception { -fail("https://issues.apache.org/jira/browse/IGNITE-5520";); - final Ignite igB1 = backUp(0); final Ignite igB2 = backUp(1); final Ignite igB3 = backUp(2); @@ -162,14 +160,17 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState final AtomicBoolean stop = new AtomicBoolean(); -final AtomicBoolean canAct = new AtomicBoolean(true); final AtomicInteger seqIdx = new AtomicInteger(backUpNodes()); +final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); + try { final IgniteInternalFuture af = runAsync(new Callable() { @Override public Void call() throws Exception { while (!stop.get()) { -if (canAct.get()) { +rwLock.readLock().lock(); + +try { Ignite ig = randomBackUp(false); long start = System.currentTimeMillis(); @@ -182,13 +183,12 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState for (Ignite ign : allBackUpNodes()) assertTrue(ign.active()); - -canAct.set(false); } -else -U.sleep(100); - +finally { +rwLock.readLock().unlock(); +} } + return null; } }); @@ -196,7 +196,9 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState final IgniteInternalFuture df = runAsync(new Callable() { @Override public Void call() throws Exception { while (!stop.get()) { -if (!canAct.get()) { +rwLock.writeLock().lock(); + +try { Ignite ig = randomBackUp(false); long start = System.currentTimeMillis(); @@ -209,20 +211,28 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState for (Ignite ign : allBackUpNodes()) assertTrue(!ign.active()); - -
[16/49] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/55a5ca01 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/55a5ca01 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/55a5ca01 Branch: refs/heads/ignite-2.1 Commit: 55a5ca019db7d06aab2fb567dbc0da1f133d0fb7 Parents: a1cac1b 0d6fb1a Author: sboikov Authored: Fri Jul 7 15:55:38 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:55:38 2017 +0300 -- .../internal/processors/query/h2/database/InlineIndexHelper.java | 2 +- .../processors/query/h2/database/InlineIndexHelperTest.java | 4 2 files changed, 5 insertions(+), 1 deletion(-) --
[42/49] ignite git commit: Removed unused method.
Removed unused method. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/92becc89 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/92becc89 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/92becc89 Branch: refs/heads/ignite-2.1 Commit: 92becc8918f0cfc0a0c0d94c19a93d50d5ffb10e Parents: c52d2bf Author: sboikov Authored: Mon Jul 10 16:59:48 2017 +0300 Committer: sboikov Committed: Mon Jul 10 16:59:48 2017 +0300 -- .../GridCachePartitionExchangeManager.java | 42 1 file changed, 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/92becc89/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index f1db79a..de0adc7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -89,7 +89,6 @@ import org.apache.ignite.internal.util.GridListSet; import org.apache.ignite.internal.util.GridPartitionStateMap; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; -import org.apache.ignite.internal.util.lang.IgnitePair; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.CI1; @@ -101,7 +100,6 @@ import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.lang.IgniteBiInClosure; -import org.apache.ignite.lang.IgniteProductVersion; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.thread.IgniteThread; import org.jetbrains.annotations.Nullable; @@ -160,10 +158,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana new ConcurrentSkipListMap<>(); /** */ -private final ConcurrentSkipListMap> nodeVers = -new ConcurrentSkipListMap<>(); - -/** */ private final AtomicReference readyTopVer = new AtomicReference<>(AffinityTopologyVersion.NONE); @@ -806,18 +800,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana } /** - * Gets minimum node version for the given topology version. - * - * @param topVer Topology version to get minimum node version for. - * @return Minimum node version. - */ -public IgniteProductVersion minimumNodeVersion(AffinityTopologyVersion topVer) { -IgnitePair vers = nodeVers.get(topVer); - -return vers == null ? cctx.localNode().version() : vers.get1(); -} - -/** * @return {@code true} if entered to busy state. */ private boolean enterBusy() { @@ -1257,30 +1239,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana if (log.isDebugEnabled()) log.debug("Exchange done [topVer=" + topVer + ", fut=" + exchFut + ", err=" + err + ']'); -IgniteProductVersion minVer = cctx.localNode().version(); -IgniteProductVersion maxVer = cctx.localNode().version(); - -if (err == null) { -if (!F.isEmpty(exchFut.discoveryEvent().topologyNodes())) { -for (ClusterNode node : exchFut.discoveryEvent().topologyNodes()) { -IgniteProductVersion ver = node.version(); - -if (ver.compareTo(minVer) < 0) -minVer = ver; - -if (ver.compareTo(maxVer) > 0) -maxVer = ver; -} -} -} - -nodeVers.put(topVer, new IgnitePair<>(minVer, maxVer)); - -AffinityTopologyVersion histVer = new AffinityTopologyVersion(topVer.topologyVersion() - 10, 0); - -for (AffinityTopologyVersion oldVer : nodeVers.headMap(histVer).keySet()) -nodeVers.remove(oldVer); - if (err == null) { while (true) { AffinityTopologyVersion readyVer = readyTopVer.get();
[30/49] ignite git commit: Fixed NPE in setOwners.
Fixed NPE in setOwners. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0b9527e8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0b9527e8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0b9527e8 Branch: refs/heads/ignite-2.1 Commit: 0b9527e851fd7c1d63bfc427721ca8af80d54b0c Parents: a535444 Author: sboikov Authored: Mon Jul 10 12:02:03 2017 +0300 Committer: sboikov Committed: Mon Jul 10 12:02:03 2017 +0300 -- .../cache/distributed/dht/GridDhtPartitionTopologyImpl.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0b9527e8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 2f54810..7c62cca 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -1722,7 +1722,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + +"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + ", partId=" + locPart.id() + ", haveHistory=" + haveHistory + "]"); } @@ -1743,8 +1743,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + -", partId=" + locPart.id() + ", haveHistory=" + haveHistory + "]"); +"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + +", partId=" + p + ", haveHistory=" + haveHistory + "]"); } if (updateSeq)
[14/49] ignite git commit: IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115.
IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0d6fb1ad Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0d6fb1ad Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0d6fb1ad Branch: refs/heads/ignite-2.1 Commit: 0d6fb1ad73e8ed448dabe7c0cc631222835b52c4 Parents: ea4420e Author: Sergey Kalashnikov Authored: Fri Jul 7 15:54:52 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:54:52 2017 +0300 -- .../internal/processors/query/h2/database/InlineIndexHelper.java | 2 +- .../processors/query/h2/database/InlineIndexHelperTest.java | 4 2 files changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java index 1fd45f3..19cf857 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java @@ -441,7 +441,7 @@ public class InlineIndexHelper { size = (short)s.length; else { s = trimUTF8(s, maxSize - 3); -size = (short)(s.length | 0x8000); +size = (short)(s == null ? 0 : s.length | 0x8000); } if (s == null) { http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java index 2579023..a2a3a72 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java @@ -167,6 +167,10 @@ public class InlineIndexHelperTest extends TestCase { assertTrue(ih.isValueFull(pageAddr, off)); assertEquals("aaa", ih.get(pageAddr, off, 3 + 5).getString()); + +ih.put(pageAddr, off, ValueString.get("\u20acaaa"), 3 + 2); + +assertNull(ih.get(pageAddr, off, 3 + 2)); } finally { if (page != 0L)
[19/49] ignite git commit: Fixed cache plugin validation.
Fixed cache plugin validation. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3314a451 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3314a451 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3314a451 Branch: refs/heads/ignite-2.1 Commit: 3314a4513c816c027dad80258ded1fe5a4c2b700 Parents: 3c88737 Author: sboikov Authored: Fri Jul 7 17:28:47 2017 +0300 Committer: sboikov Committed: Fri Jul 7 17:28:47 2017 +0300 -- .../processors/cache/ClusterCachesInfo.java | 30 +++- .../cache/DynamicCacheDescriptor.java | 13 - 2 files changed, 29 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 738e4ac..949bc19 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.CacheExistsException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; +import org.apache.ignite.internal.GridCachePluginContext; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; @@ -53,6 +54,9 @@ import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.plugin.CachePluginContext; +import org.apache.ignite.plugin.CachePluginProvider; +import org.apache.ignite.plugin.PluginProvider; import org.apache.ignite.spi.discovery.DiscoveryDataBag; import org.jetbrains.annotations.Nullable; @@ -175,8 +179,32 @@ class ClusterCachesInfo { locCacheInfo.cacheData().config().getName()); } -if (checkConsistency) +if (checkConsistency) { checkCache(locCacheInfo, cacheData, cacheData.receivedFrom()); + +ClusterNode rmt = ctx.discovery().node(cacheData.receivedFrom()); + +if (rmt == null) { +for (ClusterNode node : ctx.discovery().localJoin().discoCache().serverNodes()) { +if (!node.isLocal() && ctx.discovery().cacheAffinityNode(node, locCfg.getName())) { +rmt = node; + +break; +} +} +} + +if (rmt != null) { +for (PluginProvider p : ctx.plugins().allProviders()) { +CachePluginContext pluginCtx = new GridCachePluginContext(ctx, locCfg); + +CachePluginProvider provider = p.createCacheProvider(pluginCtx); + +if (provider != null) +provider.validateRemote(locCfg, cacheData.cacheConfiguration(), rmt); +} +} +} } if (checkConsistency) http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java index 315013d..18abcd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java @@ -24,7 +24,6 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProces
[39/49] ignite git commit: ignite-5075 Rename cacheId -> groupId
http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java index 4a56ec7..af20136 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java @@ -269,8 +269,8 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void read(int cacheId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { -read(cacheId, pageId, pageBuf, false); +@Override public void read(int grpId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { +read(grpId, pageId, pageBuf, false); } /** @@ -296,20 +296,20 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void readHeader(int cacheId, int partId, ByteBuffer buf) throws IgniteCheckedException { -PageStore store = getStore(cacheId, partId); +@Override public void readHeader(int grpId, int partId, ByteBuffer buf) throws IgniteCheckedException { +PageStore store = getStore(grpId, partId); store.readHeader(buf); } /** {@inheritDoc} */ -@Override public void write(int cacheId, long pageId, ByteBuffer pageBuf,int tag) throws IgniteCheckedException { -writeInternal(cacheId, pageId, pageBuf, tag); +@Override public void write(int grpId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { +writeInternal(grpId, pageId, pageBuf, tag); } /** {@inheritDoc} */ -@Override public long pageOffset(int cacheId, long pageId) throws IgniteCheckedException { -PageStore store = getStore(cacheId, PageIdUtils.partId(pageId)); +@Override public long pageOffset(int grpId, long pageId) throws IgniteCheckedException { +PageStore store = getStore(grpId, PageIdUtils.partId(pageId)); return store.pageOffset(pageId); } @@ -447,20 +447,20 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void sync(int cacheId, int partId) throws IgniteCheckedException { -getStore(cacheId, partId).sync(); +@Override public void sync(int grpId, int partId) throws IgniteCheckedException { +getStore(grpId, partId).sync(); } /** {@inheritDoc} */ -@Override public void ensure(int cacheId, int partId) throws IgniteCheckedException { -getStore(cacheId, partId).ensure(); +@Override public void ensure(int grpId, int partId) throws IgniteCheckedException { +getStore(grpId, partId).ensure(); } /** {@inheritDoc} */ -@Override public long allocatePage(int cacheId, int partId, byte flags) throws IgniteCheckedException { +@Override public long allocatePage(int grpId, int partId, byte flags) throws IgniteCheckedException { assert partId <= PageIdAllocator.MAX_PARTITION_ID || partId == PageIdAllocator.INDEX_PARTITION; -PageStore store = getStore(cacheId, partId); +PageStore store = getStore(grpId, partId); long pageIdx = store.allocatePage(); @@ -468,13 +468,13 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public long metaPageId(final int cacheId) { +@Override public long metaPageId(final int grpId) { return metaPageId; } /** {@inheritDoc} */ -@Override public int pages(int cacheId, int partId) throws IgniteCheckedException { -PageStore store = getStore(cacheId, partId); +@Override public int pages(int grpId, int partId) throws IgniteCheckedException { +PageStore store = getStore(grpId, partId); return store.pages(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java index 844bc02..e99a5ee 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persist
[08/49] ignite git commit: Fixed formatting.
Fixed formatting. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7adb1110 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7adb1110 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7adb1110 Branch: refs/heads/ignite-2.1 Commit: 7adb11109bab5d83ed4f376b0cad42b026dd0a71 Parents: 984ab5b Author: sboikov Authored: Fri Jul 7 14:49:13 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:49:13 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 52 +--- 1 file changed, 34 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7adb1110/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 320ef06..f49dccf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -444,23 +444,28 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (stopping) return; -GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + -topVer + ", exchId=" + exchId + ']'; +GridDhtPartitionExchangeId exchId = exchFut.exchangeId(); + +assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + topVer + +", exchId=" + exchId + ']'; if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent()) removeNode(exchId.nodeId()); ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache(); -if (log.isDebugEnabled()) -log.debug("Partition map beforeExchange [exchId=" + exchId + ", fullMap=" + fullMapString() + ']'); +if (log.isDebugEnabled()) { +log.debug("Partition map beforeExchange [exchId=" + exchId + +", fullMap=" + fullMapString() + ']'); +} long updateSeq = this.updateSeq.incrementAndGet(); cntrMap.clear(); -boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. +boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom()); +// If this is the oldest node. if (oldest != null && (loc.equals(oldest) || grpStarted)) { if (node2part == null) { node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); @@ -470,18 +475,28 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { exchId + ", fullMap=" + fullMapString() + ']'); } else if (!node2part.valid()) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); - -if (log.isDebugEnabled()) -log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + -node2part + ']'); +node2part = new GridDhtPartitionFullMap(oldest.id(), +oldest.order(), +updateSeq, +node2part, +false); + +if (log.isDebugEnabled()) { +log.debug("Created new full topology map on oldest node [exchId=" + exchId + +", fullMap=" + node2part + ']'); +} } else if (!node2part.nodeId().equals(loc.id())) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); - -if (log.isDebugEnabled()) -
[35/49] ignite git commit: GG-12418 - WAL hangs on any error during segment rollover
http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java index 06bcf08..ca54e6f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java @@ -39,11 +39,12 @@ import org.apache.ignite.configuration.PersistentStoreConfiguration; import org.apache.ignite.configuration.WALMode; import org.apache.ignite.events.Event; import org.apache.ignite.events.EventType; +import org.apache.ignite.events.WalSegmentArchivedEvent; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.pagemem.wal.WALPointer; import org.apache.ignite.internal.pagemem.wal.record.WALRecord; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager; -import org.apache.ignite.events.WalSegmentArchivedEvent; import org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; @@ -177,7 +178,9 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest { final File wal = new File(db, "wal"); final File walArchive = new File(wal, "archive"); final String consistentId = "127_0_0_1_47500"; -final MockWalIteratorFactory mockItFactory = new MockWalIteratorFactory(log, PAGE_SIZE, consistentId, WAL_SEGMENTS); + +final FileIOFactory fileIOFactory = getConfiguration("").getPersistentStoreConfiguration().getFileIOFactory(); +final MockWalIteratorFactory mockItFactory = new MockWalIteratorFactory(log, fileIOFactory, PAGE_SIZE, consistentId, WAL_SEGMENTS); final WALIterator it = mockItFactory.iterator(wal, walArchive); final int cntUsingMockIter = iterateAndCount(it); @@ -188,7 +191,7 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest { final File walArchiveDirWithConsistentId = new File(walArchive, consistentId); final File walWorkDirWithConsistentId = new File(wal, consistentId); -final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(log, PAGE_SIZE); +final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(log, fileIOFactory, PAGE_SIZE); final int cntArchiveDir = iterateAndCount(factory.iteratorArchiveDirectory(walArchiveDirWithConsistentId)); log.info("Total records loaded using directory : " + cntArchiveDir); http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java index 95079a0..ef162d2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java @@ -28,6 +28,7 @@ import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; import org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager; import org.jetbrains.annotations.Nullable; import org.mockito.Mockito; @@ -42,6 +43,9 @@ public class MockWalIteratorFactory { /** Logger. */ private final IgniteLogger log; +/** */ +private final FileIOFactory ioFactory; + /** Page size. */ private final int pageSize; @@ -58,8 +62,9 @@ public class MockWalIteratorFactory { * @param consistentId Consistent id. * @param segments Segments. */ -public MockWalIteratorFactory(@Nullable IgniteLogger log
[13/49] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ea4420e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ea4420e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ea4420e6 Branch: refs/heads/ignite-2.1 Commit: ea4420e6aad509c4ae58d6d0880918c98fd1959a Parents: 13399d5 a9387ad Author: sboikov Authored: Fri Jul 7 15:24:26 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:24:26 2017 +0300 -- .../Cache/PersistentStoreTest.cs| 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) --
[28/49] ignite git commit: ignite-5446 Alway use late affinity assignment mode
ignite-5446 Alway use late affinity assignment mode Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a5354441 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5354441 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5354441 Branch: refs/heads/ignite-2.1 Commit: a53544410dd15a3a5112d6de88648db21bd3fcf3 Parents: 17904cb Author: sboikov Authored: Mon Jul 10 11:38:04 2017 +0300 Committer: sboikov Committed: Mon Jul 10 11:38:04 2017 +0300 -- .../configuration/IgniteConfiguration.java | 15 +- .../affinity/AffinityHistoryCleanupTest.java| 182 --- ...idAbstractCacheInterceptorRebalanceTest.java | 2 - .../cache/GridCacheDeploymentSelfTest.java | 7 +- .../IgniteCacheP2pUnmarshallingTxErrorTest.java | 22 +-- ...ffinityAssignmentNodeJoinValidationTest.java | 46 + .../CacheLateAffinityAssignmentTest.java| 2 - ...CacheLoadingConcurrentGridStartSelfTest.java | 2 - ...idCachePartitionedPreloadEventsSelfTest.java | 143 --- ...LateAffDisabledMultiNodeFullApiSelfTest.java | 35 ...LateAffDisabledMultiNodeFullApiSelfTest.java | 34 .../db/IgnitePdsWholeClusterRestartTest.java| 1 - .../GridActivationPartitionedCacheSuit.java | 2 - ...ContinuousQueryFailoverAbstractSelfTest.java | 2 - .../processors/igfs/IgfsStreamsSelfTest.java| 1 - .../IgniteCacheFullApiSelfTestSuite.java| 6 - .../testsuites/IgniteCacheTestSuite2.java | 2 - 17 files changed, 17 insertions(+), 487 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a5354441/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index ed05fa4..cafa675 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -191,6 +191,7 @@ public class IgniteConfiguration { public static final boolean DFLT_CACHE_SANITY_CHECK_ENABLED = true; /** Default value for late affinity assignment flag. */ +@Deprecated public static final boolean DFLT_LATE_AFF_ASSIGNMENT = true; /** Default value for active on start flag. */ @@ -452,9 +453,6 @@ public class IgniteConfiguration { /** Custom executor configurations. */ private ExecutorConfiguration[] execCfgs; -/** */ -private boolean lateAffAssignment = DFLT_LATE_AFF_ASSIGNMENT; - /** Page memory configuration. */ private MemoryConfiguration memCfg; @@ -530,7 +528,6 @@ public class IgniteConfiguration { igniteWorkDir = cfg.getWorkDirectory(); inclEvtTypes = cfg.getIncludeEventTypes(); includeProps = cfg.getIncludeProperties(); -lateAffAssignment = cfg.isLateAffinityAssignment(); lifecycleBeans = cfg.getLifecycleBeans(); locHost = cfg.getLocalHost(); log = cfg.getGridLogger(); @@ -2721,14 +2718,14 @@ public class IgniteConfiguration { * from assignment calculated by {@link AffinityFunction#assignPartitions}. * * This property should have the same value for all nodes in cluster. - * - * If not provided, default value is {@link #DFLT_LATE_AFF_ASSIGNMENT}. * * @return Late affinity assignment flag. * @see AffinityFunction + * @deprecated Starting from Ignite 2.1 late affinity assignment is always enabled. */ +@Deprecated public boolean isLateAffinityAssignment() { -return lateAffAssignment; +return true; } /** @@ -2736,10 +2733,10 @@ public class IgniteConfiguration { * * @param lateAffAssignment Late affinity assignment flag. * @return {@code this} for chaining. + * @deprecated Starting from Ignite 2.1 late affinity assignment is always enabled. */ +@Deprecated public IgniteConfiguration setLateAffinityAssignment(boolean lateAffAssignment) { -this.lateAffAssignment = lateAffAssignment; - return this; } http://git-wip-us.apache.org/repos/asf/ignite/blob/a5354441/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java index 87c2050..605cc5f 100644 --- a/modules/core/src/test/java/org/apache/ignit
[05/49] ignite git commit: IGNITE-5483: Added limited support for Java8 LocalDateTime. This closes #2248.
IGNITE-5483: Added limited support for Java8 LocalDateTime. This closes #2248. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99fd75dd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99fd75dd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99fd75dd Branch: refs/heads/ignite-2.1 Commit: 99fd75dd7766318af88a38b5640a648bba3ccdf1 Parents: 30922ed Author: Sergey Kalashnikov Authored: Fri Jul 7 14:38:36 2017 +0300 Committer: devozerov Committed: Fri Jul 7 14:38:36 2017 +0300 -- .../query/h2/DmlStatementsProcessor.java | 19 +++ .../processors/query/h2/H2DatabaseType.java | 10 ++ .../processors/query/h2/H2RowDescriptor.java | 13 + 3 files changed, 42 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/99fd75dd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java index 98d123f..0c1dbf9 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java @@ -20,6 +20,8 @@ package org.apache.ignite.internal.processors.query.h2; import java.lang.reflect.Array; import java.sql.PreparedStatement; import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -79,8 +81,13 @@ import org.h2.command.dml.Insert; import org.h2.command.dml.Merge; import org.h2.command.dml.Update; import org.h2.table.Column; +import org.h2.util.DateTimeUtils; +import org.h2.util.LocalDateTimeUtils; import org.h2.value.DataType; import org.h2.value.Value; +import org.h2.value.ValueDate; +import org.h2.value.ValueTime; +import org.h2.value.ValueTimestamp; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -711,6 +718,18 @@ public class DmlStatementsProcessor { return U.unmarshal(desc.context().marshaller(), (byte[]) val, U.resolveClassLoader(desc.context().gridConfig())); +if (LocalDateTimeUtils.isJava8DateApiPresent()) { +if (val instanceof Timestamp && LocalDateTimeUtils.isLocalDateTime(expCls)) +return LocalDateTimeUtils.valueToLocalDateTime(ValueTimestamp.get((Timestamp)val)); + +if (val instanceof Date && LocalDateTimeUtils.isLocalDate(expCls)) +return LocalDateTimeUtils.valueToLocalDate(ValueDate.fromDateValue( +DateTimeUtils.dateValueFromDate(((Date)val).getTime(; + +if (val instanceof Time && LocalDateTimeUtils.isLocalTime(expCls)) +return LocalDateTimeUtils.valueToLocalTime(ValueTime.get((Time)val)); +} + // We have to convert arrays of reference types manually - see https://issues.apache.org/jira/browse/IGNITE-4327 // Still, we only can convert from Object[] to something more precise. if (type == Value.ARRAY && currCls != expCls) { http://git-wip-us.apache.org/repos/asf/ignite/blob/99fd75dd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java index 47c7eb9..8e4e639 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.query.h2; import org.apache.ignite.internal.util.typedef.internal.S; +import org.h2.util.LocalDateTimeUtils; import org.h2.value.DataType; import java.math.BigDecimal; @@ -142,6 +143,15 @@ public enum H2DatabaseType { if (DataType.isGeometryClass(cls)) return GEOMETRY; +if (LocalDateTimeUtils.isJava8DateApiPresent()) { +if (LocalDateTimeUtils.isLocalDate(cls)) +return DATE; +else if (LocalDateTimeUtils.isLocalTime(cls)) +return TIME; +else if (LocalDateTimeUtils.isLocalDateTime(cls)) +return TIMESTAMP; +
[04/49] ignite git commit: ignite-2.1 Added map with previous snapshots.
ignite-2.1 Added map with previous snapshots. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/30922ed8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/30922ed8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/30922ed8 Branch: refs/heads/ignite-2.1 Commit: 30922ed8ac518749a2559aff51fe183a890041bb Parents: f589628 Author: Alexey Kuznetsov Authored: Fri Jul 7 18:03:18 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 18:03:18 2017 +0700 -- .../pagemem/snapshot/SnapshotOperation.java| 17 - 1 file changed, 16 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/30922ed8/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java index 863107a..fa18cd7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.pagemem.snapshot; import java.io.File; import java.io.Serializable; import java.util.Collection; +import java.util.Map; import java.util.Set; /** @@ -50,6 +51,9 @@ public class SnapshotOperation implements Serializable { /** Optional list of dependent snapshot IDs. */ private final Set dependentSnapshotIds; +/** Optional map of previous snapshots grouped by caches. */ +private final Map> prevSnapshots; + /** * @param type Type. * @param snapshotId Snapshot id. @@ -58,6 +62,7 @@ public class SnapshotOperation implements Serializable { * @param msg Extra user message. * @param extraParam Additional parameter. * @param dependentSnapshotIds Optional list of dependent snapshot IDs. + * @param prevSnapshots Optional map of previous snapshots grouped by caches. */ public SnapshotOperation( SnapshotOperationType type, @@ -66,7 +71,8 @@ public class SnapshotOperation implements Serializable { Set cacheNames, String msg, Object extraParam, -Set dependentSnapshotIds +Set dependentSnapshotIds, +Map> prevSnapshots ) { this.type = type; this.snapshotId = snapshotId; @@ -75,6 +81,7 @@ public class SnapshotOperation implements Serializable { this.msg = msg; this.extraParam = extraParam; this.dependentSnapshotIds = dependentSnapshotIds; +this.prevSnapshots = prevSnapshots; } /** @@ -131,6 +138,13 @@ public class SnapshotOperation implements Serializable { } /** + * @return Cache names grouped by previous snapshot IDs. + */ +public Map> previousSnapshots() { +return prevSnapshots; +} + +/** * @param op Op. */ public static Collection getOptionalPathsParameter(SnapshotOperation op) { @@ -215,6 +229,7 @@ public class SnapshotOperation implements Serializable { ", msg='" + msg + '\'' + ", extraParam=" + extraParam + ", dependentSnapshotIds=" + dependentSnapshotIds + +", prevSnapshots=" + prevSnapshots + '}'; } }
[43/49] ignite git commit: IGNITE-2492 .NET: Peer assembly loading - add TestCacheGetOnRemoteNode
IGNITE-2492 .NET: Peer assembly loading - add TestCacheGetOnRemoteNode Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2ac39082 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2ac39082 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2ac39082 Branch: refs/heads/ignite-2.1 Commit: 2ac39082c6aa660085ea94df121166920821b427 Parents: 92becc8 Author: Pavel Tupitsyn Authored: Mon Jul 10 17:05:08 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 17:05:08 2017 +0300 -- .../Apache.Ignite.Core.Tests.csproj | 1 + .../Deployment/CacheGetFunc.cs | 50 .../Deployment/PeerAssemblyLoadingTest.cs | 24 ++ 3 files changed, 75 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/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 d91f0e6..4787c4d 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 @@ -78,6 +78,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs new file mode 100644 index 000..2679130 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs @@ -0,0 +1,50 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Core.Tests.Deployment +{ +using Apache.Ignite.Core.Compute; +using Apache.Ignite.Core.Resource; + +/// +/// Function to get a value from cache. +/// +public class CacheGetFunc : IComputeFunc +{ +/// +/// Gets or sets the cache key. +/// +public TKey Key { get; set; } + +/// +/// Gets or sets the name of the cache. +/// +public string CacheName { get; set; } + +/// +/// Gets or sets the ignite. +/// +[InstanceResource] +public IIgnite Ignite { get;set; } + +/** */ +public TValue Invoke() +{ +return Ignite.GetCache(CacheName).Get(Key); +} +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs index 8245333..da896dd 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs @@ -131,6 +131,30 @@ namespace Apache.Ignite.Core.Tests.Deployment } /// +/// Tests the cache get operation on remote node. +/// +[Test] +public void TestCacheGetOnRemoteNode() +{ +TestDeployment(remoteCompute => +{ +var cache = remoteCompute.ClusterGroup.Ignite.GetOrCreateCache("addr"); +cache[1] = new Address("street", 123); + +// This will fail for func, because cache operations are not p2p-enabled. +// However, generic nature of the func causes Address to be peer-deployed
[40/49] ignite git commit: ignite-5075 Rename cacheId -> groupId
ignite-5075 Rename cacheId -> groupId Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f2568b76 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f2568b76 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f2568b76 Branch: refs/heads/ignite-2.1 Commit: f2568b76417aebc0e3c20003a8120b2d2adab3eb Parents: 5686810 Author: sboikov Authored: Mon Jul 10 14:41:04 2017 +0300 Committer: sboikov Committed: Mon Jul 10 14:41:04 2017 +0300 -- .../ignite/internal/pagemem/FullPageId.java | 32 - .../ignite/internal/pagemem/PageSupport.java| 36 +- .../pagemem/store/IgnitePageStoreManager.java | 40 +-- .../delta/DataPageInsertFragmentRecord.java | 6 +- .../wal/record/delta/DataPageInsertRecord.java | 6 +- .../wal/record/delta/DataPageRemoveRecord.java | 6 +- .../delta/DataPageSetFreeListPageRecord.java| 6 +- .../wal/record/delta/DataPageUpdateRecord.java | 6 +- .../wal/record/delta/FixCountRecord.java| 6 +- .../record/delta/FixLeftmostChildRecord.java| 6 +- .../pagemem/wal/record/delta/FixRemoveId.java | 6 +- .../wal/record/delta/InitNewPageRecord.java | 6 +- .../wal/record/delta/InnerReplaceRecord.java| 6 +- .../pagemem/wal/record/delta/InsertRecord.java | 6 +- .../pagemem/wal/record/delta/MergeRecord.java | 6 +- .../wal/record/delta/MetaPageAddRootRecord.java | 6 +- .../wal/record/delta/MetaPageCutRootRecord.java | 6 +- .../wal/record/delta/MetaPageInitRecord.java| 6 +- .../delta/MetaPageInitRootInlineRecord.java | 6 +- .../record/delta/MetaPageInitRootRecord.java| 4 +- .../delta/MetaPageUpdateLastAllocatedIndex.java | 4 +- ...aPageUpdateLastSuccessfulFullSnapshotId.java | 4 +- .../MetaPageUpdateLastSuccessfulSnapshotId.java | 4 +- .../delta/MetaPageUpdateNextSnapshotId.java | 4 +- .../MetaPageUpdatePartitionDataRecord.java | 6 +- .../wal/record/delta/NewRootInitRecord.java | 6 +- .../wal/record/delta/PageDeltaRecord.java | 14 ++-- .../delta/PageListMetaResetCountRecord.java | 6 +- .../record/delta/PagesListAddPageRecord.java| 6 +- .../delta/PagesListInitNewPageRecord.java | 6 +- .../record/delta/PagesListRemovePageRecord.java | 2 +- .../record/delta/PagesListSetNextRecord.java| 6 +- .../delta/PagesListSetPreviousRecord.java | 6 +- .../record/delta/PartitionDestroyRecord.java| 20 +++--- .../record/delta/PartitionMetaStateRecord.java | 16 ++--- .../pagemem/wal/record/delta/RecycleRecord.java | 6 +- .../pagemem/wal/record/delta/RemoveRecord.java | 6 +- .../pagemem/wal/record/delta/ReplaceRecord.java | 6 +- .../record/delta/SplitExistingPageRecord.java | 6 +- .../record/delta/SplitForwardPageRecord.java| 6 +- .../record/delta/TrackingPageDeltaRecord.java | 6 +- .../cache/persistence/DataStructure.java| 46 ++-- .../GridCacheDatabaseSharedManager.java | 38 +- .../persistence/GridCacheOffheapManager.java| 4 +- .../cache/persistence/MetadataStorage.java | 2 +- .../persistence/file/FilePageStoreManager.java | 34 - .../persistence/freelist/FreeListImpl.java | 6 +- .../cache/persistence/freelist/PagesList.java | 36 +- .../persistence/pagemem/FullPageIdTable.java| 54 +++--- .../cache/persistence/pagemem/PageMemoryEx.java | 4 +- .../persistence/pagemem/PageMemoryImpl.java | 72 +-- .../cache/persistence/tree/BPlusTree.java | 16 ++--- .../wal/serializer/RecordV1Serializer.java | 76 ++-- .../pagemem/impl/PageMemoryNoLoadSelfTest.java | 52 +++--- ...gnitePdsRecoveryAfterFileCorruptionTest.java | 24 +++ ...ckpointSimulationWithRealCpDisabledTest.java | 74 +-- .../db/file/IgnitePdsEvictionTest.java | 16 ++--- .../db/wal/IgniteWalRecoveryTest.java | 10 +-- .../pagemem/NoOpPageStoreManager.java | 22 +++--- 59 files changed, 470 insertions(+), 470 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java index 20677ea..00f52c1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java @@ -56,28 +56,28 @@ public class FullPageId { private final long effectivePageId; /** */ -private final int cacheId; +private final int grpId; /** -
[21/49] ignite git commit: IGNITE-5701 - Some nodes have partitionUpdateCounter equal to 0 after rebalancing
IGNITE-5701 - Some nodes have partitionUpdateCounter equal to 0 after rebalancing Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/993f7fbe Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/993f7fbe Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/993f7fbe Branch: refs/heads/ignite-2.1 Commit: 993f7fbe1d49a524e2dee626aef72e16fd5d3cda Parents: 517a23d Author: Ilya Lantukh Authored: Fri Jul 7 18:55:27 2017 +0300 Committer: Alexey Goncharuk Committed: Fri Jul 7 18:55:41 2017 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 2 +- .../distributed/dht/GridDhtCacheEntry.java | 6 -- .../distributed/dht/GridDhtLocalPartition.java | 45 .../dht/GridDhtPartitionTopologyImpl.java | 16 - .../dht/preloader/GridDhtPartitionDemander.java | 5 +- .../dht/preloader/GridDhtPartitionSupplier.java | 2 +- .../GridDhtPartitionSupplyMessage.java | 20 +++--- .../GridCacheDatabaseSharedManager.java | 2 +- .../IgnitePdsCacheRebalancingAbstractTest.java | 74 .../wal/IgniteWalHistoryReservationsTest.java | 29 ++-- 10 files changed, 131 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 085712a..35b0577 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -626,7 +626,7 @@ public final class IgniteSystemProperties { /** * WAL rebalance threshold. */ - public static final String IGNITE_PDS_WAL_REBALANCE_THRESHOLD = "IGNITE_PDS_WAL_REBALANCE_THRESHOLD"; +public static final String IGNITE_PDS_WAL_REBALANCE_THRESHOLD = "IGNITE_PDS_WAL_REBALANCE_THRESHOLD"; /** Ignite page memory concurrency level. */ public static final String IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL = "IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL"; http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java index 57dd622..77cc642 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java @@ -123,12 +123,6 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry { } /** {@inheritDoc} */ -@Override protected void onUpdateFinished(long cntr) { -if (cctx.shared().database().persistenceEnabled()) -locPart.onUpdateReceived(cntr); -} - -/** {@inheritDoc} */ @Override public boolean isDht() { return true; } http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java index 8e42351..725822d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java @@ -157,13 +157,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements @GridToStringExclude private final CacheDataStore store; -/** Partition updates. */ -@GridToStringExclude -private final ConcurrentNavigableMap updates = new ConcurrentSkipListMap<>(); - -/** Last applied update. */ -private final AtomicLong lastApplied = new AtomicLong(0); - /** Set if failed to move partition to RENTING state due to reservations, to be checked when * reservation is released. */ private volatile boolean shouldBeRenting; @@ -349,44 +342,6 @@ public class GridDhtLocalPartition extends
[36/49] ignite git commit: GG-12418 - WAL hangs on any error during segment rollover
GG-12418 - WAL hangs on any error during segment rollover Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17d881ba Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17d881ba Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17d881ba Branch: refs/heads/ignite-2.1 Commit: 17d881ba0122a7f90cac9846c376300a1d001bdd Parents: f1c8e59 Author: Pavel Kovalenko Authored: Mon Jul 10 13:55:47 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 13:57:51 2017 +0300 -- .../PersistentStoreConfiguration.java | 24 +++ .../cache/persistence/file/FileIO.java | 154 +++ .../cache/persistence/file/FileIODecorator.java | 98 ++ .../cache/persistence/file/FileIOFactory.java | 45 + .../cache/persistence/file/FilePageStore.java | 51 +++-- .../persistence/file/FilePageStoreManager.java | 2 + .../persistence/file/RandomAccessFileIO.java| 110 +++ .../file/RandomAccessFileIOFactory.java | 42 .../wal/AbstractWalRecordsIterator.java | 22 ++- .../cache/persistence/wal/FileInput.java| 40 ++-- .../wal/FileWriteAheadLogManager.java | 161 --- .../wal/reader/IgniteWalIteratorFactory.java| 13 +- .../wal/reader/StandaloneGridKernalContext.java | 15 +- .../reader/StandaloneIgnitePluginProcessor.java | 38 .../reader/StandaloneWalRecordsIterator.java| 37 ++-- ...gnitePdsRecoveryAfterFileCorruptionTest.java | 11 +- .../db/wal/IgniteWalFlushFailoverTest.java | 195 +++ .../db/wal/crc/IgniteDataIntegrityTests.java| 10 +- .../db/wal/reader/IgniteWalReaderTest.java | 9 +- .../db/wal/reader/MockWalIteratorFactory.java | 8 +- .../ignite/testsuites/IgnitePdsTestSuite2.java | 4 + 21 files changed, 919 insertions(+), 170 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java index b531f9d..4792483 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java @@ -16,6 +16,8 @@ */ package org.apache.ignite.configuration; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; +import org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory; import org.apache.ignite.internal.util.typedef.internal.S; import java.io.Serializable; @@ -133,6 +135,9 @@ public class PersistentStoreConfiguration implements Serializable { /** Always write full pages. */ private boolean alwaysWriteFullPages = DFLT_WAL_ALWAYS_WRITE_FULL_PAGES; +/** Factory to provide I/O interface for files */ +private FileIOFactory fileIOFactory = new RandomAccessFileIOFactory(); + /** * Number of sub-intervals the whole {@link #setRateTimeInterval(long)} will be split into to calculate * rate-based metrics. @@ -539,6 +544,25 @@ public class PersistentStoreConfiguration implements Serializable { } /** + * Factory to provide implementation of FileIO interface + * which is used for any file read/write operations + * + * @return File I/O factory + */ +public FileIOFactory getFileIOFactory() { +return fileIOFactory; +} + +/** + * @param fileIOFactory File I/O factory + */ +public PersistentStoreConfiguration setFileIOFactory(FileIOFactory fileIOFactory) { +this.fileIOFactory = fileIOFactory; + +return this; +} + +/** * Note: setting this value with {@link WALMode#DEFAULT} may generate file size overhead for WAL segments in case * grid is used rarely. * http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java new file mode 100644 index 000..1e81150 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or m
[31/49] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 # Conflicts: # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9790a46c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9790a46c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9790a46c Branch: refs/heads/ignite-2.1 Commit: 9790a46c59e2fdc29703246db3dc7ba9abcd108a Parents: 0b9527e 17694c1 Author: sboikov Authored: Mon Jul 10 12:02:41 2017 +0300 Committer: sboikov Committed: Mon Jul 10 12:02:41 2017 +0300 -- ...ishSnapshotOperationAckDiscoveryMessage.java | 84 --- .../snapshot/SnapshotCheckParameters.java | 75 -- .../pagemem/snapshot/SnapshotOperation.java | 235 --- .../pagemem/snapshot/SnapshotOperationType.java | 49 ...artSnapshotOperationAckDiscoveryMessage.java | 149 .../StartSnapshotOperationDiscoveryMessage.java | 192 --- .../GridCachePartitionExchangeManager.java | 9 +- .../processors/cache/GridCacheProcessor.java| 22 +- .../cache/GridCacheSharedContext.java | 6 +- .../dht/GridDhtPartitionTopologyImpl.java | 8 +- .../GridDhtPartitionsExchangeFuture.java| 54 ++--- .../GridCacheDatabaseSharedManager.java | 3 +- .../persistence/IgniteCacheSnapshotManager.java | 150 .../persistence/file/FilePageStoreManager.java | 2 +- .../snapshot/IgniteCacheSnapshotManager.java| 161 + .../snapshot/SnapshotDiscoveryMessage.java | 33 +++ .../persistence/snapshot/SnapshotOperation.java | 44 .../datastructures/DataStructuresProcessor.java | 6 +- .../resources/META-INF/classnames.properties| 5 - .../loadtests/hashmap/GridCacheTestContext.java | 6 +- 20 files changed, 286 insertions(+), 1007 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9790a46c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 7c62cca,a69872f..fe0a0c6 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@@ -1740,11 -1740,11 +1740,11 @@@ public class GridDhtPartitionTopologyIm result.add(e.getKey()); } - } - U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + - "[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + - ", partId=" + p + ", haveHistory=" + haveHistory + "]"); + U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + ++"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + + ", partId=" + p + ", haveHistory=" + haveHistory + "]"); + } } if (updateSeq)
[27/49] ignite git commit: GG-12466 - Clean up public API for snapshots
GG-12466 - Clean up public API for snapshots Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/36716fb1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/36716fb1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/36716fb1 Branch: refs/heads/ignite-2.1 Commit: 36716fb1f4de5d1f5baab1e27afc95583dd4c7b4 Parents: 17904cb Author: Pavel Kovalenko Authored: Mon Jul 10 11:09:43 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 11:10:41 2017 +0300 -- ...ishSnapshotOperationAckDiscoveryMessage.java | 84 --- .../snapshot/SnapshotCheckParameters.java | 75 -- .../pagemem/snapshot/SnapshotOperation.java | 235 --- .../pagemem/snapshot/SnapshotOperationType.java | 49 ...artSnapshotOperationAckDiscoveryMessage.java | 149 .../StartSnapshotOperationDiscoveryMessage.java | 192 --- .../GridCachePartitionExchangeManager.java | 9 +- .../processors/cache/GridCacheProcessor.java| 22 +- .../cache/GridCacheSharedContext.java | 6 +- .../dht/GridDhtPartitionTopologyImpl.java | 8 +- .../GridDhtPartitionsExchangeFuture.java| 54 ++--- .../GridCacheDatabaseSharedManager.java | 3 +- .../persistence/IgniteCacheSnapshotManager.java | 150 .../persistence/file/FilePageStoreManager.java | 2 +- .../snapshot/IgniteCacheSnapshotManager.java| 161 + .../snapshot/SnapshotDiscoveryMessage.java | 33 +++ .../persistence/snapshot/SnapshotOperation.java | 44 .../resources/META-INF/classnames.properties| 5 - .../loadtests/hashmap/GridCacheTestContext.java | 6 +- 19 files changed, 281 insertions(+), 1006 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/36716fb1/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java deleted file mode 100644 index f6758e0..000 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java +++ /dev/null @@ -1,84 +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.pagemem.snapshot; - -import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.lang.IgniteUuid; -import org.jetbrains.annotations.Nullable; - -/** - * - */ -public class FinishSnapshotOperationAckDiscoveryMessage implements DiscoveryCustomMessage { -/** */ -private static final long serialVersionUID = 0L; - -/** Id. */ -private final IgniteUuid id = IgniteUuid.randomUuid(); - -/** Op id. */ -private final IgniteUuid opId; - -/** Success. */ -private final boolean success; - -/** - * @param opId Op id. - * @param success Success. - */ -public FinishSnapshotOperationAckDiscoveryMessage(IgniteUuid opId, boolean success) { -this.opId = opId; -this.success = success; -} - -/** {@inheritDoc} */ -@Override public IgniteUuid id() { -return id; -} - -/** {@inheritDoc} */ -@Nullable @Override public DiscoveryCustomMessage ackMessage() { -return null; -} - -/** {@inheritDoc} */ -@Override public boolean isMutable() { -return false; -} - -/** - * @return Op id. - */ -public IgniteUuid operationId() { -return opId; -} - -/** - * @return Success. - */ -public boolean success() { -return success; -} - -/** {@inheritDoc} */ -@Override public String toString() { -return S.toString(FinishSnapshot
[49/49] ignite git commit: IGNITE-5686 Endless partition eviction during node shutdown
IGNITE-5686 Endless partition eviction during node shutdown Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a668a224 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a668a224 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a668a224 Branch: refs/heads/ignite-2.1 Commit: a668a224a8c69afd618667fa19309f1b7a0c8ca3 Parents: 4f3b69c Author: Igor Seliverstov Authored: Tue Jul 11 10:40:56 2017 +0200 Committer: Igor Seliverstov Committed: Tue Jul 11 10:40:56 2017 +0200 -- .../src/main/scala/org/apache/ignite/spark/IgniteRDD.scala | 6 +++--- .../main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala | 6 +- .../org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java | 5 - 3 files changed, 8 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala -- diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala index 81509d0..78e2223 100644 --- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala +++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala @@ -60,11 +60,11 @@ class IgniteRDD[K, V] ( val qry: ScanQuery[K, V] = new ScanQuery[K, V](part.index) -val partNodes = ic.ignite().affinity(cache.getName).mapPartitionToPrimaryAndBackups(part.index) +val cur = cache.query(qry) -val it: java.util.Iterator[Cache.Entry[K, V]] = cache.query(qry).iterator() +TaskContext.get().addTaskCompletionListener((_) ⇒ cur.close()) -new IgniteQueryIterator[Cache.Entry[K, V], (K, V)](it, entry ⇒ { +new IgniteQueryIterator[Cache.Entry[K, V], (K, V)](cur.iterator(), entry ⇒ { (entry.getKey, entry.getValue) }) } http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala -- diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala index f074572..f386f26 100644 --- a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala +++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala @@ -33,7 +33,11 @@ class IgniteSqlRDD[R: ClassTag, T, K, V]( keepBinary: Boolean ) extends IgniteAbstractRDD[R, K, V](ic, cacheName, cacheCfg, keepBinary) { override def compute(split: Partition, context: TaskContext): Iterator[R] = { -new IgniteQueryIterator[T, R](ensureCache().query(qry).iterator(), conv) +val cur = ensureCache().query(qry) + +TaskContext.get().addTaskCompletionListener((_) ⇒ cur.close()) + +new IgniteQueryIterator[T, R](cur.iterator(), conv) } override protected def getPartitions: Array[Partition] = { http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java -- diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java index 5477d43..49bb1ac 100644 --- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java +++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java @@ -100,11 +100,6 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { } /** {@inheritDoc} */ -@Override protected void beforeTest() throws Exception { -fail("https://issues.apache.org/jira/browse/IGNITE-5690";); -} - -/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { stopAllGrids(); }
[34/49] ignite git commit: IGNITE-5716 .NET: Fix 2-byte field offset handling - improve tests
IGNITE-5716 .NET: Fix 2-byte field offset handling - improve tests Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f1c8e59c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1c8e59c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1c8e59c Branch: refs/heads/ignite-2.1 Commit: f1c8e59cb9410915a6e61ba6f4f63c6f3c795c75 Parents: 313f86e Author: Pavel Tupitsyn Authored: Mon Jul 10 13:15:20 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 13:15:20 2017 +0300 -- .../Binary/BinaryFooterTest.cs | 32 1 file changed, 32 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f1c8e59c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs index 36f2f65..5088e5a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs @@ -20,6 +20,8 @@ namespace Apache.Ignite.Core.Tests.Binary using System; using System.Linq; using Apache.Ignite.Core.Binary; +using Apache.Ignite.Core.Cache.Configuration; +using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Impl.Binary; using NUnit.Framework; @@ -117,16 +119,46 @@ namespace Apache.Ignite.Core.Tests.Binary Assert.AreEqual(dt.Arr, r.Arr); Assert.AreEqual(dt.Int, r.Int); } + +TestSql(dt, getMarsh()); } } } /// +/// Tests SQL query, which verifies Java side of things. +/// +private static void TestSql(OffsetTest dt, Marshaller marsh) +{ +var ignite = marsh.Ignite; + +if (ignite == null) +{ +return; +} + +var cache = ignite.GetOrCreateCache( +new CacheConfiguration("offs", new QueryEntity(typeof(int), typeof(OffsetTest; + +// Cache operation. +cache[1] = dt; +Assert.AreEqual(dt.Int, cache[1].Int); +Assert.AreEqual(dt.Arr, cache[1].Arr); + +// SQL: read field on Java side to ensure correct offset handling. +var res = cache.QueryFields(new SqlFieldsQuery("select int from OffsetTest")).GetAll()[0][0]; +Assert.AreEqual(dt.Int, (int) res); +} + +/// /// Offset test. /// private class OffsetTest : IBinarizable { +[QuerySqlField] public byte[] Arr; // Array to enforce field offset. + +[QuerySqlField] public int Int; // Value at offset. public void WriteBinary(IBinaryWriter writer)
[41/49] ignite git commit: IGNITE-5679: Example for thin JDBC driver. This closes #2232.
IGNITE-5679: Example for thin JDBC driver. This closes #2232. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c52d2bf3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c52d2bf3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c52d2bf3 Branch: refs/heads/ignite-2.1 Commit: c52d2bf312b3c950a187db74fff5a7348e3709c1 Parents: f2568b7 Author: tledkov-gridgain Authored: Mon Jul 10 15:19:58 2017 +0300 Committer: devozerov Committed: Mon Jul 10 15:19:58 2017 +0300 -- .../examples/datagrid/CacheQueryDdlExample.java | 26 ++-- .../ignite/examples/datagrid/JdbcExample.java | 135 +++ .../CacheExamplesMultiNodeSelfTest.java | 9 ++ .../ignite/examples/CacheExamplesSelfTest.java | 2 +- 4 files changed, 158 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c52d2bf3/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java index 84a67cd..201dda1 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java @@ -56,33 +56,33 @@ public class CacheQueryDdlExample { try ( IgniteCache cache = ignite.getOrCreateCache(cacheCfg) ) { -// Create table based on PARTITIONED template with one backup. -cache.query(new SqlFieldsQuery( -"CREATE TABLE person (id LONG PRIMARY KEY, name VARCHAR, city_id LONG) " + -"WITH \"backups=1\"")).getAll(); - // Create reference City table based on REPLICATED template. cache.query(new SqlFieldsQuery( "CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=replicated\"")).getAll(); +// Create table based on PARTITIONED template with one backup. +cache.query(new SqlFieldsQuery( +"CREATE TABLE person (id LONG, name VARCHAR, city_id LONG, PRIMARY KEY (id, city_id)) " + +"WITH \"backups=1, affinityKey=city_id\"")).getAll(); + // Create an index. cache.query(new SqlFieldsQuery("CREATE INDEX on Person (city_id)")).getAll(); print("Created database objects."); -SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); +SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO city (id, name) VALUES (?, ?)"); + +cache.query(qry.setArgs(1L, "Forest Hill")).getAll(); +cache.query(qry.setArgs(2L, "Denver")).getAll(); +cache.query(qry.setArgs(3L, "St. Petersburg")).getAll(); + +qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); cache.query(qry.setArgs(1L, "John Doe", 3L)).getAll(); cache.query(qry.setArgs(2L, "Jane Roe", 2L)).getAll(); cache.query(qry.setArgs(3L, "Mary Major", 1L)).getAll(); cache.query(qry.setArgs(4L, "Richard Miles", 2L)).getAll(); -qry = new SqlFieldsQuery("INSERT INTO city (id, name) VALUES (?, ?)"); - -cache.query(qry.setArgs(1L, "Forest Hill")).getAll(); -cache.query(qry.setArgs(2L, "Denver")).getAll(); -cache.query(qry.setArgs(3L, "St. Petersburg")).getAll(); - print("Populated data."); List> res = cache.query(new SqlFieldsQuery( @@ -91,7 +91,7 @@ public class CacheQueryDdlExample { print("Query results:"); for (Object next : res) -System.out.println(">>> " + next); +System.out.println(">>>" + next); cache.query(new SqlFieldsQuery("drop table Person")).getAll(); cache.query(new SqlFieldsQuery("drop table City")).getAll(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c52d2bf3/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java new file mode 100644 index 000..bc96e42 --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExamp
[47/49] ignite git commit: Web Console: Fixed logic on cluster lost.
Web Console: Fixed logic on cluster lost. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a2c8030 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a2c8030 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a2c8030 Branch: refs/heads/ignite-2.1 Commit: 2a2c803039965e52ac5fc33be6cbccc5a27abd84 Parents: b3e6298 Author: Andrey Novikov Authored: Tue Jul 11 09:50:04 2017 +0700 Committer: Andrey Novikov Committed: Tue Jul 11 09:50:04 2017 +0700 -- modules/web-console/frontend/app/app.js | 2 + .../cluster-select/cluster-select.controller.js | 72 ++-- .../cluster-select/cluster-select.pug | 10 +-- .../frontend/app/filters/id8.filter.js | 20 ++ .../app/modules/agent/AgentManager.service.js | 4 +- .../views/templates/agent-download.tpl.pug | 4 +- 6 files changed, 68 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2a2c8030/modules/web-console/frontend/app/app.js -- diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js index 7b8196e..c707810 100644 --- a/modules/web-console/frontend/app/app.js +++ b/modules/web-console/frontend/app/app.js @@ -104,6 +104,7 @@ import domainsValidation from './filters/domainsValidation.filter'; import duration from './filters/duration.filter'; import hasPojo from './filters/hasPojo.filter'; import uiGridSubcategories from './filters/uiGridSubcategories.filter'; +import id8 from './filters/id8.filter'; // Controllers import profile from 'Controllers/profile-controller'; @@ -254,6 +255,7 @@ angular .filter('duration', duration) .filter('hasPojo', hasPojo) .filter('uiGridSubcategories', uiGridSubcategories) +.filter('id8', id8) .config(['$translateProvider', '$stateProvider', '$locationProvider', '$urlRouterProvider', ($translateProvider, $stateProvider, $locationProvider, $urlRouterProvider) => { $translateProvider.translations('en', i18n); $translateProvider.preferredLanguage('en'); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a2c8030/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js -- diff --git a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js index 6d30e94..a2d8e1e 100644 --- a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js +++ b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js @@ -15,52 +15,50 @@ * limitations under the License. */ -export default ['$scope', 'AgentManager', function($scope, agentMgr) { -const ctrl = this; +export default class { +static $inject = ['AgentManager']; -ctrl.counter = 1; +constructor(agentMgr) { +const ctrl = this; -ctrl.cluster = null; -ctrl.clusters = []; +ctrl.counter = 1; -agentMgr.connectionSbj.subscribe({ -next: ({cluster, clusters}) => { -if (_.isEmpty(clusters)) -return ctrl.clusters.length = 0; +ctrl.cluster = null; +ctrl.clusters = []; -const removed = _.differenceBy(ctrl.clusters, clusters, 'id'); +agentMgr.connectionSbj.subscribe({ +next: ({cluster, clusters}) => { +if (_.isEmpty(clusters)) +return ctrl.clusters.length = 0; -if (_.nonEmpty(removed)) -_.pullAll(ctrl.clusters, removed); +const removed = _.differenceBy(ctrl.clusters, clusters, 'id'); -const added = _.differenceBy(clusters, ctrl.clusters, 'id'); +if (_.nonEmpty(removed)) +_.pullAll(ctrl.clusters, removed); -_.forEach(added, (cluster) => { -ctrl.clusters.push({ -id: cluster.id, -name: `Cluster ${cluster.id.substring(0, 8).toUpperCase()}`, -connected: true, -click: () => { -if (cluster.id === _.get(ctrl, 'cluster.id')) -return; +const added = _.differenceBy(clusters, ctrl.clusters, 'id'); -if (_.get(ctrl, 'cluster.connected')) { -agentMgr.saveToStorage(cluster); +_.forEach(added, (cluster) => { +ctrl.clusters.push({ +id: cluster.id, +connected: true, +click: () => { +if
[44/49] ignite git commit: Added partition release future timing
Added partition release future timing Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/33ae472f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/33ae472f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/33ae472f Branch: refs/heads/ignite-2.1 Commit: 33ae472fc47c8983e48ac0febe22f11457c89ba1 Parents: 2ac3908 Author: Alexey Goncharuk Authored: Mon Jul 10 17:18:18 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 17:18:37 2017 +0300 -- .../dht/preloader/GridDhtPartitionsExchangeFuture.java | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/33ae472f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 21a3a13..5760f87 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -1042,6 +1042,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte int dumpCnt = 0; +long waitStart = U.currentTimeMillis(); + long nextDumpTime = 0; long futTimeout = 2 * cctx.gridConfig().getNetworkTimeout(); @@ -1062,8 +1064,11 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte } } -if (log.isDebugEnabled()) -log.debug("After waiting for partition release future: " + this); +long waitEnd = U.currentTimeMillis(); + +if (log.isInfoEnabled()) +log.info("Finished waiting for partition release future [topVer=" + exchangeId().topologyVersion() + +", waitTime=" + (waitEnd - waitStart) + "ms]"); IgniteInternalFuture locksFut = cctx.mvcc().finishLocks(exchId.topologyVersion());
[32/49] ignite git commit: IGNITE-5491 .NET: PersistentStoreMetrics
IGNITE-5491 .NET: PersistentStoreMetrics Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b085fa0d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b085fa0d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b085fa0d Branch: refs/heads/ignite-2.1 Commit: b085fa0db67f8cda01e6927715241b10ac43c0f2 Parents: 9790a46 Author: Pavel Tupitsyn Authored: Mon Jul 10 12:24:54 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 12:24:54 2017 +0300 -- .../platform/cluster/PlatformClusterGroup.java | 39 - .../utils/PlatformConfigurationUtils.java | 8 +- .../Cache/PersistentStoreTest.cs| 9 +- .../IgniteConfigurationSerializerTest.cs| 11 +- .../IgniteConfigurationTest.cs | 11 +- .../Apache.Ignite.Core.csproj | 2 + .../dotnet/Apache.Ignite.Core/IIgnite.cs| 9 ++ .../IgniteConfigurationSection.xsd | 15 ++ .../Impl/Cluster/ClusterGroupImpl.cs| 14 ++ .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs| 7 + .../PersistentStore/PersistentStoreMetrics.cs | 88 +++ .../PersistentStore/IPersistentStoreMetrics.cs | 87 +++ .../PersistentStoreConfiguration.cs | 156 --- 13 files changed, 392 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b085fa0d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java index 3e3aa3a..f6e3d2e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCluster; import org.apache.ignite.MemoryMetrics; +import org.apache.ignite.PersistenceMetrics; import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.cluster.ClusterMetrics; import org.apache.ignite.cluster.ClusterNode; @@ -122,6 +123,9 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { /** */ private static final int OP_IS_ACTIVE = 29; +/** */ +private static final int OP_PERSISTENT_STORE_METRICS = 30; + /** Projection. */ private final ClusterGroupEx prj; @@ -146,7 +150,7 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { break; -case OP_MEMORY_METRICS: +case OP_MEMORY_METRICS: { Collection metrics = prj.ignite().memoryMetrics(); writer.writeInt(metrics.size()); @@ -156,6 +160,15 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { } break; +} + +case OP_PERSISTENT_STORE_METRICS: { +PersistenceMetrics metrics = prj.ignite().persistentStoreMetrics(); + +writePersistentStoreMetrics(writer, metrics); + +break; +} default: super.processOutStream(type, writer); @@ -448,4 +461,28 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { writer.writeFloat(metrics.getLargeEntriesPagesPercentage()); writer.writeFloat(metrics.getPagesFillFactor()); } + +/** + * Writes persistent store metrics. + * + * @param writer Writer. + * @param metrics Metrics + */ +private void writePersistentStoreMetrics(BinaryRawWriter writer, PersistenceMetrics metrics) { +assert writer != null; +assert metrics != null; + +writer.writeFloat(metrics.getWalLoggingRate()); +writer.writeFloat(metrics.getWalWritingRate()); +writer.writeInt(metrics.getWalArchiveSegments()); +writer.writeFloat(metrics.getWalFsyncTimeAverage()); +writer.writeLong(metrics.getLastCheckpointingDuration()); +writer.writeLong(metrics.getLastCheckpointLockWaitDuration()); +writer.writeLong(metrics.getLastCheckpointMarkDuration()); +writer.writeLong(metrics.getLastCheckpointPagesWriteDuration()); +writer.writeLong(metrics.getLastCheckpointFsyncDuration()); +writer.writeLong(metrics.getLastCheckpointTotalPagesNumber()); +writer.writeLong(metrics.getLastCheckpointDataPagesNumber()); +writer.writeLong(metric
[37/50] ignite git commit: Fixed NPE when test kernal context is used
Fixed NPE when test kernal context is used Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/56868102 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/56868102 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/56868102 Branch: refs/heads/master Commit: 56868102ef46e37a914593fa0f81317ccb8e4cc4 Parents: 17d881b Author: Alexey Goncharuk Authored: Mon Jul 10 14:02:30 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 14:02:30 2017 +0300 -- .../testframework/junits/GridTestKernalContext.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/56868102/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 3d3de22..6b39faa 100644 --- 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 @@ -17,6 +17,7 @@ package org.apache.ignite.testframework.junits; +import java.util.Collections; import java.util.List; import java.util.ListIterator; import java.util.concurrent.ExecutorService; @@ -28,8 +29,10 @@ import org.apache.ignite.internal.GridKernalContextImpl; import org.apache.ignite.internal.GridKernalGatewayImpl; import org.apache.ignite.internal.GridLoggerProxy; import org.apache.ignite.internal.IgniteKernal; +import org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.plugin.PluginProvider; import org.apache.ignite.testframework.GridTestUtils; /** @@ -41,6 +44,13 @@ public class GridTestKernalContext extends GridKernalContextImpl { */ public GridTestKernalContext(IgniteLogger log) { this(log, new IgniteConfiguration()); + +try { +add(new IgnitePluginProcessor(this, config(), Collections.emptyList())); +} +catch (IgniteCheckedException e) { +throw new IllegalStateException("Must not fail for empty plugins list.", e); +} } /**
[24/50] ignite git commit: IGNITE-5716 .NET: Fix 2-byte field offset handling
IGNITE-5716 .NET: Fix 2-byte field offset handling Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/82e5f8a6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/82e5f8a6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/82e5f8a6 Branch: refs/heads/master Commit: 82e5f8a6553323e793c01c54e24dda6d47188ce6 Parents: eb37f53 Author: Pavel Tupitsyn Authored: Fri Jul 7 19:28:54 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 19:28:54 2017 +0300 -- .../Apache.Ignite.Core.Tests.csproj | 1 + .../Binary/BinaryFooterTest.cs | 146 +++ .../Binary/BinarySelfTest.cs| 32 .../Impl/Binary/BinaryObject.cs | 2 +- .../Impl/Binary/BinaryObjectBuilder.cs | 2 +- .../Impl/Binary/BinaryObjectSchemaField.cs | 3 + .../Impl/Binary/BinaryObjectSchemaSerializer.cs | 93 +--- .../Impl/Binary/BinaryReader.cs | 49 +-- 8 files changed, 228 insertions(+), 100 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/82e5f8a6/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 09eac70..d91f0e6 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 @@ -72,6 +72,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/82e5f8a6/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs new file mode 100644 index 000..36f2f65 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs @@ -0,0 +1,146 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Core.Tests.Binary +{ +using System; +using System.Linq; +using Apache.Ignite.Core.Binary; +using Apache.Ignite.Core.Impl; +using Apache.Ignite.Core.Impl.Binary; +using NUnit.Framework; + +/// +/// Tests binary footer integrity (field offsets). +/// Writes objects of various sizes to test schema compaction +/// (where field offsets can be stored as 1, 2 or 4 bytes). +/// +public class BinaryFooterTest +{ +/// +/// Tears down the test. +/// +[TearDown] +public void TearDown() +{ +Ignition.StopAll(true); +} + +/// +/// Tests full footers in offline mode. +/// +[Test] +public void TestFullFooterOffline() +{ +// Register type to avoid unregistered type name in binary object. +// Use new marshaller to read and write to avoid schema caching. + +TestOffsets(() => new Marshaller(new BinaryConfiguration(typeof(OffsetTest)) +{ +// Compact footers do not work in offline mode. +CompactFooter = false +})); +} + +/// +/// Tests the full footer online. +/// +[Test] +public void TestFullFooterOnline() +{ +var ignite = Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration()) +{ +BinaryConfiguration = new BinaryConfiguration +{ +CompactFooter = false +} +}); + +TestOffsets(() => ((Ignite) ignite).Marshaller); +} + +/// +/// Tes
[14/50] ignite git commit: IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115.
IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0d6fb1ad Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0d6fb1ad Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0d6fb1ad Branch: refs/heads/master Commit: 0d6fb1ad73e8ed448dabe7c0cc631222835b52c4 Parents: ea4420e Author: Sergey Kalashnikov Authored: Fri Jul 7 15:54:52 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:54:52 2017 +0300 -- .../internal/processors/query/h2/database/InlineIndexHelper.java | 2 +- .../processors/query/h2/database/InlineIndexHelperTest.java | 4 2 files changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java index 1fd45f3..19cf857 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java @@ -441,7 +441,7 @@ public class InlineIndexHelper { size = (short)s.length; else { s = trimUTF8(s, maxSize - 3); -size = (short)(s.length | 0x8000); +size = (short)(s == null ? 0 : s.length | 0x8000); } if (s == null) { http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java index 2579023..a2a3a72 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java @@ -167,6 +167,10 @@ public class InlineIndexHelperTest extends TestCase { assertTrue(ih.isValueFull(pageAddr, off)); assertEquals("aaa", ih.get(pageAddr, off, 3 + 5).getString()); + +ih.put(pageAddr, off, ValueString.get("\u20acaaa"), 3 + 2); + +assertNull(ih.get(pageAddr, off, 3 + 2)); } finally { if (page != 0L)
[25/50] ignite git commit: .NET: Remove unused import and redundant cast
.NET: Remove unused import and redundant cast Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cb5ae961 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cb5ae961 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cb5ae961 Branch: refs/heads/master Commit: cb5ae9617af900e953e0f6f065adcd707d2b3830 Parents: 82e5f8a Author: Pavel Tupitsyn Authored: Fri Jul 7 20:15:47 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 20:15:47 2017 +0300 -- .../Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/cb5ae961/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs index f5a5179..d08a191 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs @@ -27,7 +27,6 @@ namespace Apache.Ignite.Core.Cache.Configuration using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; -using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cache.Affinity; using Apache.Ignite.Core.Cache.Affinity.Rendezvous; @@ -242,7 +241,7 @@ namespace Apache.Ignite.Core.Cache.Configuration private void Read(BinaryReader reader) { // Make sure system marshaller is used. -Debug.Assert(((BinaryReader) reader).Marshaller == BinaryUtils.Marshaller); +Debug.Assert(reader.Marshaller == BinaryUtils.Marshaller); AtomicityMode = (CacheAtomicityMode) reader.ReadInt(); Backups = reader.ReadInt();
[50/50] ignite git commit: Merge branch 'ignite-2.1'
Merge branch 'ignite-2.1' # Conflicts: # modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ecfbc2c9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ecfbc2c9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ecfbc2c9 Branch: refs/heads/master Commit: ecfbc2c97464ad7da3f24afaaf1868a2d2fdb87e Parents: 01f504f a668a22 Author: devozerov Authored: Tue Jul 11 12:17:41 2017 +0300 Committer: devozerov Committed: Tue Jul 11 12:17:41 2017 +0300 -- .../examples/datagrid/CacheQueryDdlExample.java | 119 ++ .../ignite/examples/datagrid/JdbcExample.java | 135 .../CacheExamplesMultiNodeSelfTest.java | 9 + .../ignite/examples/CacheExamplesSelfTest.java | 8 + .../apache/ignite/IgniteSystemProperties.java | 2 +- .../configuration/IgniteConfiguration.java | 15 +- .../PersistentStoreConfiguration.java | 24 ++ .../ignite/internal/pagemem/FullPageId.java | 32 +-- .../ignite/internal/pagemem/PageSupport.java| 36 +-- ...ishSnapshotOperationAckDiscoveryMessage.java | 84 --- .../snapshot/SnapshotCheckParameters.java | 75 --- .../pagemem/snapshot/SnapshotOperation.java | 220 --- .../pagemem/snapshot/SnapshotOperationType.java | 49 - ...artSnapshotOperationAckDiscoveryMessage.java | 149 - .../StartSnapshotOperationDiscoveryMessage.java | 192 .../pagemem/store/IgnitePageStoreManager.java | 40 ++-- .../delta/DataPageInsertFragmentRecord.java | 6 +- .../wal/record/delta/DataPageInsertRecord.java | 6 +- .../wal/record/delta/DataPageRemoveRecord.java | 6 +- .../delta/DataPageSetFreeListPageRecord.java| 6 +- .../wal/record/delta/DataPageUpdateRecord.java | 6 +- .../wal/record/delta/FixCountRecord.java| 6 +- .../record/delta/FixLeftmostChildRecord.java| 6 +- .../pagemem/wal/record/delta/FixRemoveId.java | 6 +- .../wal/record/delta/InitNewPageRecord.java | 6 +- .../wal/record/delta/InnerReplaceRecord.java| 6 +- .../pagemem/wal/record/delta/InsertRecord.java | 6 +- .../pagemem/wal/record/delta/MergeRecord.java | 6 +- .../wal/record/delta/MetaPageAddRootRecord.java | 6 +- .../wal/record/delta/MetaPageCutRootRecord.java | 6 +- .../wal/record/delta/MetaPageInitRecord.java| 6 +- .../delta/MetaPageInitRootInlineRecord.java | 6 +- .../record/delta/MetaPageInitRootRecord.java| 4 +- .../delta/MetaPageUpdateLastAllocatedIndex.java | 4 +- ...aPageUpdateLastSuccessfulFullSnapshotId.java | 4 +- .../MetaPageUpdateLastSuccessfulSnapshotId.java | 4 +- .../delta/MetaPageUpdateNextSnapshotId.java | 4 +- .../MetaPageUpdatePartitionDataRecord.java | 6 +- .../wal/record/delta/NewRootInitRecord.java | 6 +- .../wal/record/delta/PageDeltaRecord.java | 14 +- .../delta/PageListMetaResetCountRecord.java | 6 +- .../record/delta/PagesListAddPageRecord.java| 6 +- .../delta/PagesListInitNewPageRecord.java | 6 +- .../record/delta/PagesListRemovePageRecord.java | 2 +- .../record/delta/PagesListSetNextRecord.java| 6 +- .../delta/PagesListSetPreviousRecord.java | 6 +- .../record/delta/PartitionDestroyRecord.java| 20 +- .../record/delta/PartitionMetaStateRecord.java | 16 +- .../pagemem/wal/record/delta/RecycleRecord.java | 6 +- .../pagemem/wal/record/delta/RemoveRecord.java | 6 +- .../pagemem/wal/record/delta/ReplaceRecord.java | 6 +- .../record/delta/SplitExistingPageRecord.java | 6 +- .../record/delta/SplitForwardPageRecord.java| 6 +- .../record/delta/TrackingPageDeltaRecord.java | 6 +- .../cache/CacheAffinitySharedManager.java | 10 +- .../processors/cache/ClusterCachesInfo.java | 32 ++- .../cache/DynamicCacheDescriptor.java | 13 -- .../processors/cache/ExchangeActions.java | 34 +-- .../GridCachePartitionExchangeManager.java | 51 + .../processors/cache/GridCacheProcessor.java| 26 ++- .../cache/GridCacheSharedContext.java | 6 +- .../dht/GridClientPartitionTopology.java| 76 --- .../distributed/dht/GridDhtCacheEntry.java | 6 - .../distributed/dht/GridDhtLocalPartition.java | 45 .../dht/GridDhtPartitionTopology.java | 7 +- .../dht/GridDhtPartitionTopologyImpl.java | 163 +++--- .../distributed/dht/GridDhtTxFinishFuture.java | 4 +- .../dht/preloader/GridDhtPartitionDemander.java | 5 +- .../dht/preloader/GridDhtPartitionFullMap.java | 24 +- .../dht/preloader/GridDhtPartitionSupplier.java | 2 +- .../GridDhtPartitionSupplyMessage.java | 20 +- .../GridDhtPartitionsExchangeFuture.java| 67 ++ .../near/GridNearTxFinishFu
[33/50] ignite git commit: GridDhtPartitionsExchangeFuture minor: removed duplicated updateAlives call.
GridDhtPartitionsExchangeFuture minor: removed duplicated updateAlives call. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/313f86e5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/313f86e5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/313f86e5 Branch: refs/heads/master Commit: 313f86e5536f82cf34a9a95ad16fa1afbe37a63e Parents: b085fa0 Author: sboikov Authored: Mon Jul 10 13:01:02 2017 +0300 Committer: sboikov Committed: Mon Jul 10 13:01:02 2017 +0300 -- .../distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/313f86e5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 90c8aaf..21a3a13 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -545,8 +545,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte AffinityTopologyVersion topVer = topologyVersion(); -discoCache.updateAlives(cctx.discovery()); - srvNodes = new ArrayList<>(discoCache.serverNodes()); remaining.addAll(F.nodeIds(F.view(srvNodes, F.remoteNodes(cctx.localNodeId();
[32/50] ignite git commit: IGNITE-5491 .NET: PersistentStoreMetrics
IGNITE-5491 .NET: PersistentStoreMetrics Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b085fa0d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b085fa0d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b085fa0d Branch: refs/heads/master Commit: b085fa0db67f8cda01e6927715241b10ac43c0f2 Parents: 9790a46 Author: Pavel Tupitsyn Authored: Mon Jul 10 12:24:54 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 12:24:54 2017 +0300 -- .../platform/cluster/PlatformClusterGroup.java | 39 - .../utils/PlatformConfigurationUtils.java | 8 +- .../Cache/PersistentStoreTest.cs| 9 +- .../IgniteConfigurationSerializerTest.cs| 11 +- .../IgniteConfigurationTest.cs | 11 +- .../Apache.Ignite.Core.csproj | 2 + .../dotnet/Apache.Ignite.Core/IIgnite.cs| 9 ++ .../IgniteConfigurationSection.xsd | 15 ++ .../Impl/Cluster/ClusterGroupImpl.cs| 14 ++ .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs| 7 + .../PersistentStore/PersistentStoreMetrics.cs | 88 +++ .../PersistentStore/IPersistentStoreMetrics.cs | 87 +++ .../PersistentStoreConfiguration.cs | 156 --- 13 files changed, 392 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b085fa0d/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java index 3e3aa3a..f6e3d2e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCluster; import org.apache.ignite.MemoryMetrics; +import org.apache.ignite.PersistenceMetrics; import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.cluster.ClusterMetrics; import org.apache.ignite.cluster.ClusterNode; @@ -122,6 +123,9 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { /** */ private static final int OP_IS_ACTIVE = 29; +/** */ +private static final int OP_PERSISTENT_STORE_METRICS = 30; + /** Projection. */ private final ClusterGroupEx prj; @@ -146,7 +150,7 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { break; -case OP_MEMORY_METRICS: +case OP_MEMORY_METRICS: { Collection metrics = prj.ignite().memoryMetrics(); writer.writeInt(metrics.size()); @@ -156,6 +160,15 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { } break; +} + +case OP_PERSISTENT_STORE_METRICS: { +PersistenceMetrics metrics = prj.ignite().persistentStoreMetrics(); + +writePersistentStoreMetrics(writer, metrics); + +break; +} default: super.processOutStream(type, writer); @@ -448,4 +461,28 @@ public class PlatformClusterGroup extends PlatformAbstractTarget { writer.writeFloat(metrics.getLargeEntriesPagesPercentage()); writer.writeFloat(metrics.getPagesFillFactor()); } + +/** + * Writes persistent store metrics. + * + * @param writer Writer. + * @param metrics Metrics + */ +private void writePersistentStoreMetrics(BinaryRawWriter writer, PersistenceMetrics metrics) { +assert writer != null; +assert metrics != null; + +writer.writeFloat(metrics.getWalLoggingRate()); +writer.writeFloat(metrics.getWalWritingRate()); +writer.writeInt(metrics.getWalArchiveSegments()); +writer.writeFloat(metrics.getWalFsyncTimeAverage()); +writer.writeLong(metrics.getLastCheckpointingDuration()); +writer.writeLong(metrics.getLastCheckpointLockWaitDuration()); +writer.writeLong(metrics.getLastCheckpointMarkDuration()); +writer.writeLong(metrics.getLastCheckpointPagesWriteDuration()); +writer.writeLong(metrics.getLastCheckpointFsyncDuration()); +writer.writeLong(metrics.getLastCheckpointTotalPagesNumber()); +writer.writeLong(metrics.getLastCheckpointDataPagesNumber()); +writer.writeLong(metrics.ge
[20/50] ignite git commit: IGNITE-5554 ServiceProcessor may process failed reassignments in timeout thread
IGNITE-5554 ServiceProcessor may process failed reassignments in timeout thread Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/517a23d2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/517a23d2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/517a23d2 Branch: refs/heads/master Commit: 517a23d252078e62a8addca55ca78497e5226b5b Parents: 3314a45 Author: mcherkasov Authored: Fri Jun 30 20:23:55 2017 +0300 Committer: mcherkasov Committed: Fri Jul 7 17:44:16 2017 +0300 -- .../service/GridServiceProcessor.java | 24 +--- 1 file changed, 11 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/517a23d2/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java index d67f2d1..23a29f8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; @@ -1509,18 +1510,11 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite } @Override public void onTimeout() { -GridSpinBusyLock busyLock = GridServiceProcessor.this.busyLock; - -if (busyLock == null || !busyLock.enterBusy()) -return; - -try { -// Try again. -onDeployment(dep, topVer); -} -finally { -busyLock.leaveBusy(); -} +depExe.execute(new DepRunnable() { +@Override public void run0() { +onDeployment(dep, topVer); +} +}); } }); } @@ -1716,7 +1710,11 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite } @Override public void onTimeout() { -onReassignmentFailed(topVer, retries); +depExe.execute(new Runnable() { +public void run() { +onReassignmentFailed(topVer, retries); +} +}); } }); }
[39/50] ignite git commit: ignite-5075 Rename cacheId -> groupId
http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java index 4a56ec7..af20136 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java @@ -269,8 +269,8 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void read(int cacheId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { -read(cacheId, pageId, pageBuf, false); +@Override public void read(int grpId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { +read(grpId, pageId, pageBuf, false); } /** @@ -296,20 +296,20 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void readHeader(int cacheId, int partId, ByteBuffer buf) throws IgniteCheckedException { -PageStore store = getStore(cacheId, partId); +@Override public void readHeader(int grpId, int partId, ByteBuffer buf) throws IgniteCheckedException { +PageStore store = getStore(grpId, partId); store.readHeader(buf); } /** {@inheritDoc} */ -@Override public void write(int cacheId, long pageId, ByteBuffer pageBuf,int tag) throws IgniteCheckedException { -writeInternal(cacheId, pageId, pageBuf, tag); +@Override public void write(int grpId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { +writeInternal(grpId, pageId, pageBuf, tag); } /** {@inheritDoc} */ -@Override public long pageOffset(int cacheId, long pageId) throws IgniteCheckedException { -PageStore store = getStore(cacheId, PageIdUtils.partId(pageId)); +@Override public long pageOffset(int grpId, long pageId) throws IgniteCheckedException { +PageStore store = getStore(grpId, PageIdUtils.partId(pageId)); return store.pageOffset(pageId); } @@ -447,20 +447,20 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public void sync(int cacheId, int partId) throws IgniteCheckedException { -getStore(cacheId, partId).sync(); +@Override public void sync(int grpId, int partId) throws IgniteCheckedException { +getStore(grpId, partId).sync(); } /** {@inheritDoc} */ -@Override public void ensure(int cacheId, int partId) throws IgniteCheckedException { -getStore(cacheId, partId).ensure(); +@Override public void ensure(int grpId, int partId) throws IgniteCheckedException { +getStore(grpId, partId).ensure(); } /** {@inheritDoc} */ -@Override public long allocatePage(int cacheId, int partId, byte flags) throws IgniteCheckedException { +@Override public long allocatePage(int grpId, int partId, byte flags) throws IgniteCheckedException { assert partId <= PageIdAllocator.MAX_PARTITION_ID || partId == PageIdAllocator.INDEX_PARTITION; -PageStore store = getStore(cacheId, partId); +PageStore store = getStore(grpId, partId); long pageIdx = store.allocatePage(); @@ -468,13 +468,13 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen } /** {@inheritDoc} */ -@Override public long metaPageId(final int cacheId) { +@Override public long metaPageId(final int grpId) { return metaPageId; } /** {@inheritDoc} */ -@Override public int pages(int cacheId, int partId) throws IgniteCheckedException { -PageStore store = getStore(cacheId, partId); +@Override public int pages(int grpId, int partId) throws IgniteCheckedException { +PageStore store = getStore(grpId, partId); return store.pages(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListImpl.java index 844bc02..e99a5ee 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persist
[46/50] ignite git commit: IGNITE-5662 Primary index name should contain type ID or name - Fixes #2275.
IGNITE-5662 Primary index name should contain type ID or name - Fixes #2275. Signed-off-by: Alexey Goncharuk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b3e6298a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b3e6298a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b3e6298a Branch: refs/heads/master Commit: b3e6298a099f684a293a61b97e7623f5400cc5d0 Parents: d2fe437 Author: Eduard Shangareev Authored: Mon Jul 10 20:44:29 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 20:44:29 2017 +0300 -- .../internal/processors/query/QueryUtils.java | 8 +- ...oreQueryWithMultipleClassesPerCacheTest.java | 185 +++ .../IgnitePdsWithIndexingTestSuite.java | 2 + 3 files changed, 193 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/b3e6298a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java index 022d121..320b25a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java @@ -421,10 +421,12 @@ public class QueryUtils { QueryTypeIdKey typeId; QueryTypeIdKey altTypeId = null; +int valTypeId = ctx.cacheObjects().typeId(qryEntity.findValueType()); + if (valCls == null || (binaryEnabled && !keyOrValMustDeserialize)) { processBinaryMeta(ctx, qryEntity, desc); -typeId = new QueryTypeIdKey(cacheName, ctx.cacheObjects().typeId(qryEntity.findValueType())); +typeId = new QueryTypeIdKey(cacheName, valTypeId); if (valCls != null) altTypeId = new QueryTypeIdKey(cacheName, valCls); @@ -471,9 +473,11 @@ public class QueryUtils { } typeId = new QueryTypeIdKey(cacheName, valCls); -altTypeId = new QueryTypeIdKey(cacheName, ctx.cacheObjects().typeId(qryEntity.findValueType())); +altTypeId = new QueryTypeIdKey(cacheName, valTypeId); } +desc.typeId(valTypeId); + return new QueryTypeCandidate(typeId, altTypeId, desc); } http://git-wip-us.apache.org/repos/asf/ignite/blob/b3e6298a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java -- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java new file mode 100644 index 000..432f41f --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java @@ -0,0 +1,185 @@ +/* + * 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.database; + +import java.io.Serializable; +import java.util.List; +import java.util.UUID; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.configuration.PersistentStoreConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.ap
[47/50] ignite git commit: Web Console: Fixed logic on cluster lost.
Web Console: Fixed logic on cluster lost. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a2c8030 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a2c8030 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a2c8030 Branch: refs/heads/master Commit: 2a2c803039965e52ac5fc33be6cbccc5a27abd84 Parents: b3e6298 Author: Andrey Novikov Authored: Tue Jul 11 09:50:04 2017 +0700 Committer: Andrey Novikov Committed: Tue Jul 11 09:50:04 2017 +0700 -- modules/web-console/frontend/app/app.js | 2 + .../cluster-select/cluster-select.controller.js | 72 ++-- .../cluster-select/cluster-select.pug | 10 +-- .../frontend/app/filters/id8.filter.js | 20 ++ .../app/modules/agent/AgentManager.service.js | 4 +- .../views/templates/agent-download.tpl.pug | 4 +- 6 files changed, 68 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2a2c8030/modules/web-console/frontend/app/app.js -- diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js index 7b8196e..c707810 100644 --- a/modules/web-console/frontend/app/app.js +++ b/modules/web-console/frontend/app/app.js @@ -104,6 +104,7 @@ import domainsValidation from './filters/domainsValidation.filter'; import duration from './filters/duration.filter'; import hasPojo from './filters/hasPojo.filter'; import uiGridSubcategories from './filters/uiGridSubcategories.filter'; +import id8 from './filters/id8.filter'; // Controllers import profile from 'Controllers/profile-controller'; @@ -254,6 +255,7 @@ angular .filter('duration', duration) .filter('hasPojo', hasPojo) .filter('uiGridSubcategories', uiGridSubcategories) +.filter('id8', id8) .config(['$translateProvider', '$stateProvider', '$locationProvider', '$urlRouterProvider', ($translateProvider, $stateProvider, $locationProvider, $urlRouterProvider) => { $translateProvider.translations('en', i18n); $translateProvider.preferredLanguage('en'); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a2c8030/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js -- diff --git a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js index 6d30e94..a2d8e1e 100644 --- a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js +++ b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js @@ -15,52 +15,50 @@ * limitations under the License. */ -export default ['$scope', 'AgentManager', function($scope, agentMgr) { -const ctrl = this; +export default class { +static $inject = ['AgentManager']; -ctrl.counter = 1; +constructor(agentMgr) { +const ctrl = this; -ctrl.cluster = null; -ctrl.clusters = []; +ctrl.counter = 1; -agentMgr.connectionSbj.subscribe({ -next: ({cluster, clusters}) => { -if (_.isEmpty(clusters)) -return ctrl.clusters.length = 0; +ctrl.cluster = null; +ctrl.clusters = []; -const removed = _.differenceBy(ctrl.clusters, clusters, 'id'); +agentMgr.connectionSbj.subscribe({ +next: ({cluster, clusters}) => { +if (_.isEmpty(clusters)) +return ctrl.clusters.length = 0; -if (_.nonEmpty(removed)) -_.pullAll(ctrl.clusters, removed); +const removed = _.differenceBy(ctrl.clusters, clusters, 'id'); -const added = _.differenceBy(clusters, ctrl.clusters, 'id'); +if (_.nonEmpty(removed)) +_.pullAll(ctrl.clusters, removed); -_.forEach(added, (cluster) => { -ctrl.clusters.push({ -id: cluster.id, -name: `Cluster ${cluster.id.substring(0, 8).toUpperCase()}`, -connected: true, -click: () => { -if (cluster.id === _.get(ctrl, 'cluster.id')) -return; +const added = _.differenceBy(clusters, ctrl.clusters, 'id'); -if (_.get(ctrl, 'cluster.connected')) { -agentMgr.saveToStorage(cluster); +_.forEach(added, (cluster) => { +ctrl.clusters.push({ +id: cluster.id, +connected: true, +click: () => { +if (clu
[19/50] ignite git commit: Fixed cache plugin validation.
Fixed cache plugin validation. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3314a451 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3314a451 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3314a451 Branch: refs/heads/master Commit: 3314a4513c816c027dad80258ded1fe5a4c2b700 Parents: 3c88737 Author: sboikov Authored: Fri Jul 7 17:28:47 2017 +0300 Committer: sboikov Committed: Fri Jul 7 17:28:47 2017 +0300 -- .../processors/cache/ClusterCachesInfo.java | 30 +++- .../cache/DynamicCacheDescriptor.java | 13 - 2 files changed, 29 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 738e4ac..949bc19 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.CacheExistsException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; +import org.apache.ignite.internal.GridCachePluginContext; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; @@ -53,6 +54,9 @@ import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.plugin.CachePluginContext; +import org.apache.ignite.plugin.CachePluginProvider; +import org.apache.ignite.plugin.PluginProvider; import org.apache.ignite.spi.discovery.DiscoveryDataBag; import org.jetbrains.annotations.Nullable; @@ -175,8 +179,32 @@ class ClusterCachesInfo { locCacheInfo.cacheData().config().getName()); } -if (checkConsistency) +if (checkConsistency) { checkCache(locCacheInfo, cacheData, cacheData.receivedFrom()); + +ClusterNode rmt = ctx.discovery().node(cacheData.receivedFrom()); + +if (rmt == null) { +for (ClusterNode node : ctx.discovery().localJoin().discoCache().serverNodes()) { +if (!node.isLocal() && ctx.discovery().cacheAffinityNode(node, locCfg.getName())) { +rmt = node; + +break; +} +} +} + +if (rmt != null) { +for (PluginProvider p : ctx.plugins().allProviders()) { +CachePluginContext pluginCtx = new GridCachePluginContext(ctx, locCfg); + +CachePluginProvider provider = p.createCacheProvider(pluginCtx); + +if (provider != null) +provider.validateRemote(locCfg, cacheData.cacheConfiguration(), rmt); +} +} +} } if (checkConsistency) http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java index 315013d..18abcd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java @@ -24,7 +24,6 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
[16/50] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/55a5ca01 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/55a5ca01 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/55a5ca01 Branch: refs/heads/master Commit: 55a5ca019db7d06aab2fb567dbc0da1f133d0fb7 Parents: a1cac1b 0d6fb1a Author: sboikov Authored: Fri Jul 7 15:55:38 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:55:38 2017 +0300 -- .../internal/processors/query/h2/database/InlineIndexHelper.java | 2 +- .../processors/query/h2/database/InlineIndexHelperTest.java | 4 2 files changed, 5 insertions(+), 1 deletion(-) --
[15/50] ignite git commit: Removed unused method GridDhtPartitionTopology.checkEvictions().
Removed unused method GridDhtPartitionTopology.checkEvictions(). Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a1cac1b7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a1cac1b7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a1cac1b7 Branch: refs/heads/master Commit: a1cac1b7cc1c3afdcc12afb08bf1ecdcb6f28828 Parents: ea4420e Author: sboikov Authored: Fri Jul 7 15:55:18 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:55:18 2017 +0300 -- .../dht/GridClientPartitionTopology.java| 5 --- .../dht/GridDhtPartitionTopology.java | 7 ++-- .../dht/GridDhtPartitionTopologyImpl.java | 36 3 files changed, 2 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index 9e9f4fb..e751961 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -828,11 +828,6 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { return Collections.emptyList(); } -/** {@inheritDoc} */ -@Override public void checkEvictions() { -// No-op. -} - /** * Updates value for single partition. * http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java index bf4e844..5f76d12 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java @@ -280,11 +280,6 @@ public interface GridDhtPartitionTopology { public Collection lostPartitions(); /** - * - */ -public void checkEvictions(); - -/** * @param skipZeros If {@code true} then filters out zero counters. * @return Partition update counters. */ @@ -324,6 +319,7 @@ public interface GridDhtPartitionTopology { /** * Make nodes from provided set owners for a given partition. * State of all current owners that aren't contained in the set will be reset to MOVING. + * * @param p Partition ID. * @param updateSeq If should increment sequence when updated. * @param owners Set of new owners. @@ -333,6 +329,7 @@ public interface GridDhtPartitionTopology { /** * Callback on exchange done. + * * @param assignment New affinity assignment. */ public void onExchangeDone(AffinityAssignment assignment); http://git-wip-us.apache.org/repos/asf/ignite/blob/a1cac1b7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index f49dccf..cf0dd5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -1745,42 +1745,6 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { /** * @param updateSeq Update sequence. - * @return {@code True} if state changed. - */ -private boolean checkEvictions(long updateSeq) { -AffinityTopologyVersion affVer = grp.affinity().lastVersion(); - -boolean changed = false; - -if (!affVer.equals(AffinityTopologyVersion.NONE) && affVer.compareTo(to
[48/50] ignite git commit: IGNITE-5684 - Fixed update sequence handling in GridDhtPartitionFullMap
IGNITE-5684 - Fixed update sequence handling in GridDhtPartitionFullMap Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f3b69c7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f3b69c7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f3b69c7 Branch: refs/heads/master Commit: 4f3b69c7018913618e7bbc724ab83ac6c274bc1f Parents: 2a2c803 Author: Pavel Kovalenko Authored: Tue Jul 11 11:27:57 2017 +0300 Committer: Alexey Goncharuk Committed: Tue Jul 11 11:27:57 2017 +0300 -- .../dht/GridClientPartitionTopology.java| 71 +--- .../dht/GridDhtPartitionTopologyImpl.java | 27 +--- .../dht/preloader/GridDhtPartitionFullMap.java | 24 +-- .../CacheLateAffinityAssignmentTest.java| 2 +- 4 files changed, 67 insertions(+), 57 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/4f3b69c7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index e751961..f4ed517 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -572,56 +572,66 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology { } } +/** + * Checks should current partition map overwritten by new partition map + * Method returns true if topology version or update sequence of new map are greater than of current map. + * + * @param currentMap Current partition map. + * @param newMap New partition map. + * @return True if current partition map should be overwritten by new partition map, false in other case. + */ +private boolean shouldOverridePartitionMap(GridDhtPartitionMap currentMap, GridDhtPartitionMap newMap) { +return newMap != null && +(newMap.topologyVersion().compareTo(currentMap.topologyVersion()) > 0 || + newMap.topologyVersion().compareTo(currentMap.topologyVersion()) == 0 && newMap.updateSequence() > currentMap.updateSequence()); +} + /** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) @Override public boolean update( -@Nullable AffinityTopologyVersion exchVer, +@Nullable AffinityTopologyVersion exchangeVer, GridDhtPartitionFullMap partMap, Map> cntrMap, Set partsToReload ) { if (log.isDebugEnabled()) -log.debug("Updating full partition map [exchVer=" + exchVer + ", parts=" + fullMapString() + ']'); +log.debug("Updating full partition map [exchVer=" + exchangeVer + ", parts=" + fullMapString() + ']'); lock.writeLock().lock(); try { -if (exchVer != null && lastExchangeVer != null && lastExchangeVer.compareTo(exchVer) >= 0) { +if (exchangeVer != null && lastExchangeVer != null && lastExchangeVer.compareTo(exchangeVer) >= 0) { if (log.isDebugEnabled()) log.debug("Stale exchange id for full partition map update (will ignore) [lastExchId=" + -lastExchangeVer + ", exchVer=" + exchVer + ']'); - -return false; -} - -if (node2part != null && node2part.compareTo(partMap) >= 0) { -if (log.isDebugEnabled()) -log.debug("Stale partition map for full partition map update (will ignore) [lastExchId=" + -lastExchangeVer + ", exchVer=" + exchVer + ", curMap=" + node2part + ", newMap=" + partMap + ']'); +lastExchangeVer + ", exchVer=" + exchangeVer + ']'); return false; } -updateSeq.incrementAndGet(); - -if (exchVer != null) -lastExchangeVer = exchVer; +boolean fullMapUpdated = (node2part == null); if (node2part != null) { for (GridDhtPartitionMap part : node2part.values()) { GridDhtPartitionMap newPart = partMap.get(part.nodeId()); -// If for some nodes current partition has a newer map, -// then we keep the newer value. -if (newPart != null && newPart.updateSequence() < part.updateSequence()) { -
[09/50] ignite git commit: IGNITE-5159: DDL example. This closes #2227.
IGNITE-5159: DDL example. This closes #2227. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a5390b1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a5390b1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a5390b1 Branch: refs/heads/master Commit: 2a5390b1c083819f059e449b34a5979ec35b7755 Parents: 99fd75d Author: Alexander Paschenko Authored: Fri Jul 7 15:01:43 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:01:43 2017 +0300 -- .../examples/datagrid/CacheQueryDdlExample.java | 119 +++ .../ignite/examples/CacheExamplesSelfTest.java | 8 ++ 2 files changed, 127 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2a5390b1/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java new file mode 100644 index 000..84a67cd --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.examples.datagrid; + +import java.util.List; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.Ignition; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.examples.ExampleNodeStartup; + +/** + * Example to showcase DDL capabilities of Ignite's SQL engine. + * + * Remote nodes could be started from command line as follows: + * {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}. + * + * Alternatively you can run {@link ExampleNodeStartup} in either same or another JVM. + */ +public class CacheQueryDdlExample { +/** Dummy cache name. */ +private static final String DUMMY_CACHE_NAME = "dummy_cache"; + +/** + * Executes example. + * + * @param args Command line arguments, none required. + * @throws Exception If example execution failed. + */ +@SuppressWarnings({"unused", "ThrowFromFinallyBlock"}) +public static void main(String[] args) throws Exception { +try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { +print("Cache query DDL example started."); + +// Create dummy cache to act as an entry point for SQL queries (new SQL API which do not require this +// will appear in future versions, JDBC and ODBC drivers do not require it already). +CacheConfiguration cacheCfg = new CacheConfiguration<>(DUMMY_CACHE_NAME) +.setSqlSchema("PUBLIC").setIndexedTypes(Integer.class, Integer.class); + +try ( +IgniteCache cache = ignite.getOrCreateCache(cacheCfg) +) { +// Create table based on PARTITIONED template with one backup. +cache.query(new SqlFieldsQuery( +"CREATE TABLE person (id LONG PRIMARY KEY, name VARCHAR, city_id LONG) " + +"WITH \"backups=1\"")).getAll(); + +// Create reference City table based on REPLICATED template. +cache.query(new SqlFieldsQuery( +"CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=replicated\"")).getAll(); + +// Create an index. +cache.query(new SqlFieldsQuery("CREATE INDEX on Person (city_id)")).getAll(); + +print("Created database objects."); + +SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); + +cache.query(qry.setArgs(1L, "John Doe", 3L)).getAll(); +cache.query(qry.setArgs(2L, "Jane Roe", 2L)).getAll(); +cache.query(qry.setArgs(3L, "Ma
[17/50] ignite git commit: IGNITE-5204: SQL: fixed incorrect partition calculation in case of unicast optimization, when WHERE clause argument type was different from key or affinity key type. This cl
IGNITE-5204: SQL: fixed incorrect partition calculation in case of unicast optimization, when WHERE clause argument type was different from key or affinity key type. This close #2107. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99713fee Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99713fee Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99713fee Branch: refs/heads/master Commit: 99713feea764fc8c3e5b247a24698a2c04d3bcf4 Parents: 55a5ca0 Author: Sergey Kalashnikov Authored: Fri Jul 7 16:30:37 2017 +0300 Committer: devozerov Committed: Fri Jul 7 16:30:37 2017 +0300 -- .../cache/query/CacheQueryPartitionInfo.java| 46 +++- .../query/h2/DmlStatementsProcessor.java| 9 +- .../internal/processors/query/h2/H2Utils.java | 27 +++ .../processors/query/h2/IgniteH2Indexing.java | 30 ++- .../query/h2/sql/GridSqlQuerySplitter.java | 5 +- .../processors/query/IgniteSqlRoutingTest.java | 211 +-- 6 files changed, 290 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/99713fee/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java index 1329d5c..42bf070 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryPartitionInfo.java @@ -39,22 +39,35 @@ import org.apache.ignite.internal.util.typedef.internal.S; */ public class CacheQueryPartitionInfo { /** */ -private int partId; +private final int partId; /** */ -private String cacheName; +private final String cacheName; /** */ -private int paramIdx; +private final String tableName; + +/** */ +private final int dataType; + +/** */ +private final int paramIdx; /** * @param partId Partition id, or -1 if parameter binding required. * @param cacheName Cache name required for partition calculation. + * @param tableName Table name required for proper type conversion. + * @param dataType Required data type id for the query parameter. * @param paramIdx Query parameter index required for partition calculation. */ -public CacheQueryPartitionInfo(int partId, String cacheName, int paramIdx) { +public CacheQueryPartitionInfo(int partId, String cacheName, String tableName, int dataType, int paramIdx) { +// In case partition is not known, both cacheName and tableName must be provided. +assert (partId >= 0) ^ ((cacheName != null) && (tableName != null)); + this.partId = partId; this.cacheName = cacheName; +this.tableName = tableName; +this.dataType = dataType; this.paramIdx = paramIdx; } @@ -73,6 +86,20 @@ public class CacheQueryPartitionInfo { } /** + * @return Table name. + */ +public String tableName() { +return tableName; +} + +/** + * @return Required data type for the query parameter. + */ +public int dataType() { +return dataType; +} + +/** * @return Query parameter index required for partition calculation. */ public int paramIdx() { @@ -81,7 +108,9 @@ public class CacheQueryPartitionInfo { /** {@inheritDoc} */ @Override public int hashCode() { -return partId ^ paramIdx ^ (cacheName == null ? 0 : cacheName.hashCode()); +return partId ^ dataType ^ paramIdx ^ +(cacheName == null ? 0 : cacheName.hashCode()) ^ +(tableName == null ? 0 : tableName.hashCode()); } /** {@inheritDoc} */ @@ -97,10 +126,13 @@ public class CacheQueryPartitionInfo { if (partId >= 0) return partId == other.partId; -if (other.cacheName == null) +if (other.cacheName == null || other.tableName == null) return false; -return other.cacheName.equals(cacheName) && other.paramIdx == paramIdx; +return other.cacheName.equals(cacheName) && +other.tableName.equals(tableName) && +other.dataType == dataType && +other.paramIdx == paramIdx; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/99713fee/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java -
[35/50] ignite git commit: GG-12418 - WAL hangs on any error during segment rollover
http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java index 06bcf08..ca54e6f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java @@ -39,11 +39,12 @@ import org.apache.ignite.configuration.PersistentStoreConfiguration; import org.apache.ignite.configuration.WALMode; import org.apache.ignite.events.Event; import org.apache.ignite.events.EventType; +import org.apache.ignite.events.WalSegmentArchivedEvent; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.pagemem.wal.WALPointer; import org.apache.ignite.internal.pagemem.wal.record.WALRecord; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager; -import org.apache.ignite.events.WalSegmentArchivedEvent; import org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; @@ -177,7 +178,9 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest { final File wal = new File(db, "wal"); final File walArchive = new File(wal, "archive"); final String consistentId = "127_0_0_1_47500"; -final MockWalIteratorFactory mockItFactory = new MockWalIteratorFactory(log, PAGE_SIZE, consistentId, WAL_SEGMENTS); + +final FileIOFactory fileIOFactory = getConfiguration("").getPersistentStoreConfiguration().getFileIOFactory(); +final MockWalIteratorFactory mockItFactory = new MockWalIteratorFactory(log, fileIOFactory, PAGE_SIZE, consistentId, WAL_SEGMENTS); final WALIterator it = mockItFactory.iterator(wal, walArchive); final int cntUsingMockIter = iterateAndCount(it); @@ -188,7 +191,7 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest { final File walArchiveDirWithConsistentId = new File(walArchive, consistentId); final File walWorkDirWithConsistentId = new File(wal, consistentId); -final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(log, PAGE_SIZE); +final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(log, fileIOFactory, PAGE_SIZE); final int cntArchiveDir = iterateAndCount(factory.iteratorArchiveDirectory(walArchiveDirWithConsistentId)); log.info("Total records loaded using directory : " + cntArchiveDir); http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java index 95079a0..ef162d2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/MockWalIteratorFactory.java @@ -28,6 +28,7 @@ import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; import org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager; import org.jetbrains.annotations.Nullable; import org.mockito.Mockito; @@ -42,6 +43,9 @@ public class MockWalIteratorFactory { /** Logger. */ private final IgniteLogger log; +/** */ +private final FileIOFactory ioFactory; + /** Page size. */ private final int pageSize; @@ -58,8 +62,9 @@ public class MockWalIteratorFactory { * @param consistentId Consistent id. * @param segments Segments. */ -public MockWalIteratorFactory(@Nullable IgniteLogger log
[04/50] ignite git commit: ignite-2.1 Added map with previous snapshots.
ignite-2.1 Added map with previous snapshots. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/30922ed8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/30922ed8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/30922ed8 Branch: refs/heads/master Commit: 30922ed8ac518749a2559aff51fe183a890041bb Parents: f589628 Author: Alexey Kuznetsov Authored: Fri Jul 7 18:03:18 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 18:03:18 2017 +0700 -- .../pagemem/snapshot/SnapshotOperation.java| 17 - 1 file changed, 16 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/30922ed8/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java index 863107a..fa18cd7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/SnapshotOperation.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.pagemem.snapshot; import java.io.File; import java.io.Serializable; import java.util.Collection; +import java.util.Map; import java.util.Set; /** @@ -50,6 +51,9 @@ public class SnapshotOperation implements Serializable { /** Optional list of dependent snapshot IDs. */ private final Set dependentSnapshotIds; +/** Optional map of previous snapshots grouped by caches. */ +private final Map> prevSnapshots; + /** * @param type Type. * @param snapshotId Snapshot id. @@ -58,6 +62,7 @@ public class SnapshotOperation implements Serializable { * @param msg Extra user message. * @param extraParam Additional parameter. * @param dependentSnapshotIds Optional list of dependent snapshot IDs. + * @param prevSnapshots Optional map of previous snapshots grouped by caches. */ public SnapshotOperation( SnapshotOperationType type, @@ -66,7 +71,8 @@ public class SnapshotOperation implements Serializable { Set cacheNames, String msg, Object extraParam, -Set dependentSnapshotIds +Set dependentSnapshotIds, +Map> prevSnapshots ) { this.type = type; this.snapshotId = snapshotId; @@ -75,6 +81,7 @@ public class SnapshotOperation implements Serializable { this.msg = msg; this.extraParam = extraParam; this.dependentSnapshotIds = dependentSnapshotIds; +this.prevSnapshots = prevSnapshots; } /** @@ -131,6 +138,13 @@ public class SnapshotOperation implements Serializable { } /** + * @return Cache names grouped by previous snapshot IDs. + */ +public Map> previousSnapshots() { +return prevSnapshots; +} + +/** * @param op Op. */ public static Collection getOptionalPathsParameter(SnapshotOperation op) { @@ -215,6 +229,7 @@ public class SnapshotOperation implements Serializable { ", msg='" + msg + '\'' + ", extraParam=" + extraParam + ", dependentSnapshotIds=" + dependentSnapshotIds + +", prevSnapshots=" + prevSnapshots + '}'; } }
[07/50] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/984ab5bd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/984ab5bd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/984ab5bd Branch: refs/heads/master Commit: 984ab5bd3c08b2af9222964451acc281b92814b8 Parents: 4fc8124 99fd75d Author: sboikov Authored: Fri Jul 7 14:43:50 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:43:50 2017 +0300 -- .../pagemem/snapshot/SnapshotOperation.java | 17 +- .../cache/CacheAffinitySharedManager.java | 10 ++-- .../processors/cache/ClusterCachesInfo.java | 2 +- .../processors/cache/ExchangeActions.java | 34 ++-- .../processors/cache/GridCacheProcessor.java| 2 +- .../GridDhtPartitionsExchangeFuture.java| 2 +- .../IgniteChangeGlobalStateFailOverTest.java| 56 +--- .../query/h2/DmlStatementsProcessor.java| 19 +++ .../processors/query/h2/H2DatabaseType.java | 10 .../processors/query/h2/H2RowDescriptor.java| 13 + 10 files changed, 120 insertions(+), 45 deletions(-) --
[22/50] ignite git commit: ignite-2.1 Minor.
ignite-2.1 Minor. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e5c2ec5a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e5c2ec5a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e5c2ec5a Branch: refs/heads/master Commit: e5c2ec5a62c0d5fc268275ea9277f6933a582966 Parents: 993f7fb Author: Alexey Kuznetsov Authored: Fri Jul 7 23:06:52 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 23:06:52 2017 +0700 -- .../ignite/internal/visor/cache/VisorCacheMetrics.java | 12 ++-- .../visor/node/VisorMemoryPolicyConfiguration.java | 11 ++- .../src/main/resources/META-INF/classnames.properties | 11 +-- 3 files changed, 13 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c2ec5a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java index d99e0c9..5d8bc81 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java @@ -639,11 +639,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { } /** {@inheritDoc} */ -@Override public byte getProtocolVersion() { -return V2; -} - -/** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeString(out, name); U.writeEnum(out, mode); @@ -690,6 +685,7 @@ public class VisorCacheMetrics extends VisorDataTransferObject { out.writeLong(heapEntriesCnt); out.writeLong(offHeapAllocatedSize); out.writeLong(offHeapEntriesCnt); +out.writeLong(offHeapPrimaryEntriesCnt); out.writeInt(totalPartsCnt); out.writeInt(rebalancingPartsCnt); @@ -698,8 +694,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { out.writeLong(rebalancingBytesRate); out.writeObject(qryMetrics); - -out.writeLong(offHeapPrimaryEntriesCnt); } /** {@inheritDoc} */ @@ -748,6 +742,7 @@ public class VisorCacheMetrics extends VisorDataTransferObject { heapEntriesCnt = in.readLong(); offHeapAllocatedSize = in.readLong(); offHeapEntriesCnt = in.readLong(); +offHeapPrimaryEntriesCnt = in.readLong(); totalPartsCnt = in.readInt(); rebalancingPartsCnt = in.readInt(); @@ -756,9 +751,6 @@ public class VisorCacheMetrics extends VisorDataTransferObject { rebalancingBytesRate = in.readLong(); qryMetrics = (VisorQueryMetrics)in.readObject(); - -if (protoVer >= V2) -offHeapPrimaryEntriesCnt = in.readLong(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c2ec5a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java index d3153a6..bed4c4b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java @@ -131,32 +131,25 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject { } /** {@inheritDoc} */ -@Override public byte getProtocolVersion() { -return V2; -} - -/** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeString(out, name); +out.writeLong(initSize); out.writeLong(maxSize); U.writeString(out, swapFilePath); U.writeEnum(out, pageEvictionMode); out.writeDouble(evictionThreshold); out.writeInt(emptyPagesPoolSize); -out.writeLong(initSize); } /** {@inheritDoc} */ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException { name = U.readString(in); +initSize = in.readLong(); maxSize = in.readLong(); swapFilePath = U.readString(in); pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte()); evictionThreshold = in.readDouble();
[11/50] ignite git commit: IGNITE-5717 .NET: Reduce MemoryPolicyConfiguration.MaxSize for persistence tests as a workaround for OOM on default settings
IGNITE-5717 .NET: Reduce MemoryPolicyConfiguration.MaxSize for persistence tests as a workaround for OOM on default settings Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9387ade Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9387ade Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9387ade Branch: refs/heads/master Commit: a9387adef490086406b05fe961ff0f3151045caa Parents: d232648 Author: Pavel Tupitsyn Authored: Fri Jul 7 15:21:20 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 15:21:20 2017 +0300 -- .../Cache/PersistentStoreTest.cs| 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a9387ade/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs index 96ae47c..e9cbce8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PersistentStoreTest.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Tests.Cache { using System.IO; +using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.PersistentStore; @@ -51,7 +52,7 @@ namespace Apache.Ignite.Core.Tests.Cache [Test] public void TestCacheDataSurvivesNodeRestart() { -var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration()) +var cfg = new IgniteConfiguration(GetTestConfiguration()) { PersistentStoreConfiguration = new PersistentStoreConfiguration { @@ -106,7 +107,7 @@ namespace Apache.Ignite.Core.Tests.Cache [Test] public void TestGridActivationWithPersistence() { -var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration()) +var cfg = new IgniteConfiguration(GetTestConfiguration()) { PersistentStoreConfiguration = new PersistentStoreConfiguration() }; @@ -177,5 +178,36 @@ namespace Apache.Ignite.Core.Tests.Cache ex.Message.Substring(0, 62)); } } + +/// +/// Gets the test configuration. +/// +private static IgniteConfiguration GetTestConfiguration() +{ +return new IgniteConfiguration(TestUtils.GetTestConfiguration()) +{ +MemoryConfiguration = GetMemoryConfig() +}; +} + +/// +/// Gets the memory configuration with reduced MaxMemory to work around persistence bug. +/// +private static MemoryConfiguration GetMemoryConfig() +{ +// TODO: Remove this method and use default config (IGNITE-5717). +return new MemoryConfiguration +{ +MemoryPolicies = new[] +{ +new MemoryPolicyConfiguration +{ +Name = MemoryConfiguration.DefaultDefaultMemoryPolicyName, +InitialSize = 512*1024*1024, +MaxSize = 512*1024*1024 +} +} +}; +} } }
[27/50] ignite git commit: GG-12466 - Clean up public API for snapshots
GG-12466 - Clean up public API for snapshots Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/36716fb1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/36716fb1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/36716fb1 Branch: refs/heads/master Commit: 36716fb1f4de5d1f5baab1e27afc95583dd4c7b4 Parents: 17904cb Author: Pavel Kovalenko Authored: Mon Jul 10 11:09:43 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 11:10:41 2017 +0300 -- ...ishSnapshotOperationAckDiscoveryMessage.java | 84 --- .../snapshot/SnapshotCheckParameters.java | 75 -- .../pagemem/snapshot/SnapshotOperation.java | 235 --- .../pagemem/snapshot/SnapshotOperationType.java | 49 ...artSnapshotOperationAckDiscoveryMessage.java | 149 .../StartSnapshotOperationDiscoveryMessage.java | 192 --- .../GridCachePartitionExchangeManager.java | 9 +- .../processors/cache/GridCacheProcessor.java| 22 +- .../cache/GridCacheSharedContext.java | 6 +- .../dht/GridDhtPartitionTopologyImpl.java | 8 +- .../GridDhtPartitionsExchangeFuture.java| 54 ++--- .../GridCacheDatabaseSharedManager.java | 3 +- .../persistence/IgniteCacheSnapshotManager.java | 150 .../persistence/file/FilePageStoreManager.java | 2 +- .../snapshot/IgniteCacheSnapshotManager.java| 161 + .../snapshot/SnapshotDiscoveryMessage.java | 33 +++ .../persistence/snapshot/SnapshotOperation.java | 44 .../resources/META-INF/classnames.properties| 5 - .../loadtests/hashmap/GridCacheTestContext.java | 6 +- 19 files changed, 281 insertions(+), 1006 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/36716fb1/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java deleted file mode 100644 index f6758e0..000 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/snapshot/FinishSnapshotOperationAckDiscoveryMessage.java +++ /dev/null @@ -1,84 +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.pagemem.snapshot; - -import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.lang.IgniteUuid; -import org.jetbrains.annotations.Nullable; - -/** - * - */ -public class FinishSnapshotOperationAckDiscoveryMessage implements DiscoveryCustomMessage { -/** */ -private static final long serialVersionUID = 0L; - -/** Id. */ -private final IgniteUuid id = IgniteUuid.randomUuid(); - -/** Op id. */ -private final IgniteUuid opId; - -/** Success. */ -private final boolean success; - -/** - * @param opId Op id. - * @param success Success. - */ -public FinishSnapshotOperationAckDiscoveryMessage(IgniteUuid opId, boolean success) { -this.opId = opId; -this.success = success; -} - -/** {@inheritDoc} */ -@Override public IgniteUuid id() { -return id; -} - -/** {@inheritDoc} */ -@Nullable @Override public DiscoveryCustomMessage ackMessage() { -return null; -} - -/** {@inheritDoc} */ -@Override public boolean isMutable() { -return false; -} - -/** - * @return Op id. - */ -public IgniteUuid operationId() { -return opId; -} - -/** - * @return Success. - */ -public boolean success() { -return success; -} - -/** {@inheritDoc} */ -@Override public String toString() { -return S.toString(FinishSnapshotOper
[23/50] ignite git commit: IGNITE-5369 Added support for _key and _val names on QueryEntity XML and code generation.
IGNITE-5369 Added support for _key and _val names on QueryEntity XML and code generation. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eb37f538 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eb37f538 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eb37f538 Branch: refs/heads/master Commit: eb37f538f55a471258e49ee2fbf0e8f234829def Parents: e5c2ec5 Author: vsisko Authored: Fri Jul 7 23:22:59 2017 +0700 Committer: Alexey Kuznetsov Committed: Fri Jul 7 23:22:59 2017 +0700 -- .../internal/visor/query/VisorQueryEntity.java | 32 +-- modules/web-console/backend/app/mongo.js| 2 ++ .../generator/AbstractTransformer.js| 4 +-- .../generator/ConfigurationGenerator.js | 33 +++- .../states/configuration/domains/query.pug | 9 ++ .../frontend/controllers/domains-controller.js | 7 +++-- 6 files changed, 73 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java index 9f4dfe7..c67918a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryEntity.java @@ -58,6 +58,12 @@ public class VisorQueryEntity extends VisorDataTransferObject { /** Table name. */ private String tblName; +/** Key name. Can be used in field list to denote the key as a whole. */ +private String keyFieldName; + +/** Value name. Can be used in field list to denote the entire value. */ +private String valFieldName; + /** Fields to create group indexes for. */ private List grps; @@ -108,6 +114,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { for (QueryIndex qryIdx : qryIdxs) grps.add(new VisorQueryIndex(qryIdx)); + +tblName = q.getTableName(); +keyFieldName = q.getKeyFieldName(); +valFieldName = q.getValueFieldName(); } /** @@ -153,6 +163,20 @@ public class VisorQueryEntity extends VisorDataTransferObject { } /** + * @return Key name. Can be used in field list to denote the key as a whole. + */ +public String getKeyFieldName() { +return keyFieldName; +} + +/** + * @return Value name. Can be used in field list to denote the entire value. + */ +public String getValueFieldName() { +return valFieldName; +} + +/** * @return Fields to create group indexes for. */ public List getGroups() { @@ -166,8 +190,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { U.writeCollection(out, keyFields); IgfsUtils.writeStringMap(out, qryFlds); U.writeMap(out, aliases); -U.writeString(out, tblName); U.writeCollection(out, grps); +U.writeString(out, tblName); +U.writeString(out, keyFieldName); +U.writeString(out, valFieldName); } /** {@inheritDoc} */ @@ -177,8 +203,10 @@ public class VisorQueryEntity extends VisorDataTransferObject { keyFields = U.readList(in); qryFlds = IgfsUtils.readStringMap(in); aliases = U.readMap(in); -tblName = U.readString(in); grps = U.readList(in); +tblName = U.readString(in); +keyFieldName = U.readString(in); +valFieldName = U.readString(in); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/web-console/backend/app/mongo.js -- diff --git a/modules/web-console/backend/app/mongo.js b/modules/web-console/backend/app/mongo.js index 32796e6..aa11e0b 100644 --- a/modules/web-console/backend/app/mongo.js +++ b/modules/web-console/backend/app/mongo.js @@ -106,6 +106,8 @@ module.exports.factory = function(passportMongo, settings, pluginMongo, mongoose queryMetadata: {type: String, enum: ['Annotations', 'Configuration']}, kind: {type: String, enum: ['query', 'store', 'both']}, tableName: String, +keyFieldName: String, +valueFieldName: String, databaseSchema: String, databaseTable: String, keyType: String, http://git-wip-us.apache.org/repos/asf/ignite/blob/eb37f538/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js ---
[08/50] ignite git commit: Fixed formatting.
Fixed formatting. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7adb1110 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7adb1110 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7adb1110 Branch: refs/heads/master Commit: 7adb11109bab5d83ed4f376b0cad42b026dd0a71 Parents: 984ab5b Author: sboikov Authored: Fri Jul 7 14:49:13 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:49:13 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 52 +--- 1 file changed, 34 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/7adb1110/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 320ef06..f49dccf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -444,23 +444,28 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { if (stopping) return; -GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + -topVer + ", exchId=" + exchId + ']'; +GridDhtPartitionExchangeId exchId = exchFut.exchangeId(); + +assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + topVer + +", exchId=" + exchId + ']'; if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent()) removeNode(exchId.nodeId()); ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache(); -if (log.isDebugEnabled()) -log.debug("Partition map beforeExchange [exchId=" + exchId + ", fullMap=" + fullMapString() + ']'); +if (log.isDebugEnabled()) { +log.debug("Partition map beforeExchange [exchId=" + exchId + +", fullMap=" + fullMapString() + ']'); +} long updateSeq = this.updateSeq.incrementAndGet(); cntrMap.clear(); -boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. +boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom()); +// If this is the oldest node. if (oldest != null && (loc.equals(oldest) || grpStarted)) { if (node2part == null) { node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); @@ -470,18 +475,28 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { exchId + ", fullMap=" + fullMapString() + ']'); } else if (!node2part.valid()) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); - -if (log.isDebugEnabled()) -log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" + -node2part + ']'); +node2part = new GridDhtPartitionFullMap(oldest.id(), +oldest.order(), +updateSeq, +node2part, +false); + +if (log.isDebugEnabled()) { +log.debug("Created new full topology map on oldest node [exchId=" + exchId + +", fullMap=" + node2part + ']'); +} } else if (!node2part.nodeId().equals(loc.id())) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false); - -if (log.isDebugEnabled()) -
[30/50] ignite git commit: Fixed NPE in setOwners.
Fixed NPE in setOwners. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0b9527e8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0b9527e8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0b9527e8 Branch: refs/heads/master Commit: 0b9527e851fd7c1d63bfc427721ca8af80d54b0c Parents: a535444 Author: sboikov Authored: Mon Jul 10 12:02:03 2017 +0300 Committer: sboikov Committed: Mon Jul 10 12:02:03 2017 +0300 -- .../cache/distributed/dht/GridDhtPartitionTopologyImpl.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/0b9527e8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 2f54810..7c62cca 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -1722,7 +1722,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + +"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + ", partId=" + locPart.id() + ", haveHistory=" + haveHistory + "]"); } @@ -1743,8 +1743,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + -", partId=" + locPart.id() + ", haveHistory=" + haveHistory + "]"); +"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + +", partId=" + p + ", haveHistory=" + haveHistory + "]"); } if (updateSeq)
[43/50] ignite git commit: IGNITE-2492 .NET: Peer assembly loading - add TestCacheGetOnRemoteNode
IGNITE-2492 .NET: Peer assembly loading - add TestCacheGetOnRemoteNode Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2ac39082 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2ac39082 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2ac39082 Branch: refs/heads/master Commit: 2ac39082c6aa660085ea94df121166920821b427 Parents: 92becc8 Author: Pavel Tupitsyn Authored: Mon Jul 10 17:05:08 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 17:05:08 2017 +0300 -- .../Apache.Ignite.Core.Tests.csproj | 1 + .../Deployment/CacheGetFunc.cs | 50 .../Deployment/PeerAssemblyLoadingTest.cs | 24 ++ 3 files changed, 75 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/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 d91f0e6..4787c4d 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 @@ -78,6 +78,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs new file mode 100644 index 000..2679130 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/CacheGetFunc.cs @@ -0,0 +1,50 @@ +/* + * 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. + */ + +namespace Apache.Ignite.Core.Tests.Deployment +{ +using Apache.Ignite.Core.Compute; +using Apache.Ignite.Core.Resource; + +/// +/// Function to get a value from cache. +/// +public class CacheGetFunc : IComputeFunc +{ +/// +/// Gets or sets the cache key. +/// +public TKey Key { get; set; } + +/// +/// Gets or sets the name of the cache. +/// +public string CacheName { get; set; } + +/// +/// Gets or sets the ignite. +/// +[InstanceResource] +public IIgnite Ignite { get;set; } + +/** */ +public TValue Invoke() +{ +return Ignite.GetCache(CacheName).Get(Key); +} +} +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2ac39082/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs index 8245333..da896dd 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Deployment/PeerAssemblyLoadingTest.cs @@ -131,6 +131,30 @@ namespace Apache.Ignite.Core.Tests.Deployment } /// +/// Tests the cache get operation on remote node. +/// +[Test] +public void TestCacheGetOnRemoteNode() +{ +TestDeployment(remoteCompute => +{ +var cache = remoteCompute.ClusterGroup.Ignite.GetOrCreateCache("addr"); +cache[1] = new Address("street", 123); + +// This will fail for func, because cache operations are not p2p-enabled. +// However, generic nature of the func causes Address to be peer-deployed bef
[12/50] ignite git commit: 2.1 Fixed assert (cacheName can be null here).
2.1 Fixed assert (cacheName can be null here). Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/13399d53 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/13399d53 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/13399d53 Branch: refs/heads/master Commit: 13399d530f3458c3bf59634857cb05f801e8cc34 Parents: d232648 Author: sboikov Authored: Fri Jul 7 15:24:09 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:24:09 2017 +0300 -- .../processors/datastructures/DataStructuresProcessor.java | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/13399d53/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 4399fe2..5564b79 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 @@ -326,12 +326,10 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen * @return {@code True} if cache with such name is used to store data structures. */ public static boolean isDataStructureCache(String cacheName) { -assert cacheName != null; - -return cacheName.startsWith(ATOMICS_CACHE_NAME) || +return cacheName != null && (cacheName.startsWith(ATOMICS_CACHE_NAME) || cacheName.startsWith(DS_CACHE_NAME_PREFIX) || cacheName.equals(DEFAULT_DS_GROUP_NAME) || -cacheName.equals(DEFAULT_VOLATILE_DS_GROUP_NAME); +cacheName.equals(DEFAULT_VOLATILE_DS_GROUP_NAME)); } /**
[21/50] ignite git commit: IGNITE-5701 - Some nodes have partitionUpdateCounter equal to 0 after rebalancing
IGNITE-5701 - Some nodes have partitionUpdateCounter equal to 0 after rebalancing Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/993f7fbe Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/993f7fbe Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/993f7fbe Branch: refs/heads/master Commit: 993f7fbe1d49a524e2dee626aef72e16fd5d3cda Parents: 517a23d Author: Ilya Lantukh Authored: Fri Jul 7 18:55:27 2017 +0300 Committer: Alexey Goncharuk Committed: Fri Jul 7 18:55:41 2017 +0300 -- .../apache/ignite/IgniteSystemProperties.java | 2 +- .../distributed/dht/GridDhtCacheEntry.java | 6 -- .../distributed/dht/GridDhtLocalPartition.java | 45 .../dht/GridDhtPartitionTopologyImpl.java | 16 - .../dht/preloader/GridDhtPartitionDemander.java | 5 +- .../dht/preloader/GridDhtPartitionSupplier.java | 2 +- .../GridDhtPartitionSupplyMessage.java | 20 +++--- .../GridCacheDatabaseSharedManager.java | 2 +- .../IgnitePdsCacheRebalancingAbstractTest.java | 74 .../wal/IgniteWalHistoryReservationsTest.java | 29 ++-- 10 files changed, 131 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 085712a..35b0577 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -626,7 +626,7 @@ public final class IgniteSystemProperties { /** * WAL rebalance threshold. */ - public static final String IGNITE_PDS_WAL_REBALANCE_THRESHOLD = "IGNITE_PDS_WAL_REBALANCE_THRESHOLD"; +public static final String IGNITE_PDS_WAL_REBALANCE_THRESHOLD = "IGNITE_PDS_WAL_REBALANCE_THRESHOLD"; /** Ignite page memory concurrency level. */ public static final String IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL = "IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL"; http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java index 57dd622..77cc642 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java @@ -123,12 +123,6 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry { } /** {@inheritDoc} */ -@Override protected void onUpdateFinished(long cntr) { -if (cctx.shared().database().persistenceEnabled()) -locPart.onUpdateReceived(cntr); -} - -/** {@inheritDoc} */ @Override public boolean isDht() { return true; } http://git-wip-us.apache.org/repos/asf/ignite/blob/993f7fbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java index 8e42351..725822d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java @@ -157,13 +157,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements @GridToStringExclude private final CacheDataStore store; -/** Partition updates. */ -@GridToStringExclude -private final ConcurrentNavigableMap updates = new ConcurrentSkipListMap<>(); - -/** Last applied update. */ -private final AtomicLong lastApplied = new AtomicLong(0); - /** Set if failed to move partition to RENTING state due to reservations, to be checked when * reservation is released. */ private volatile boolean shouldBeRenting; @@ -349,44 +342,6 @@ public class GridDhtLocalPartition extends Gri
[13/50] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ea4420e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ea4420e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ea4420e6 Branch: refs/heads/master Commit: ea4420e6aad509c4ae58d6d0880918c98fd1959a Parents: 13399d5 a9387ad Author: sboikov Authored: Fri Jul 7 15:24:26 2017 +0300 Committer: sboikov Committed: Fri Jul 7 15:24:26 2017 +0300 -- .../Cache/PersistentStoreTest.cs| 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) --
[38/50] ignite git commit: ignite-5075 Rename cacheId -> groupId
http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java index 665bb56..8fc2bdb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java @@ -74,7 +74,7 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public void read(int cacheId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { +@Override public void read(int grpId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException { } @@ -84,35 +84,35 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public void readHeader(int cacheId, int partId, ByteBuffer buf) throws IgniteCheckedException { +@Override public void readHeader(int grpId, int partId, ByteBuffer buf) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void write(int cacheId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { +@Override public void write(int grpId, long pageId, ByteBuffer pageBuf, int tag) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void sync(int cacheId, int partId) throws IgniteCheckedException { +@Override public void sync(int grpId, int partId) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public void ensure(int cacheId, int partId) throws IgniteCheckedException { +@Override public void ensure(int grpId, int partId) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ -@Override public long pageOffset(int cacheId, long pageId) throws IgniteCheckedException { +@Override public long pageOffset(int grpId, long pageId) throws IgniteCheckedException { return 0; } /** {@inheritDoc} */ -@Override public long allocatePage(int cacheId, int partId, byte flags) throws IgniteCheckedException { +@Override public long allocatePage(int grpId, int partId, byte flags) throws IgniteCheckedException { long root = PageIdUtils.pageId(partId, flags, 0); -FullPageId fullId = new FullPageId(root, cacheId); +FullPageId fullId = new FullPageId(root, grpId); AtomicInteger allocator = allocators.get(fullId); @@ -123,10 +123,10 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public int pages(int cacheId, int partId) throws IgniteCheckedException { +@Override public int pages(int grpId, int partId) throws IgniteCheckedException { long root = PageIdUtils.pageId(partId, (byte)0, 0); -FullPageId fullId = new FullPageId(root, cacheId); +FullPageId fullId = new FullPageId(root, grpId); AtomicInteger allocator = allocators.get(fullId); @@ -137,7 +137,7 @@ public class NoOpPageStoreManager implements IgnitePageStoreManager { } /** {@inheritDoc} */ -@Override public long metaPageId(int cacheId) { +@Override public long metaPageId(int grpId) { return 1; }
[06/50] ignite git commit: Fixed formatting.
Fixed formatting. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4fc8124d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4fc8124d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4fc8124d Branch: refs/heads/master Commit: 4fc8124d9538625cb0a95c918634b43ec1319bee Parents: ab52671 Author: sboikov Authored: Fri Jul 7 14:43:28 2017 +0300 Committer: sboikov Committed: Fri Jul 7 14:43:28 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 40 ++-- 1 file changed, 20 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/4fc8124d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 3e98b01..320ef06 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@ -440,18 +440,16 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { U.writeLock(lock); -try { - - -if (stopping) -return; +try { +if (stopping) +return; -GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + -topVer + ", exchId=" + exchId + ']'; +GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" + +topVer + ", exchId=" + exchId + ']'; if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent()) removeNode(exchId.nodeId()); - + ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache(); if (log.isDebugEnabled()) @@ -461,10 +459,11 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { cntrMap.clear(); -boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. -if (oldest != null && (loc.equals(oldest) || grpStarted)) { -if (node2part == null) { -node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); +boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node. + +if (oldest != null && (loc.equals(oldest) || grpStarted)) { +if (node2part == null) { +node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq); if (log.isDebugEnabled()) log.debug("Created brand new full topology map on oldest node [exchId=" + @@ -486,16 +485,17 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology { } } -if (grpStarted || -exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT || -exchFut.serverNodeDiscoveryEvent()) {if (affReady) -initPartitions0(exchFut, updateSeq); -else { -List> aff = grp.affinity().idealAssignment(); +if (grpStarted || +exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT || +exchFut.serverNodeDiscoveryEvent()) { +if (affReady) +initPartitions0(exchFut, updateSeq); +else { +List> aff = grp.affinity().idealAssignment(); -createPartitions(aff, updateSeq); +createPartitions(aff, updateSeq); +} } -} consistencyCheck();
[29/50] ignite git commit: IGNITE-5694 - Added retries for getCollection in DataStructuresProcessor - Fixes #2240.
IGNITE-5694 - Added retries for getCollection in DataStructuresProcessor - Fixes #2240. Signed-off-by: Alexey Goncharuk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17694c16 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17694c16 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17694c16 Branch: refs/heads/master Commit: 17694c16d449dea4d4e39a271dd39e838c581858 Parents: 36716fb Author: Ilya Lantukh Authored: Mon Jul 10 11:59:19 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 11:59:19 2017 +0300 -- .../processors/datastructures/DataStructuresProcessor.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17694c16/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 5564b79..33a2fd2 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 @@ -1031,7 +1031,11 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen } } -return c.applyx(cache.context()); +return retryTopologySafe(new IgniteOutClosureX() { +@Override public T applyx() throws IgniteCheckedException { +return c.applyx(cache.context()); +} +}); } /**
[18/50] ignite git commit: IGNITE-5582: Implemented Compute::Broadcast for C++
IGNITE-5582: Implemented Compute::Broadcast for C++ (cherry picked from commit fa974286e8f066a8d6aa57519edf5ec7761be095) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3c887378 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3c887378 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3c887378 Branch: refs/heads/master Commit: 3c887378eb64d2d236073410070082e5699e8334 Parents: 99713fe Author: Igor Sapego Authored: Fri Jul 7 16:52:31 2017 +0300 Committer: Igor Sapego Committed: Fri Jul 7 16:52:31 2017 +0300 -- .../cpp/core-test/src/compute_test.cpp | 91 ++- modules/platforms/cpp/core/include/Makefile.am | 2 + .../cpp/core/include/ignite/compute/compute.h | 66 + .../include/ignite/impl/compute/compute_impl.h | 161 +++ .../ignite/impl/compute/compute_job_result.h| 54 +++- .../ignite/impl/compute/compute_task_holder.h | 204 +- .../compute/multiple_job_compute_task_holder.h | 265 +++ .../compute/single_job_compute_task_holder.h| 212 +++ .../platforms/cpp/core/project/vs/core.vcxproj | 2 + .../cpp/core/project/vs/core.vcxproj.filters| 6 + 10 files changed, 811 insertions(+), 252 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/3c887378/modules/platforms/cpp/core-test/src/compute_test.cpp -- diff --git a/modules/platforms/cpp/core-test/src/compute_test.cpp b/modules/platforms/cpp/core-test/src/compute_test.cpp index 8c57ef1..1fd7670 100644 --- a/modules/platforms/cpp/core-test/src/compute_test.cpp +++ b/modules/platforms/cpp/core-test/src/compute_test.cpp @@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE(IgniteRunAsyncLocalError) BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); } -BOOST_AUTO_TEST_CASE(IgniteRunTestRemote) +BOOST_AUTO_TEST_CASE(IgniteRunRemote) { Ignite node2 = MakeNode("ComputeNode2"); Compute compute = node.GetCompute(); @@ -489,7 +489,7 @@ BOOST_AUTO_TEST_CASE(IgniteRunTestRemote) BOOST_CHECK_EQUAL(Func3::res, "42.24"); } -BOOST_AUTO_TEST_CASE(IgniteRunTestRemoteError) +BOOST_AUTO_TEST_CASE(IgniteRunRemoteError) { Ignite node2 = MakeNode("ComputeNode2"); Compute compute = node.GetCompute(); @@ -509,5 +509,92 @@ BOOST_AUTO_TEST_CASE(IgniteRunTestRemoteError) BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); } +BOOST_AUTO_TEST_CASE(IgniteBroadcastLocalSync) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting");; +std::vector res = compute.Broadcast(Func2(8, 5)); + +BOOST_CHECK_EQUAL(res.size(), 1); +BOOST_CHECK_EQUAL(res[0], "8.5"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastLocalAsync) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting");; +Future< std::vector > res = compute.BroadcastAsync(Func2(312, 245)); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +std::vector value = res.GetValue(); + +BOOST_CHECK_EQUAL(value.size(), 1); +BOOST_CHECK_EQUAL(value[0], "312.245"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastSyncLocalError) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); + +BOOST_CHECK_EXCEPTION(compute.Broadcast(Func2(MakeTestError())), IgniteError, IsTestError); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastAsyncLocalError) +{ +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +Future res = compute.BroadcastAsync(Func2(MakeTestError())); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastRemote) +{ +Ignite node2 = MakeNode("ComputeNode2"); +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +std::vector res = compute.Broadcast(Func2(8, 5)); + +BOOST_CHECK_EQUAL(res.size(), 2); +BOOST_CHECK_EQUAL(res[0], "8.5"); +BOOST_CHECK_EQUAL(res[1], "8.5"); +} + +BOOST_AUTO_TEST_CASE(IgniteBroadcastRemoteError) +{ +Ignite node2 = MakeNode("ComputeNode2"); +Compute compute = node.GetCompute(); + +BOOST_CHECKPOINT("Broadcasting"); +Future< std::vector > res = compute.BroadcastAsync(Func2(MakeTestError())); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECKPOINT("Waiting with timeout"); +res.WaitFor(100); + +BOOST_CHECK(!res.IsReady()); + +BOOST_CHECK_EXCEPTION(res.GetValue(), IgniteError, IsTestError); +} BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file http://git-wi
[28/50] ignite git commit: ignite-5446 Alway use late affinity assignment mode
ignite-5446 Alway use late affinity assignment mode Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a5354441 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5354441 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5354441 Branch: refs/heads/master Commit: a53544410dd15a3a5112d6de88648db21bd3fcf3 Parents: 17904cb Author: sboikov Authored: Mon Jul 10 11:38:04 2017 +0300 Committer: sboikov Committed: Mon Jul 10 11:38:04 2017 +0300 -- .../configuration/IgniteConfiguration.java | 15 +- .../affinity/AffinityHistoryCleanupTest.java| 182 --- ...idAbstractCacheInterceptorRebalanceTest.java | 2 - .../cache/GridCacheDeploymentSelfTest.java | 7 +- .../IgniteCacheP2pUnmarshallingTxErrorTest.java | 22 +-- ...ffinityAssignmentNodeJoinValidationTest.java | 46 + .../CacheLateAffinityAssignmentTest.java| 2 - ...CacheLoadingConcurrentGridStartSelfTest.java | 2 - ...idCachePartitionedPreloadEventsSelfTest.java | 143 --- ...LateAffDisabledMultiNodeFullApiSelfTest.java | 35 ...LateAffDisabledMultiNodeFullApiSelfTest.java | 34 .../db/IgnitePdsWholeClusterRestartTest.java| 1 - .../GridActivationPartitionedCacheSuit.java | 2 - ...ContinuousQueryFailoverAbstractSelfTest.java | 2 - .../processors/igfs/IgfsStreamsSelfTest.java| 1 - .../IgniteCacheFullApiSelfTestSuite.java| 6 - .../testsuites/IgniteCacheTestSuite2.java | 2 - 17 files changed, 17 insertions(+), 487 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a5354441/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index ed05fa4..cafa675 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -191,6 +191,7 @@ public class IgniteConfiguration { public static final boolean DFLT_CACHE_SANITY_CHECK_ENABLED = true; /** Default value for late affinity assignment flag. */ +@Deprecated public static final boolean DFLT_LATE_AFF_ASSIGNMENT = true; /** Default value for active on start flag. */ @@ -452,9 +453,6 @@ public class IgniteConfiguration { /** Custom executor configurations. */ private ExecutorConfiguration[] execCfgs; -/** */ -private boolean lateAffAssignment = DFLT_LATE_AFF_ASSIGNMENT; - /** Page memory configuration. */ private MemoryConfiguration memCfg; @@ -530,7 +528,6 @@ public class IgniteConfiguration { igniteWorkDir = cfg.getWorkDirectory(); inclEvtTypes = cfg.getIncludeEventTypes(); includeProps = cfg.getIncludeProperties(); -lateAffAssignment = cfg.isLateAffinityAssignment(); lifecycleBeans = cfg.getLifecycleBeans(); locHost = cfg.getLocalHost(); log = cfg.getGridLogger(); @@ -2721,14 +2718,14 @@ public class IgniteConfiguration { * from assignment calculated by {@link AffinityFunction#assignPartitions}. * * This property should have the same value for all nodes in cluster. - * - * If not provided, default value is {@link #DFLT_LATE_AFF_ASSIGNMENT}. * * @return Late affinity assignment flag. * @see AffinityFunction + * @deprecated Starting from Ignite 2.1 late affinity assignment is always enabled. */ +@Deprecated public boolean isLateAffinityAssignment() { -return lateAffAssignment; +return true; } /** @@ -2736,10 +2733,10 @@ public class IgniteConfiguration { * * @param lateAffAssignment Late affinity assignment flag. * @return {@code this} for chaining. + * @deprecated Starting from Ignite 2.1 late affinity assignment is always enabled. */ +@Deprecated public IgniteConfiguration setLateAffinityAssignment(boolean lateAffAssignment) { -this.lateAffAssignment = lateAffAssignment; - return this; } http://git-wip-us.apache.org/repos/asf/ignite/blob/a5354441/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityHistoryCleanupTest.java index 87c2050..605cc5f 100644 --- a/modules/core/src/test/java/org/apache/ignite/ca
[49/50] ignite git commit: IGNITE-5686 Endless partition eviction during node shutdown
IGNITE-5686 Endless partition eviction during node shutdown Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a668a224 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a668a224 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a668a224 Branch: refs/heads/master Commit: a668a224a8c69afd618667fa19309f1b7a0c8ca3 Parents: 4f3b69c Author: Igor Seliverstov Authored: Tue Jul 11 10:40:56 2017 +0200 Committer: Igor Seliverstov Committed: Tue Jul 11 10:40:56 2017 +0200 -- .../src/main/scala/org/apache/ignite/spark/IgniteRDD.scala | 6 +++--- .../main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala | 6 +- .../org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java | 5 - 3 files changed, 8 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala -- diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala index 81509d0..78e2223 100644 --- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala +++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala @@ -60,11 +60,11 @@ class IgniteRDD[K, V] ( val qry: ScanQuery[K, V] = new ScanQuery[K, V](part.index) -val partNodes = ic.ignite().affinity(cache.getName).mapPartitionToPrimaryAndBackups(part.index) +val cur = cache.query(qry) -val it: java.util.Iterator[Cache.Entry[K, V]] = cache.query(qry).iterator() +TaskContext.get().addTaskCompletionListener((_) ⇒ cur.close()) -new IgniteQueryIterator[Cache.Entry[K, V], (K, V)](it, entry ⇒ { +new IgniteQueryIterator[Cache.Entry[K, V], (K, V)](cur.iterator(), entry ⇒ { (entry.getKey, entry.getValue) }) } http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala -- diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala index f074572..f386f26 100644 --- a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala +++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala @@ -33,7 +33,11 @@ class IgniteSqlRDD[R: ClassTag, T, K, V]( keepBinary: Boolean ) extends IgniteAbstractRDD[R, K, V](ic, cacheName, cacheCfg, keepBinary) { override def compute(split: Partition, context: TaskContext): Iterator[R] = { -new IgniteQueryIterator[T, R](ensureCache().query(qry).iterator(), conv) +val cur = ensureCache().query(qry) + +TaskContext.get().addTaskCompletionListener((_) ⇒ cur.close()) + +new IgniteQueryIterator[T, R](cur.iterator(), conv) } override protected def getPartitions: Array[Partition] = { http://git-wip-us.apache.org/repos/asf/ignite/blob/a668a224/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java -- diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java index 5477d43..49bb1ac 100644 --- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java +++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java @@ -100,11 +100,6 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest { } /** {@inheritDoc} */ -@Override protected void beforeTest() throws Exception { -fail("https://issues.apache.org/jira/browse/IGNITE-5690";); -} - -/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { stopAllGrids(); }
[45/50] ignite git commit: IGNITE-5688: Fix SparseDistributedMatrixTest::testCacheBehaviour crash. This closes #2272
IGNITE-5688: Fix SparseDistributedMatrixTest::testCacheBehaviour crash. This closes #2272 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2fe4374 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2fe4374 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2fe4374 Branch: refs/heads/master Commit: d2fe437426399e2cf36b00ce6f527731da88613e Parents: 33ae472 Author: artemmalykh Authored: Mon Jul 10 18:16:49 2017 +0300 Committer: artemmalykh Committed: Mon Jul 10 18:22:49 2017 +0300 -- modules/ml/pom.xml | 3 +- .../main/java/org/apache/ignite/ml/Model.java | 1 - .../ml/clustering/BaseKMeansClusterer.java | 2 - .../apache/ignite/ml/clustering/Clusterer.java | 3 +- .../clustering/KMeansDistributedClusterer.java | 46 ++-- .../ml/clustering/KMeansLocalClusterer.java | 11 +++-- .../apache/ignite/ml/math/DistanceMeasure.java | 1 - .../ignite/ml/math/EuclideanDistance.java | 2 +- .../java/org/apache/ignite/ml/math/Matrix.java | 2 - .../java/org/apache/ignite/ml/math/Tracer.java | 1 - .../org/apache/ignite/ml/math/VectorUtils.java | 4 +- .../math/exceptions/ConvergenceException.java | 5 +-- .../exceptions/MathIllegalStateException.java | 4 +- .../ignite/ml/math/functions/Functions.java | 8 +--- .../apache/ignite/ml/math/impls/CacheUtils.java | 23 ++ .../ml/math/impls/matrix/AbstractMatrix.java| 2 - .../impls/matrix/SparseDistributedMatrix.java | 4 +- .../impls/storage/matrix/MapWrapperStorage.java | 7 ++- .../matrix/SparseDistributedMatrixStorage.java | 7 ++- .../vector/SparseLocalOnHeapVectorStorage.java | 8 ++-- .../ml/math/impls/vector/MapWrapperVector.java | 3 +- .../apache/ignite/ml/math/util/MatrixUtil.java | 1 - .../ignite/ml/math/d3-matrix-template.html | 2 + .../ignite/ml/math/d3-vector-template.html | 2 + .../org/apache/ignite/ml/IgniteMLTestSuite.java | 4 +- .../ml/clustering/ClusteringTesetSuite.java | 32 -- .../ml/clustering/ClusteringTestSuite.java | 32 ++ .../KMeansDistributedClustererTest.java | 28 .../ignite/ml/math/MathImplLocalTestSuite.java | 1 - .../org/apache/ignite/ml/math/TracerTest.java | 3 ++ .../matrix/SparseDistributedMatrixTest.java | 24 ++ .../OLSMultipleLinearRegressionTest.java| 2 +- 32 files changed, 144 insertions(+), 134 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/pom.xml -- diff --git a/modules/ml/pom.xml b/modules/ml/pom.xml index 75ebf1b..d619719 100644 --- a/modules/ml/pom.xml +++ b/modules/ml/pom.xml @@ -19,7 +19,8 @@ -http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> +http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> 4.0.0 http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/src/main/java/org/apache/ignite/ml/Model.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/Model.java b/modules/ml/src/main/java/org/apache/ignite/ml/Model.java index e4d2117..4dc1aca 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/Model.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/Model.java @@ -19,7 +19,6 @@ package org.apache.ignite.ml; import java.util.function.BiFunction; - /** Basic interface for all models. */ @FunctionalInterface public interface Model { http://git-wip-us.apache.org/repos/asf/ignite/blob/d2fe4374/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java -- diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java index a6acb8e..570ea7e 100644 --- a/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java +++ b/modules/ml/src/main/java/org/apache/ignite/ml/clustering/BaseKMeansClusterer.java @@ -18,14 +18,12 @@ package org.apache.ignite.ml.clustering; import java.util.List; - import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.ml.math.DistanceMeasure; import org.apache.ignite.ml.math.Matrix; import org.apache.ignite.ml.math.Vector; import org.apache.ignite.ml.math.exceptions.ConvergenceException; import o
[36/50] ignite git commit: GG-12418 - WAL hangs on any error during segment rollover
GG-12418 - WAL hangs on any error during segment rollover Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17d881ba Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17d881ba Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17d881ba Branch: refs/heads/master Commit: 17d881ba0122a7f90cac9846c376300a1d001bdd Parents: f1c8e59 Author: Pavel Kovalenko Authored: Mon Jul 10 13:55:47 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 13:57:51 2017 +0300 -- .../PersistentStoreConfiguration.java | 24 +++ .../cache/persistence/file/FileIO.java | 154 +++ .../cache/persistence/file/FileIODecorator.java | 98 ++ .../cache/persistence/file/FileIOFactory.java | 45 + .../cache/persistence/file/FilePageStore.java | 51 +++-- .../persistence/file/FilePageStoreManager.java | 2 + .../persistence/file/RandomAccessFileIO.java| 110 +++ .../file/RandomAccessFileIOFactory.java | 42 .../wal/AbstractWalRecordsIterator.java | 22 ++- .../cache/persistence/wal/FileInput.java| 40 ++-- .../wal/FileWriteAheadLogManager.java | 161 --- .../wal/reader/IgniteWalIteratorFactory.java| 13 +- .../wal/reader/StandaloneGridKernalContext.java | 15 +- .../reader/StandaloneIgnitePluginProcessor.java | 38 .../reader/StandaloneWalRecordsIterator.java| 37 ++-- ...gnitePdsRecoveryAfterFileCorruptionTest.java | 11 +- .../db/wal/IgniteWalFlushFailoverTest.java | 195 +++ .../db/wal/crc/IgniteDataIntegrityTests.java| 10 +- .../db/wal/reader/IgniteWalReaderTest.java | 9 +- .../db/wal/reader/MockWalIteratorFactory.java | 8 +- .../ignite/testsuites/IgnitePdsTestSuite2.java | 4 + 21 files changed, 919 insertions(+), 170 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java index b531f9d..4792483 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java @@ -16,6 +16,8 @@ */ package org.apache.ignite.configuration; +import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; +import org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory; import org.apache.ignite.internal.util.typedef.internal.S; import java.io.Serializable; @@ -133,6 +135,9 @@ public class PersistentStoreConfiguration implements Serializable { /** Always write full pages. */ private boolean alwaysWriteFullPages = DFLT_WAL_ALWAYS_WRITE_FULL_PAGES; +/** Factory to provide I/O interface for files */ +private FileIOFactory fileIOFactory = new RandomAccessFileIOFactory(); + /** * Number of sub-intervals the whole {@link #setRateTimeInterval(long)} will be split into to calculate * rate-based metrics. @@ -539,6 +544,25 @@ public class PersistentStoreConfiguration implements Serializable { } /** + * Factory to provide implementation of FileIO interface + * which is used for any file read/write operations + * + * @return File I/O factory + */ +public FileIOFactory getFileIOFactory() { +return fileIOFactory; +} + +/** + * @param fileIOFactory File I/O factory + */ +public PersistentStoreConfiguration setFileIOFactory(FileIOFactory fileIOFactory) { +this.fileIOFactory = fileIOFactory; + +return this; +} + +/** * Note: setting this value with {@link WALMode#DEFAULT} may generate file size overhead for WAL segments in case * grid is used rarely. * http://git-wip-us.apache.org/repos/asf/ignite/blob/17d881ba/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java new file mode 100644 index 000..1e81150 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FileIO.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more
[34/50] ignite git commit: IGNITE-5716 .NET: Fix 2-byte field offset handling - improve tests
IGNITE-5716 .NET: Fix 2-byte field offset handling - improve tests Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f1c8e59c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1c8e59c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1c8e59c Branch: refs/heads/master Commit: f1c8e59cb9410915a6e61ba6f4f63c6f3c795c75 Parents: 313f86e Author: Pavel Tupitsyn Authored: Mon Jul 10 13:15:20 2017 +0300 Committer: Pavel Tupitsyn Committed: Mon Jul 10 13:15:20 2017 +0300 -- .../Binary/BinaryFooterTest.cs | 32 1 file changed, 32 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f1c8e59c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs index 36f2f65..5088e5a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryFooterTest.cs @@ -20,6 +20,8 @@ namespace Apache.Ignite.Core.Tests.Binary using System; using System.Linq; using Apache.Ignite.Core.Binary; +using Apache.Ignite.Core.Cache.Configuration; +using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Impl; using Apache.Ignite.Core.Impl.Binary; using NUnit.Framework; @@ -117,16 +119,46 @@ namespace Apache.Ignite.Core.Tests.Binary Assert.AreEqual(dt.Arr, r.Arr); Assert.AreEqual(dt.Int, r.Int); } + +TestSql(dt, getMarsh()); } } } /// +/// Tests SQL query, which verifies Java side of things. +/// +private static void TestSql(OffsetTest dt, Marshaller marsh) +{ +var ignite = marsh.Ignite; + +if (ignite == null) +{ +return; +} + +var cache = ignite.GetOrCreateCache( +new CacheConfiguration("offs", new QueryEntity(typeof(int), typeof(OffsetTest; + +// Cache operation. +cache[1] = dt; +Assert.AreEqual(dt.Int, cache[1].Int); +Assert.AreEqual(dt.Arr, cache[1].Arr); + +// SQL: read field on Java side to ensure correct offset handling. +var res = cache.QueryFields(new SqlFieldsQuery("select int from OffsetTest")).GetAll()[0][0]; +Assert.AreEqual(dt.Int, (int) res); +} + +/// /// Offset test. /// private class OffsetTest : IBinarizable { +[QuerySqlField] public byte[] Arr; // Array to enforce field offset. + +[QuerySqlField] public int Int; // Value at offset. public void WriteBinary(IBinaryWriter writer)
[05/50] ignite git commit: IGNITE-5483: Added limited support for Java8 LocalDateTime. This closes #2248.
IGNITE-5483: Added limited support for Java8 LocalDateTime. This closes #2248. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99fd75dd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99fd75dd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99fd75dd Branch: refs/heads/master Commit: 99fd75dd7766318af88a38b5640a648bba3ccdf1 Parents: 30922ed Author: Sergey Kalashnikov Authored: Fri Jul 7 14:38:36 2017 +0300 Committer: devozerov Committed: Fri Jul 7 14:38:36 2017 +0300 -- .../query/h2/DmlStatementsProcessor.java | 19 +++ .../processors/query/h2/H2DatabaseType.java | 10 ++ .../processors/query/h2/H2RowDescriptor.java | 13 + 3 files changed, 42 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/99fd75dd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java index 98d123f..0c1dbf9 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java @@ -20,6 +20,8 @@ package org.apache.ignite.internal.processors.query.h2; import java.lang.reflect.Array; import java.sql.PreparedStatement; import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -79,8 +81,13 @@ import org.h2.command.dml.Insert; import org.h2.command.dml.Merge; import org.h2.command.dml.Update; import org.h2.table.Column; +import org.h2.util.DateTimeUtils; +import org.h2.util.LocalDateTimeUtils; import org.h2.value.DataType; import org.h2.value.Value; +import org.h2.value.ValueDate; +import org.h2.value.ValueTime; +import org.h2.value.ValueTimestamp; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -711,6 +718,18 @@ public class DmlStatementsProcessor { return U.unmarshal(desc.context().marshaller(), (byte[]) val, U.resolveClassLoader(desc.context().gridConfig())); +if (LocalDateTimeUtils.isJava8DateApiPresent()) { +if (val instanceof Timestamp && LocalDateTimeUtils.isLocalDateTime(expCls)) +return LocalDateTimeUtils.valueToLocalDateTime(ValueTimestamp.get((Timestamp)val)); + +if (val instanceof Date && LocalDateTimeUtils.isLocalDate(expCls)) +return LocalDateTimeUtils.valueToLocalDate(ValueDate.fromDateValue( +DateTimeUtils.dateValueFromDate(((Date)val).getTime(; + +if (val instanceof Time && LocalDateTimeUtils.isLocalTime(expCls)) +return LocalDateTimeUtils.valueToLocalTime(ValueTime.get((Time)val)); +} + // We have to convert arrays of reference types manually - see https://issues.apache.org/jira/browse/IGNITE-4327 // Still, we only can convert from Object[] to something more precise. if (type == Value.ARRAY && currCls != expCls) { http://git-wip-us.apache.org/repos/asf/ignite/blob/99fd75dd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java -- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java index 47c7eb9..8e4e639 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2DatabaseType.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.query.h2; import org.apache.ignite.internal.util.typedef.internal.S; +import org.h2.util.LocalDateTimeUtils; import org.h2.value.DataType; import java.math.BigDecimal; @@ -142,6 +143,15 @@ public enum H2DatabaseType { if (DataType.isGeometryClass(cls)) return GEOMETRY; +if (LocalDateTimeUtils.isJava8DateApiPresent()) { +if (LocalDateTimeUtils.isLocalDate(cls)) +return DATE; +else if (LocalDateTimeUtils.isLocalTime(cls)) +return TIME; +else if (LocalDateTimeUtils.isLocalDateTime(cls)) +return TIMESTAMP; +
[26/50] ignite git commit: .NET: Fix IgniteConfigurationTest
.NET: Fix IgniteConfigurationTest Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17904cb1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17904cb1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17904cb1 Branch: refs/heads/master Commit: 17904cb174a340ec928f4a7a4b12d294c2240d0f Parents: cb5ae96 Author: Pavel Tupitsyn Authored: Fri Jul 7 20:18:35 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Jul 7 20:18:35 2017 +0300 -- .../dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/17904cb1/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs -- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs index 578d923..5e5cb1c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs @@ -683,7 +683,7 @@ namespace Apache.Ignite.Core.Tests new MemoryPolicyConfiguration { Name = "myDefaultPlc", -PageEvictionMode = DataPageEvictionMode.Random2Lru, +PageEvictionMode = DataPageEvictionMode.Disabled, InitialSize = 340 * 1024 * 1024, MaxSize = 345 * 1024 * 1024, EvictionThreshold = 0.88, @@ -695,7 +695,7 @@ namespace Apache.Ignite.Core.Tests new MemoryPolicyConfiguration { Name = "customPlc", -PageEvictionMode = DataPageEvictionMode.RandomLru, +PageEvictionMode = DataPageEvictionMode.Disabled, MaxSize = 456 * 1024 * 1024, EvictionThreshold = 0.77, EmptyPagesPoolSize = 66,
[31/50] ignite git commit: Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2 # Conflicts: # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9790a46c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9790a46c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9790a46c Branch: refs/heads/master Commit: 9790a46c59e2fdc29703246db3dc7ba9abcd108a Parents: 0b9527e 17694c1 Author: sboikov Authored: Mon Jul 10 12:02:41 2017 +0300 Committer: sboikov Committed: Mon Jul 10 12:02:41 2017 +0300 -- ...ishSnapshotOperationAckDiscoveryMessage.java | 84 --- .../snapshot/SnapshotCheckParameters.java | 75 -- .../pagemem/snapshot/SnapshotOperation.java | 235 --- .../pagemem/snapshot/SnapshotOperationType.java | 49 ...artSnapshotOperationAckDiscoveryMessage.java | 149 .../StartSnapshotOperationDiscoveryMessage.java | 192 --- .../GridCachePartitionExchangeManager.java | 9 +- .../processors/cache/GridCacheProcessor.java| 22 +- .../cache/GridCacheSharedContext.java | 6 +- .../dht/GridDhtPartitionTopologyImpl.java | 8 +- .../GridDhtPartitionsExchangeFuture.java| 54 ++--- .../GridCacheDatabaseSharedManager.java | 3 +- .../persistence/IgniteCacheSnapshotManager.java | 150 .../persistence/file/FilePageStoreManager.java | 2 +- .../snapshot/IgniteCacheSnapshotManager.java| 161 + .../snapshot/SnapshotDiscoveryMessage.java | 33 +++ .../persistence/snapshot/SnapshotOperation.java | 44 .../datastructures/DataStructuresProcessor.java | 6 +- .../resources/META-INF/classnames.properties| 5 - .../loadtests/hashmap/GridCacheTestContext.java | 6 +- 20 files changed, 286 insertions(+), 1007 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/9790a46c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java -- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java index 7c62cca,a69872f..fe0a0c6 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java @@@ -1740,11 -1740,11 +1740,11 @@@ public class GridDhtPartitionTopologyIm result.add(e.getKey()); } - } - U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + - "[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + - ", partId=" + p + ", haveHistory=" + haveHistory + "]"); + U.warn(log, "Partition has been scheduled for rebalancing due to outdated update counter " + -"[nodeId=" + ctx.localNodeId() + "cacheOrGroupName=" + grp.cacheOrGroupName() + ++"[nodeId=" + ctx.localNodeId() + ", cacheOrGroupName=" + grp.cacheOrGroupName() + + ", partId=" + p + ", haveHistory=" + haveHistory + "]"); + } } if (updateSeq)
[44/50] ignite git commit: Added partition release future timing
Added partition release future timing Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/33ae472f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/33ae472f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/33ae472f Branch: refs/heads/master Commit: 33ae472fc47c8983e48ac0febe22f11457c89ba1 Parents: 2ac3908 Author: Alexey Goncharuk Authored: Mon Jul 10 17:18:18 2017 +0300 Committer: Alexey Goncharuk Committed: Mon Jul 10 17:18:37 2017 +0300 -- .../dht/preloader/GridDhtPartitionsExchangeFuture.java | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/33ae472f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index 21a3a13..5760f87 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -1042,6 +1042,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte int dumpCnt = 0; +long waitStart = U.currentTimeMillis(); + long nextDumpTime = 0; long futTimeout = 2 * cctx.gridConfig().getNetworkTimeout(); @@ -1062,8 +1064,11 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte } } -if (log.isDebugEnabled()) -log.debug("After waiting for partition release future: " + this); +long waitEnd = U.currentTimeMillis(); + +if (log.isInfoEnabled()) +log.info("Finished waiting for partition release future [topVer=" + exchangeId().topologyVersion() + +", waitTime=" + (waitEnd - waitStart) + "ms]"); IgniteInternalFuture locksFut = cctx.mvcc().finishLocks(exchId.topologyVersion());
[01/50] ignite git commit: 2.1 More simple tx cancel on node stop
Repository: ignite Updated Branches: refs/heads/master 01f504ff8 -> ecfbc2c97 2.1 More simple tx cancel on node stop Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ab526713 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ab526713 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ab526713 Branch: refs/heads/master Commit: ab5267134966b466a2d4bfba15d0c7e3ebe91139 Parents: 31e9d3b Author: sboikov Authored: Fri Jul 7 13:14:18 2017 +0300 Committer: sboikov Committed: Fri Jul 7 13:14:18 2017 +0300 -- .../processors/cache/GridCacheProcessor.java | 2 ++ .../cache/distributed/dht/GridDhtTxFinishFuture.java | 4 +++- .../distributed/near/GridNearTxFinishFuture.java | 4 ++-- .../cache/transactions/IgniteTxAdapter.java | 4 ++-- .../cache/transactions/IgniteTxLocalAdapter.java | 15 +-- 5 files changed, 18 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/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 716482e..321e6dd 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 @@ -964,6 +964,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { // No new caches should be added after this point. exch.onKernalStop(cancel); +sharedCtx.mvcc().onStop(); + for (CacheGroupContext grp : cacheGrps.values()) grp.onKernalStop(); http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java index d8180b4..5311ddc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java @@ -225,7 +225,9 @@ public final class GridDhtTxFinishFuture extends GridCacheCompoundIdentity if (this.tx.onePhaseCommit() && (this.tx.state() == COMMITTING)) { try { -this.tx.tmFinish(err == null); +boolean nodeStop = err != null && X.hasCause(err, NodeStoppingException.class); + +this.tx.tmFinish(err == null, nodeStop); } catch (IgniteCheckedException finishErr) { U.error(log, "Failed to finish tx: " + tx, e); http://git-wip-us.apache.org/repos/asf/ignite/blob/ab526713/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java index 7f6f793..c45eb7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java @@ -327,7 +327,7 @@ public final class GridNearTxFinishFuture extends GridCacheCompoundIdentit finishOnePhase(commit); try { -tx.tmFinish(commit); +tx.tmFinish(commit, nodeStop); } catch (IgniteCheckedException e) { U.error(log, "Failed to finish tx: " + tx, e); @@ -338,7 +338,7 @@ public final class GridNearTxFinishFuture extends GridCacheCompoundIdentit } if (super.onDone(tx0, err)) { -if (error() instanceof IgniteTxHeuristicCheckedException) { +if (error() instanceof IgniteTxHeuristicCheckedException && !nodeStop) {
[42/50] ignite git commit: Removed unused method.
Removed unused method. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/92becc89 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/92becc89 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/92becc89 Branch: refs/heads/master Commit: 92becc8918f0cfc0a0c0d94c19a93d50d5ffb10e Parents: c52d2bf Author: sboikov Authored: Mon Jul 10 16:59:48 2017 +0300 Committer: sboikov Committed: Mon Jul 10 16:59:48 2017 +0300 -- .../GridCachePartitionExchangeManager.java | 42 1 file changed, 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/92becc89/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index f1db79a..de0adc7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -89,7 +89,6 @@ import org.apache.ignite.internal.util.GridListSet; import org.apache.ignite.internal.util.GridPartitionStateMap; import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; -import org.apache.ignite.internal.util.lang.IgnitePair; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.CI1; @@ -101,7 +100,6 @@ import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.lang.IgniteBiInClosure; -import org.apache.ignite.lang.IgniteProductVersion; import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.thread.IgniteThread; import org.jetbrains.annotations.Nullable; @@ -160,10 +158,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana new ConcurrentSkipListMap<>(); /** */ -private final ConcurrentSkipListMap> nodeVers = -new ConcurrentSkipListMap<>(); - -/** */ private final AtomicReference readyTopVer = new AtomicReference<>(AffinityTopologyVersion.NONE); @@ -806,18 +800,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana } /** - * Gets minimum node version for the given topology version. - * - * @param topVer Topology version to get minimum node version for. - * @return Minimum node version. - */ -public IgniteProductVersion minimumNodeVersion(AffinityTopologyVersion topVer) { -IgnitePair vers = nodeVers.get(topVer); - -return vers == null ? cctx.localNode().version() : vers.get1(); -} - -/** * @return {@code true} if entered to busy state. */ private boolean enterBusy() { @@ -1257,30 +1239,6 @@ public class GridCachePartitionExchangeManager extends GridCacheSharedMana if (log.isDebugEnabled()) log.debug("Exchange done [topVer=" + topVer + ", fut=" + exchFut + ", err=" + err + ']'); -IgniteProductVersion minVer = cctx.localNode().version(); -IgniteProductVersion maxVer = cctx.localNode().version(); - -if (err == null) { -if (!F.isEmpty(exchFut.discoveryEvent().topologyNodes())) { -for (ClusterNode node : exchFut.discoveryEvent().topologyNodes()) { -IgniteProductVersion ver = node.version(); - -if (ver.compareTo(minVer) < 0) -minVer = ver; - -if (ver.compareTo(maxVer) > 0) -maxVer = ver; -} -} -} - -nodeVers.put(topVer, new IgnitePair<>(minVer, maxVer)); - -AffinityTopologyVersion histVer = new AffinityTopologyVersion(topVer.topologyVersion() - 10, 0); - -for (AffinityTopologyVersion oldVer : nodeVers.headMap(histVer).keySet()) -nodeVers.remove(oldVer); - if (err == null) { while (true) { AffinityTopologyVersion readyVer = readyTopVer.get();
[10/50] ignite git commit: Merge remote-tracking branch 'upstream/ignite-2.1.2' into ignite-2.1.2
Merge remote-tracking branch 'upstream/ignite-2.1.2' into ignite-2.1.2 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2326487 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2326487 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2326487 Branch: refs/heads/master Commit: d232648711c882ed304eae89ae19f151067649fd Parents: 2a5390b 7adb111 Author: devozerov Authored: Fri Jul 7 15:02:29 2017 +0300 Committer: devozerov Committed: Fri Jul 7 15:02:29 2017 +0300 -- .../dht/GridDhtPartitionTopologyImpl.java | 84 1 file changed, 50 insertions(+), 34 deletions(-) --
[03/50] ignite git commit: Rename ActionData -> CacheActionData.
Rename ActionData -> CacheActionData. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f589628f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f589628f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f589628f Branch: refs/heads/master Commit: f589628f4846f14efc8e702b61856cc90a3d0dc7 Parents: 85d8c65 Author: sboikov Authored: Fri Jul 7 13:52:38 2017 +0300 Committer: sboikov Committed: Fri Jul 7 13:52:38 2017 +0300 -- .../cache/CacheAffinitySharedManager.java | 10 +++--- .../processors/cache/ClusterCachesInfo.java | 2 +- .../processors/cache/ExchangeActions.java | 34 ++-- .../processors/cache/GridCacheProcessor.java| 2 +- .../GridDhtPartitionsExchangeFuture.java| 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f589628f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java index 8d08c3f..548d795 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java @@ -701,7 +701,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap } }); -for (ExchangeActions.ActionData action : exchActions.cacheStartRequests()) { +for (ExchangeActions.CacheActionData action : exchActions.cacheStartRequests()) { DynamicCacheDescriptor cacheDesc = action.descriptor(); DynamicCacheChangeRequest req = action.request(); @@ -768,7 +768,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap Set gprs = new HashSet<>(); -for (ExchangeActions.ActionData action : exchActions.cacheStartRequests()) { +for (ExchangeActions.CacheActionData action : exchActions.cacheStartRequests()) { Integer grpId = action.descriptor().groupId(); if (gprs.add(grpId)) { @@ -786,7 +786,7 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap } } -for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) +for (ExchangeActions.CacheActionData action : exchActions.cacheStopRequests()) cctx.cache().blockGateway(action.request().cacheName(), true, action.request().restart()); for (ExchangeActions.CacheGroupActionData action : exchActions.cacheGroupsToStop()) { @@ -2308,10 +2308,10 @@ public class CacheAffinitySharedManager extends GridCacheSharedManagerAdap assert old == null : old; } -for (ExchangeActions.ActionData req : exchActions.cacheStopRequests()) +for (ExchangeActions.CacheActionData req : exchActions.cacheStopRequests()) registeredCaches.remove(req.descriptor().cacheId()); -for (ExchangeActions.ActionData req : exchActions.cacheStartRequests()) +for (ExchangeActions.CacheActionData req : exchActions.cacheStartRequests()) registeredCaches.put(req.descriptor().cacheId(), req.descriptor()); } http://git-wip-us.apache.org/repos/asf/ignite/blob/f589628f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 5aca8c9..738e4ac 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -624,7 +624,7 @@ class ClusterCachesInfo { // If all caches in group will be destroyed it is not necessary to destroy single cache // because group will be stopped anyway. if (req.destroy()) { -for (ExchangeActions.ActionData action : exchangeActions.cacheStopRequests()) { +for (ExchangeActions.CacheActionData action : exchangeActions.cacheStopRequests()) { if (action.descriptor().groupId() == grpDes
[41/50] ignite git commit: IGNITE-5679: Example for thin JDBC driver. This closes #2232.
IGNITE-5679: Example for thin JDBC driver. This closes #2232. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c52d2bf3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c52d2bf3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c52d2bf3 Branch: refs/heads/master Commit: c52d2bf312b3c950a187db74fff5a7348e3709c1 Parents: f2568b7 Author: tledkov-gridgain Authored: Mon Jul 10 15:19:58 2017 +0300 Committer: devozerov Committed: Mon Jul 10 15:19:58 2017 +0300 -- .../examples/datagrid/CacheQueryDdlExample.java | 26 ++-- .../ignite/examples/datagrid/JdbcExample.java | 135 +++ .../CacheExamplesMultiNodeSelfTest.java | 9 ++ .../ignite/examples/CacheExamplesSelfTest.java | 2 +- 4 files changed, 158 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/c52d2bf3/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java index 84a67cd..201dda1 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java @@ -56,33 +56,33 @@ public class CacheQueryDdlExample { try ( IgniteCache cache = ignite.getOrCreateCache(cacheCfg) ) { -// Create table based on PARTITIONED template with one backup. -cache.query(new SqlFieldsQuery( -"CREATE TABLE person (id LONG PRIMARY KEY, name VARCHAR, city_id LONG) " + -"WITH \"backups=1\"")).getAll(); - // Create reference City table based on REPLICATED template. cache.query(new SqlFieldsQuery( "CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=replicated\"")).getAll(); +// Create table based on PARTITIONED template with one backup. +cache.query(new SqlFieldsQuery( +"CREATE TABLE person (id LONG, name VARCHAR, city_id LONG, PRIMARY KEY (id, city_id)) " + +"WITH \"backups=1, affinityKey=city_id\"")).getAll(); + // Create an index. cache.query(new SqlFieldsQuery("CREATE INDEX on Person (city_id)")).getAll(); print("Created database objects."); -SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); +SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO city (id, name) VALUES (?, ?)"); + +cache.query(qry.setArgs(1L, "Forest Hill")).getAll(); +cache.query(qry.setArgs(2L, "Denver")).getAll(); +cache.query(qry.setArgs(3L, "St. Petersburg")).getAll(); + +qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)"); cache.query(qry.setArgs(1L, "John Doe", 3L)).getAll(); cache.query(qry.setArgs(2L, "Jane Roe", 2L)).getAll(); cache.query(qry.setArgs(3L, "Mary Major", 1L)).getAll(); cache.query(qry.setArgs(4L, "Richard Miles", 2L)).getAll(); -qry = new SqlFieldsQuery("INSERT INTO city (id, name) VALUES (?, ?)"); - -cache.query(qry.setArgs(1L, "Forest Hill")).getAll(); -cache.query(qry.setArgs(2L, "Denver")).getAll(); -cache.query(qry.setArgs(3L, "St. Petersburg")).getAll(); - print("Populated data."); List> res = cache.query(new SqlFieldsQuery( @@ -91,7 +91,7 @@ public class CacheQueryDdlExample { print("Query results:"); for (Object next : res) -System.out.println(">>> " + next); +System.out.println(">>>" + next); cache.query(new SqlFieldsQuery("drop table Person")).getAll(); cache.query(new SqlFieldsQuery("drop table City")).getAll(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c52d2bf3/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java -- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.java new file mode 100644 index 000..bc96e42 --- /dev/null +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/JdbcExample.j
[40/50] ignite git commit: ignite-5075 Rename cacheId -> groupId
ignite-5075 Rename cacheId -> groupId Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f2568b76 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f2568b76 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f2568b76 Branch: refs/heads/master Commit: f2568b76417aebc0e3c20003a8120b2d2adab3eb Parents: 5686810 Author: sboikov Authored: Mon Jul 10 14:41:04 2017 +0300 Committer: sboikov Committed: Mon Jul 10 14:41:04 2017 +0300 -- .../ignite/internal/pagemem/FullPageId.java | 32 - .../ignite/internal/pagemem/PageSupport.java| 36 +- .../pagemem/store/IgnitePageStoreManager.java | 40 +-- .../delta/DataPageInsertFragmentRecord.java | 6 +- .../wal/record/delta/DataPageInsertRecord.java | 6 +- .../wal/record/delta/DataPageRemoveRecord.java | 6 +- .../delta/DataPageSetFreeListPageRecord.java| 6 +- .../wal/record/delta/DataPageUpdateRecord.java | 6 +- .../wal/record/delta/FixCountRecord.java| 6 +- .../record/delta/FixLeftmostChildRecord.java| 6 +- .../pagemem/wal/record/delta/FixRemoveId.java | 6 +- .../wal/record/delta/InitNewPageRecord.java | 6 +- .../wal/record/delta/InnerReplaceRecord.java| 6 +- .../pagemem/wal/record/delta/InsertRecord.java | 6 +- .../pagemem/wal/record/delta/MergeRecord.java | 6 +- .../wal/record/delta/MetaPageAddRootRecord.java | 6 +- .../wal/record/delta/MetaPageCutRootRecord.java | 6 +- .../wal/record/delta/MetaPageInitRecord.java| 6 +- .../delta/MetaPageInitRootInlineRecord.java | 6 +- .../record/delta/MetaPageInitRootRecord.java| 4 +- .../delta/MetaPageUpdateLastAllocatedIndex.java | 4 +- ...aPageUpdateLastSuccessfulFullSnapshotId.java | 4 +- .../MetaPageUpdateLastSuccessfulSnapshotId.java | 4 +- .../delta/MetaPageUpdateNextSnapshotId.java | 4 +- .../MetaPageUpdatePartitionDataRecord.java | 6 +- .../wal/record/delta/NewRootInitRecord.java | 6 +- .../wal/record/delta/PageDeltaRecord.java | 14 ++-- .../delta/PageListMetaResetCountRecord.java | 6 +- .../record/delta/PagesListAddPageRecord.java| 6 +- .../delta/PagesListInitNewPageRecord.java | 6 +- .../record/delta/PagesListRemovePageRecord.java | 2 +- .../record/delta/PagesListSetNextRecord.java| 6 +- .../delta/PagesListSetPreviousRecord.java | 6 +- .../record/delta/PartitionDestroyRecord.java| 20 +++--- .../record/delta/PartitionMetaStateRecord.java | 16 ++--- .../pagemem/wal/record/delta/RecycleRecord.java | 6 +- .../pagemem/wal/record/delta/RemoveRecord.java | 6 +- .../pagemem/wal/record/delta/ReplaceRecord.java | 6 +- .../record/delta/SplitExistingPageRecord.java | 6 +- .../record/delta/SplitForwardPageRecord.java| 6 +- .../record/delta/TrackingPageDeltaRecord.java | 6 +- .../cache/persistence/DataStructure.java| 46 ++-- .../GridCacheDatabaseSharedManager.java | 38 +- .../persistence/GridCacheOffheapManager.java| 4 +- .../cache/persistence/MetadataStorage.java | 2 +- .../persistence/file/FilePageStoreManager.java | 34 - .../persistence/freelist/FreeListImpl.java | 6 +- .../cache/persistence/freelist/PagesList.java | 36 +- .../persistence/pagemem/FullPageIdTable.java| 54 +++--- .../cache/persistence/pagemem/PageMemoryEx.java | 4 +- .../persistence/pagemem/PageMemoryImpl.java | 72 +-- .../cache/persistence/tree/BPlusTree.java | 16 ++--- .../wal/serializer/RecordV1Serializer.java | 76 ++-- .../pagemem/impl/PageMemoryNoLoadSelfTest.java | 52 +++--- ...gnitePdsRecoveryAfterFileCorruptionTest.java | 24 +++ ...ckpointSimulationWithRealCpDisabledTest.java | 74 +-- .../db/file/IgnitePdsEvictionTest.java | 16 ++--- .../db/wal/IgniteWalRecoveryTest.java | 10 +-- .../pagemem/NoOpPageStoreManager.java | 22 +++--- 59 files changed, 470 insertions(+), 470 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/f2568b76/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java index 20677ea..00f52c1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/FullPageId.java @@ -56,28 +56,28 @@ public class FullPageId { private final long effectivePageId; /** */ -private final int cacheId; +private final int grpId; /** - *
[02/50] ignite git commit: IGNITE-5520 - Fixed IgniteChangeGlobalStateFailoverTest
IGNITE-5520 - Fixed IgniteChangeGlobalStateFailoverTest Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/85d8c657 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/85d8c657 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/85d8c657 Branch: refs/heads/master Commit: 85d8c6572d78c7d6796906d92b566e2fa5b116be Parents: ab52671 Author: Dmitriy Govorukhin Authored: Fri Jul 7 13:13:55 2017 +0300 Committer: Alexey Goncharuk Committed: Fri Jul 7 13:15:26 2017 +0300 -- .../IgniteChangeGlobalStateFailOverTest.java| 56 +--- 1 file changed, 37 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/85d8c657/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java -- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java index 92d1f21..02a21f4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java @@ -21,11 +21,11 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.util.typedef.internal.U; import static java.lang.Thread.sleep; import static org.apache.ignite.testframework.GridTestUtils.runAsync; @@ -144,8 +144,6 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState * @throws Exception If failed. */ public void testActivateDeActivateOnJoiningNode() throws Exception { -fail("https://issues.apache.org/jira/browse/IGNITE-5520";); - final Ignite igB1 = backUp(0); final Ignite igB2 = backUp(1); final Ignite igB3 = backUp(2); @@ -162,14 +160,17 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState final AtomicBoolean stop = new AtomicBoolean(); -final AtomicBoolean canAct = new AtomicBoolean(true); final AtomicInteger seqIdx = new AtomicInteger(backUpNodes()); +final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); + try { final IgniteInternalFuture af = runAsync(new Callable() { @Override public Void call() throws Exception { while (!stop.get()) { -if (canAct.get()) { +rwLock.readLock().lock(); + +try { Ignite ig = randomBackUp(false); long start = System.currentTimeMillis(); @@ -182,13 +183,12 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState for (Ignite ign : allBackUpNodes()) assertTrue(ign.active()); - -canAct.set(false); } -else -U.sleep(100); - +finally { +rwLock.readLock().unlock(); +} } + return null; } }); @@ -196,7 +196,9 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState final IgniteInternalFuture df = runAsync(new Callable() { @Override public Void call() throws Exception { while (!stop.get()) { -if (!canAct.get()) { +rwLock.writeLock().lock(); + +try { Ignite ig = randomBackUp(false); long start = System.currentTimeMillis(); @@ -209,20 +211,28 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState for (Ignite ign : allBackUpNodes()) assertTrue(!ign.active()); - -can
ignite git commit: ignite-5727
Repository: ignite Updated Branches: refs/heads/ignite-5727 [created] 560e1025e ignite-5727 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/560e1025 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/560e1025 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/560e1025 Branch: refs/heads/ignite-5727 Commit: 560e1025e31c719f2b0e69253bd26f7548528107 Parents: 2a2c803 Author: sboikov Authored: Tue Jul 11 12:38:24 2017 +0300 Committer: sboikov Committed: Tue Jul 11 12:38:24 2017 +0300 -- .../eventstorage/GridEventStorageManager.java | 275 ++- .../eventstorage/HighPriorityListener.java | 25 ++ .../processors/cache/GridCacheMvccManager.java | 5 - .../processors/cache/GridCacheProcessor.java| 2 - .../communication/tcp/TcpCommunicationSpi.java | 24 +- 5 files changed, 179 insertions(+), 152 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ignite/blob/560e1025/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java -- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java index 1714cbb..dd54b83 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java @@ -83,10 +83,7 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUB */ public class GridEventStorageManager extends GridManagerAdapter { /** Local event listeners. */ -private final ConcurrentMap> lsnrs = new ConcurrentHashMap8<>(); - -/** Internal discovery listeners. */ -private final ConcurrentMap> discoLsnrs = new ConcurrentHashMap8<>(); +private final ConcurrentMap lsnrs = new ConcurrentHashMap8<>(); /** Busy lock to control activity of threads. */ private final ReadWriteLock busyLock = new ReentrantReadWriteLock(); @@ -208,8 +205,8 @@ public class GridEventStorageManager extends GridManagerAdapter @Override public void printMemoryStats() { int lsnrsCnt = 0; -for (Set lsnrs0 : lsnrs.values()) -lsnrsCnt += lsnrs0.size(); +for (Listeners lsnrs0 : lsnrs.values()) +lsnrsCnt += lsnrs0.lsnrs.size(); X.println(">>>"); X.println(">>> Event storage manager memory stats [igniteInstanceName=" + ctx.igniteInstanceName() + ']'); @@ -250,9 +247,7 @@ public class GridEventStorageManager extends GridManagerAdapter try { if (msgLsnr != null) -ctx.io().removeMessageListener( -TOPIC_EVENT, -msgLsnr); +ctx.io().removeMessageListener(TOPIC_EVENT, msgLsnr); msgLsnr = null; @@ -332,13 +327,14 @@ public class GridEventStorageManager extends GridManagerAdapter } // Override user recordable settings for daemon node. -if ((isDaemon || isUserRecordable(type)) && !isHiddenEvent(type)) +if ((isDaemon || isUserRecordable(type)) && !isHiddenEvent(type)) { try { getSpi().record(evt); } catch (IgniteSpiException e) { U.error(log, "Failed to record event: " + evt, e); } +} if (isRecordable(type)) notifyListeners(lsnrs.get(evt.type()), evt, params); @@ -669,17 +665,13 @@ public class GridEventStorageManager extends GridManagerAdapter * @param lsnr Listener to add. * @param types Event types to subscribe listener for. */ -private void addEventListener(EventListener lsnr, int[] types) { +private void addEventListener(ListenerWrapper lsnr, int[] types) { if (!enterBusy()) return; try { -for (int t : types) { -getOrCreate(lsnrs, t).add(lsnr); - -if (!isRecordable(t)) -U.warn(log, "Added listener for disabled event type: " + U.gridEventName(t)); -} +for (int t : types) +registerListener(lsnr, t); } finally { leaveBusy(); @@ -693,23 +685,16 @@ public class GridEventStorageManager extends GridManagerAdapter * @param type Event type to subscribe listener for. * @param types Additional event types to subscribe listener for. */ -private void addEventListener(EventListener lsnr, int type, @Nullable int..