You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2015/10/12 19:15:05 UTC
[01/17] ignite git commit: 1.4.1-SNAPSHOT
Repository: ignite
Updated Branches:
refs/heads/master 075e7d06d -> 6844370dc
1.4.1-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e5e72ea0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e5e72ea0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e5e72ea0
Branch: refs/heads/master
Commit: e5e72ea0e0951af9200dc81e3b69a02c961ee2c2
Parents: a2c972b
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu Sep 24 18:57:10 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu Sep 24 18:57:10 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
examples/schema-import/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/modules/uri-dependency/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/platform/pom.xml | 2 +-
modules/platform/src/main/cpp/common/configure.ac | 2 +-
modules/platform/src/main/cpp/core-test/configure.ac | 2 +-
modules/platform/src/main/cpp/core/configure.ac | 2 +-
.../main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs | 4 ++--
.../src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 4 ++--
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
modules/yarn/pom.xml | 2 +-
modules/zookeeper/pom.xml | 2 +-
pom.xml | 2 +-
53 files changed, 57 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 64e8be9..a2ac452 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/examples/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index f51007a..05de048 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -35,7 +35,7 @@
</properties>
<artifactId>ignite-schema-import-demo</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 391f5b8..a080b57 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index c17f98f..1af8c00 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-apache-license-gen</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<build>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index a0ca6b0..63d454d 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 6e690dc..74590ec 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index b7aa43b..e735804 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 89cadf5..a39da2f 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 9162afe..13d6fd4 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 50725fa..c1c2d0f 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.4.0-SNAPSHOT
+ignite.version=1.4.1-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index aca3132..b48859b 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 98d3fcf..f863bed 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
<artifactId>ignite-extdata-uri-dep</artifactId>
<packaging>jar</packaging>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 7613f0c..0b4f92f 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 05f043f..b3fbb32 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 766114b..1330cf5 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 839ffb8..9fdfd99 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index a3ae729..2d6d893 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index e4713b4..4bcadc8 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 335b6c8..0b2c48b 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
index dbb385d..1b8f67d 100644
--- a/modules/jms11/pom.xml
+++ b/modules/jms11/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jms11</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index c0ce618..7965dd9 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 5103a32..ed192ab 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index aaf1dca..c3c4a84 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 2c0fd94..0628b47 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j2</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index a652b60..07bd13d 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/pom.xml
----------------------------------------------------------------------
diff --git a/modules/platform/pom.xml b/modules/platform/pom.xml
index ba5b9d0..f18b05b 100644
--- a/modules/platform/pom.xml
+++ b/modules/platform/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-platform</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/main/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/common/configure.ac b/modules/platform/src/main/cpp/common/configure.ac
index b34d7d8..3f7c8a2 100644
--- a/modules/platform/src/main/cpp/common/configure.ac
+++ b/modules/platform/src/main/cpp/common/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite JNI bridge for C++], [1.4.0], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.4.1], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/main/cpp/core-test/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core-test/configure.ac b/modules/platform/src/main/cpp/core-test/configure.ac
index 3a1b660..c72e6bd 100644
--- a/modules/platform/src/main/cpp/core-test/configure.ac
+++ b/modules/platform/src/main/cpp/core-test/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Test], [1.4.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Test], [1.4.1], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/main/cpp/core/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/cpp/core/configure.ac b/modules/platform/src/main/cpp/core/configure.ac
index cdd238f..4a3a03a 100644
--- a/modules/platform/src/main/cpp/core/configure.ac
+++ b/modules/platform/src/main/cpp/core/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.4.0], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.4.1], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_SYSTEM
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 5f2c018..8e653e3 100644
--- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
-[assembly: AssemblyVersion("1.4.0")]
-[assembly: AssemblyFileVersion("1.4.0")]
+[assembly: AssemblyVersion("1.4.1")]
+[assembly: AssemblyFileVersion("1.4.1")]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("Apache.Ignite")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index ca38ea2..7cf47c3 100644
--- a/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
[assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
-[assembly: AssemblyVersion("1.4.0")]
-[assembly: AssemblyFileVersion("1.4.0")]
\ No newline at end of file
+[assembly: AssemblyVersion("1.4.1")]
+[assembly: AssemblyFileVersion("1.4.1")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index cb633ed..ba4b794 100644
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,5 +45,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.0")]
-[assembly: AssemblyFileVersion("1.4.0")]
+[assembly: AssemblyVersion("1.4.1")]
+[assembly: AssemblyFileVersion("1.4.1")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 947e18c..f474b03 100644
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
[assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
-[assembly: AssemblyVersion("1.4.0")]
-[assembly: AssemblyFileVersion("1.4.0")]
\ No newline at end of file
+[assembly: AssemblyVersion("1.4.1")]
+[assembly: AssemblyFileVersion("1.4.1")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index c506df6..8156887 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 627f2b4..42fb9b9 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar_2.10</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index ab03a5d..982fcaf 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 207a97c..e64059a 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index ef36af9..0ba8597 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 807ed0d..5cdf791 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 283855e..6c44006 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark_2.10</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index f7b2110..1fb2753 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index bf093ef..4ed1fd7 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 5b407ad..7922f53 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index ca0d0f4..5e3465e 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index df2b0fa..7dd0431 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index fa541dc..a0edeaf 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console_2.10</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index dc841bf..d6f373a 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index c0e5b5e..04142fa 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index d814f47..4432d81 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index eda9429..3f3774a 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index c93efa4..079a173 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/modules/zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml
index 3993bd5..ba10101 100644
--- a/modules/zookeeper/pom.xml
+++ b/modules/zookeeper/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-zookeeper</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e5e72ea0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6ddc443..191ed3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[10/17] ignite git commit: ignite-1526: full support of IBM JDK by
Ignite
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index dfbb0ae..04d7893 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -22,7 +22,6 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
-import java.util.UUID;
import java.util.concurrent.locks.Lock;
import javax.cache.CacheException;
import javax.cache.CacheManager;
@@ -35,7 +34,6 @@ import javax.cache.processor.EntryProcessorResult;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCompute;
-import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheEntryProcessor;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cache.CachePeekMode;
@@ -47,8 +45,8 @@ import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteCallable;
import org.apache.ignite.lang.IgniteFuture;
-import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.mxbean.CacheMetricsMXBean;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
/**
@@ -62,9 +60,6 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
/** Cache name. */
private final String cacheName;
- /** Grid id. */
- private final UUID gridId;
-
/** With async. */
private final boolean isAsync;
@@ -81,31 +76,16 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
/**
* @param name Name.
- * @param async
+ * @param async Async flag.
* @param proxy Ignite Process Proxy.
*/
public IgniteCacheProcessProxy(String name, boolean async, IgniteProcessProxy proxy) {
cacheName = name;
isAsync = async;
- gridId = proxy.getId();
igniteProxy = proxy;
compute = proxy.remoteCompute();
}
- /**
- * Returns cache instance. Method to be called from closure at another JVM.
- *
- * @return Cache.
- */
- private IgniteCache<Object, Object> cache() {
- IgniteCache cache = Ignition.ignite(gridId).cache(cacheName);
-
- if (isAsync)
- cache = cache.withAsync();
-
- return cache;
- }
-
/** {@inheritDoc} */
@Override public IgniteCache<K, V> withAsync() {
return new IgniteCacheProcessProxy<>(cacheName, true, igniteProxy);
@@ -123,14 +103,8 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
- @Override public <C extends Configuration<K, V>> C getConfiguration(final Class<C> clazz) {
- final Class cl = clazz;
-
- return (C)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getConfiguration(cl);
- }
- });
+ @Override public <C extends Configuration<K, V>> C getConfiguration(Class<C> clazz) {
+ return compute.call(new GetConfigurationTask<>(cacheName, isAsync, clazz));
}
/** {@inheritDoc} */
@@ -148,33 +122,26 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
throw new UnsupportedOperationException("Method should be supported.");
}
+ /** {@inheritDoc} */
@Override public IgniteCache<K, V> withNoRetries() {
throw new UnsupportedOperationException("Method should be supported.");
}
/** {@inheritDoc} */
- @Override public void loadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args) throws CacheException {
+ @Override public void loadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args)
+ throws CacheException {
throw new UnsupportedOperationException("Method should be supported.");
}
/** {@inheritDoc} */
- @Override public void localLoadCache(@Nullable final IgniteBiPredicate<K, V> p, @Nullable final Object... args) throws CacheException {
- final IgniteBiPredicate pCopy = p;
-
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().localLoadCache(pCopy, args);
- }
- });
+ @Override public void localLoadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args)
+ throws CacheException {
+ compute.call(new LocalLoadCacheTask<>(cacheName, isAsync, p, args));
}
/** {@inheritDoc} */
- @Override public V getAndPutIfAbsent(final K key, final V val) throws CacheException {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAndPutIfAbsent(key, val);
- }
- });
+ @Override public V getAndPutIfAbsent(K key, V val) throws CacheException {
+ return compute.call(new GetAndPutIfAbsentTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
@@ -188,12 +155,8 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
- @Override public boolean isLocalLocked(final K key, final boolean byCurrThread) {
- return compute.call(new IgniteCallable<Boolean>() {
- @Override public Boolean call() throws Exception {
- return cache().isLocalLocked(key, byCurrThread);
- }
- });
+ @Override public boolean isLocalLocked(K key, boolean byCurrThread) {
+ return compute.call(new IsLocalLockedTask<>(cacheName, isAsync, key, byCurrThread));
}
/** {@inheritDoc} */
@@ -202,18 +165,8 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public Iterable<Entry<K, V>> localEntries(final CachePeekMode... peekModes) throws CacheException {
- return (Iterable<Entry<K, V>>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- Collection<Entry> res = new ArrayList<>();
-
- for (Entry e : cache().localEntries(peekModes))
- res.add(e);
-
- return res;
- }
- });
+ @Override public Iterable<Entry<K, V>> localEntries(CachePeekMode... peekModes) throws CacheException {
+ return compute.call(new LocalEntriesTask<K, V>(cacheName, isAsync, peekModes));
}
/** {@inheritDoc} */
@@ -222,21 +175,13 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
- @Override public void localEvict(final Collection<? extends K> keys) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().localEvict(keys);
- }
- });
+ @Override public void localEvict(Collection<? extends K> keys) {
+ compute.call(new LocalEvictTask<>(cacheName, isAsync, keys));
}
/** {@inheritDoc} */
- @Override public V localPeek(final K key, final CachePeekMode... peekModes) {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().localPeek(key, peekModes);
- }
- });
+ @Override public V localPeek(K key, CachePeekMode... peekModes) {
+ return compute.call(new LocalPeekTask<K, V>(cacheName, isAsync, key, peekModes));
}
/** {@inheritDoc} */
@@ -245,274 +190,160 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
- @Override public int size(final CachePeekMode... peekModes) throws CacheException {
- return (int)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().size(peekModes);
- }
- });
+ @Override public int size(CachePeekMode... peekModes) throws CacheException {
+ return compute.call(new SizeTask(cacheName, isAsync, peekModes, false));
}
/** {@inheritDoc} */
- @Override public int localSize(final CachePeekMode... peekModes) {
- return (int)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().localSize(peekModes);
- }
- });
+ @Override public int localSize(CachePeekMode... peekModes) {
+ return compute.call(new SizeTask(cacheName, isAsync, peekModes, true));
}
/** {@inheritDoc} */
- @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
- Object... args) {
+ @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+ Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+ Object... args)
+ {
throw new UnsupportedOperationException("Method should be supported.");
}
/** {@inheritDoc} */
- @Override public V get(final K key) {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().get(key);
- }
- });
+ @Override public V get(K key) {
+ return compute.call(new GetTask<K, V>(cacheName, isAsync, key));
}
/** {@inheritDoc} */
- @Override public Map<K, V> getAll(final Set<? extends K> keys) {
- return (Map<K, V>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAll(keys);
- }
- });
+ @Override public Map<K, V> getAll(Set<? extends K> keys) {
+ return compute.call(new GetAllTask<K, V>(cacheName, isAsync, keys));
}
- @Override public Map<K, V> getAllOutTx(final Set<? extends K> keys) {
- return (Map<K, V>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAllOutTx(keys);
- }
- });
+ /** {@inheritDoc} */
+ @Override public Map<K, V> getAllOutTx(Set<? extends K> keys) {
+ return compute.call(new GetAllOutTxTask<K, V>(cacheName, isAsync, keys));
}
/** {@inheritDoc} */
- @Override public boolean containsKey(final K key) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().containsKey(key);
- }
- });
+ @Override public boolean containsKey(K key) {
+ return compute.call(new ContainsKeyTask<>(cacheName, isAsync, key));
}
/** {@inheritDoc} */
- @Override public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, CompletionListener completionLsnr) {
+ @Override public void loadAll(Set<? extends K> keys, boolean replaceExistVals, CompletionListener completionLsnr) {
throw new UnsupportedOperationException("Oparetion can't be supported automatically.");
}
/** {@inheritDoc} */
- @Override public boolean containsKeys(final Set<? extends K> keys) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().containsKeys(keys);
- }
- });
+ @Override public boolean containsKeys(Set<? extends K> keys) {
+ return compute.call(new ContainsKeysTask<>(cacheName, isAsync, keys));
}
/** {@inheritDoc} */
- @Override public void put(final K key, final V val) {;
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().put(key, val);
- }
- });
+ @Override public void put(K key, V val) {
+ compute.call(new PutTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
- @Override public V getAndPut(final K key, final V val) {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAndPut(key, val);
- }
- });
+ @Override public V getAndPut(K key, V val) {
+ return compute.call(new GetAndPutTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
- @Override public void putAll(final Map<? extends K, ? extends V> map) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().putAll(map);
- }
- });
+ @Override public void putAll(Map<? extends K, ? extends V> map) {
+ compute.call(new PutAllTask<>(cacheName, isAsync, map));
}
/** {@inheritDoc} */
- @Override public boolean putIfAbsent(final K key, final V val) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().putIfAbsent(key, val);
- }
- });
+ @Override public boolean putIfAbsent(K key, V val) {
+ return compute.call(new PutIfAbsentTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
- @Override public boolean remove(final K key) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().remove(key);
- }
- });
+ @Override public boolean remove(K key) {
+ return compute.call(new RemoveTask<>(cacheName, isAsync, key));
}
/** {@inheritDoc} */
- @Override public boolean remove(final K key, final V oldVal) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().remove(key, oldVal);
- }
- });
+ @Override public boolean remove(K key, V oldVal) {
+ return compute.call(new RemoveIfExistsTask<>(cacheName, isAsync, key, oldVal));
}
/** {@inheritDoc} */
- @Override public V getAndRemove(final K key) {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAndRemove(key);
- }
- });
+ @Override public V getAndRemove(K key) {
+ return compute.call(new GetAndRemoveTask<K, V>(cacheName, isAsync, key));
}
/** {@inheritDoc} */
- @Override public boolean replace(final K key, final V oldVal, final V newVal) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().replace(key, oldVal, newVal);
- }
- });
+ @Override public boolean replace(K key, V oldVal, V newVal) {
+ return compute.call(new ReplaceIfExistsTask<>(cacheName, isAsync, key, oldVal, newVal));
}
/** {@inheritDoc} */
- @Override public boolean replace(final K key, final V val) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().replace(key, val);
- }
- });
+ @Override public boolean replace(K key, V val) {
+ return compute.call(new ReplaceTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
- @Override public V getAndReplace(final K key, final V val) {
- return (V)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getAndReplace(key, val);
- }
- });
+ @Override public V getAndReplace(K key, V val) {
+ return compute.call(new GetAndReplaceTask<>(cacheName, isAsync, key, val));
}
/** {@inheritDoc} */
- @Override public void removeAll(final Set<? extends K> keys) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().removeAll(keys);
- }
- });
+ @Override public void removeAll(Set<? extends K> keys) {
+ compute.call(new RemoveAllKeysTask<>(cacheName, isAsync, keys));
}
/** {@inheritDoc} */
@Override public void removeAll() {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- IgniteCache<Object, Object> cache = cache();
-
- cache.removeAll();
-
- if (isAsync)
- cache.future().get();
- }
- });
+ compute.call(new RemoveAllTask<K, V>(cacheName, isAsync));
}
/** {@inheritDoc} */
@Override public void clear() {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().clear();
- }
- });
+ compute.call(new ClearTask(cacheName, isAsync));
}
/** {@inheritDoc} */
- @Override public void clear(final K key) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().clear(key);
- }
- });
+ @Override public void clear(K key) {
+ compute.call(new ClearKeyTask<>(cacheName, isAsync, false, key));
}
/** {@inheritDoc} */
- @Override public void clearAll(final Set<? extends K> keys) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().clearAll(keys);
- }
- });
+ @Override public void clearAll(Set<? extends K> keys) {
+ compute.call(new ClearAllKeys<>(cacheName, isAsync, false, keys));
}
/** {@inheritDoc} */
- @Override public void localClear(final K key) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().localClear(key);
- }
- });
+ @Override public void localClear(K key) {
+ compute.call(new ClearKeyTask<>(cacheName, isAsync, true, key));
}
/** {@inheritDoc} */
- @Override public void localClearAll(final Set<? extends K> keys) {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().localClearAll(keys);
- }
- });
+ @Override public void localClearAll(Set<? extends K> keys) {
+ compute.call(new ClearAllKeys<>(cacheName, isAsync, true, keys));
}
/** {@inheritDoc} */
- @Override public <T> T invoke(final K key, final EntryProcessor<K, V, T> entryProcessor, final Object... arguments) {
- return (T)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().invoke(key,
- (EntryProcessor<Object, Object, Object>)entryProcessor, arguments);
- }
- });
+ @Override public <T> T invoke(K key, EntryProcessor<K, V, T> processor, Object... args) {
+ return compute.call(new InvokeTask<>(cacheName, isAsync, key, processor, args));
}
/** {@inheritDoc} */
- @Override public <T> T invoke(final K key, final CacheEntryProcessor<K, V, T> entryProcessor, final Object... arguments) {
- return (T)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().invoke(key,
- (CacheEntryProcessor<Object, Object, Object>)entryProcessor, arguments);
- }
- });
+ @Override public <T> T invoke(K key, CacheEntryProcessor<K, V, T> processor, Object... args) {
+ return compute.call(new InvokeTask<>(cacheName, isAsync, key, processor, args));
}
/** {@inheritDoc} */
- @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(final Set<? extends K> keys, final EntryProcessor<K, V, T> entryProcessor,
- final Object... args) {
- return (Map<K, EntryProcessorResult<T>>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().invokeAll(keys,
- (EntryProcessor<Object, Object, Object>)entryProcessor, args);
- }
- });
+ @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+ Set<? extends K> keys,
+ EntryProcessor<K, V, T> processor,
+ Object... args)
+ {
+ return compute.call(new InvokeAllTask<>(cacheName, isAsync, keys, processor, args));
}
/** {@inheritDoc} */
@Override public String getName() {
- return (String)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().getName();
- }
- });
+ return compute.call(new GetNameTask(cacheName, isAsync));
}
/** {@inheritDoc} */
@@ -522,72 +353,47 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
/** {@inheritDoc} */
@Override public void close() {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().close();
- }
- });
+ compute.call(new CloseTask(cacheName, isAsync));
}
/** {@inheritDoc} */
@Override public void destroy() {
- compute.run(new IgniteRunnable() {
- @Override public void run() {
- cache().destroy();
- }
- });
+ compute.call(new DestroyTask(cacheName, isAsync));
}
/** {@inheritDoc} */
@Override public boolean isClosed() {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().isClosed();
- }
- });
+ return compute.call(new IsClosedTask(cacheName, isAsync));
}
/** {@inheritDoc} */
- @Override public <T> T unwrap(final Class<T> clazz) {
+ @SuppressWarnings("unchecked")
+ @Override public <T> T unwrap(Class<T> clazz) {
if (Ignite.class.equals(clazz))
return (T)igniteProxy;
try {
- return (T)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return cache().unwrap(clazz);
- }
- });
+ return compute.call(new UnwrapTask<>(cacheName, isAsync, clazz));
}
catch (Exception e) {
- throw new IllegalArgumentException("Looks like class " + clazz + " is unmarshallable. Exception type:" + e.getClass(), e);
+ throw new IllegalArgumentException("Looks like class " + clazz +
+ " is unmarshallable. Exception type:" + e.getClass(), e);
}
}
/** {@inheritDoc} */
- @Override public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {
+ @Override public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> lsnrCfg) {
throw new UnsupportedOperationException("Method should be supported.");
}
/** {@inheritDoc} */
- @Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {
+ @Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> lsnrCfg) {
throw new UnsupportedOperationException("Method should be supported.");
}
/** {@inheritDoc} */
@Override public Iterator<Entry<K, V>> iterator() {
- final Collection<Entry<K, V>> col = (Collection<Entry<K, V>>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- Collection res = new ArrayList();
-
- for (Object o : cache())
- res.add(o);
-
- return res;
- }
- });
-
- return col.iterator();
+ return compute.call(new IteratorTask<K, V>(cacheName, isAsync)).iterator();
}
/** {@inheritDoc} */
@@ -615,4 +421,968 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
@Override public CacheMetricsMXBean mxBean() {
throw new UnsupportedOperationException("Method should be supported.");
}
-}
\ No newline at end of file
+
+ /**
+ *
+ */
+ private static class GetConfigurationTask<K, V, C extends Configuration<K, V>> extends CacheTaskAdapter<K, V, C> {
+ /** Clazz. */
+ private final Class<C> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public GetConfigurationTask(String cacheName, boolean async, Class<C> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public C call() throws Exception {
+ return cache().getConfiguration(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalLoadCacheTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Predicate. */
+ private final IgniteBiPredicate<K, V> p;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param p P.
+ * @param args Args.
+ */
+ public LocalLoadCacheTask(String cacheName, boolean async, IgniteBiPredicate<K, V> p, Object[] args) {
+ super(cacheName, async);
+ this.p = p;
+ this.args = args;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localLoadCache(p, args);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPutIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsLocalLockedTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** By current thread. */
+ private final boolean byCurrThread;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param byCurrThread By current thread.
+ */
+ public IsLocalLockedTask(String cacheName, boolean async, K key, boolean byCurrThread) {
+ super(cacheName, async);
+ this.key = key;
+ this.byCurrThread = byCurrThread;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isLocalLocked(key, byCurrThread);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEntriesTask<K, V> extends CacheTaskAdapter<K, V, Iterable<Entry<K, V>>> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ */
+ public LocalEntriesTask(String cacheName, boolean async, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Iterable<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> e : cache().localEntries(peekModes))
+ res.add(new CacheEntryImpl<>(e.getKey(), e.getValue()));
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEvictTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Collection<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public LocalEvictTask(String cacheName, boolean async, Collection<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localEvict(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalPeekTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param peekModes Peek modes.
+ */
+ public LocalPeekTask(String cacheName, boolean async, K key, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.key = key;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().localPeek(key, peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class SizeTask extends CacheTaskAdapter<Void, Void, Integer> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ * @param loc Local.
+ */
+ public SizeTask(String cacheName, boolean async, CachePeekMode[] peekModes, boolean loc) {
+ super(cacheName, async);
+ this.loc = loc;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ return loc ? cache().localSize(peekModes) : cache().size(peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().get(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public RemoveAllTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ IgniteCache<K, V> cache = cache();
+
+ cache.removeAll();
+
+ if (async)
+ cache.future().get();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().put(key, val);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeyTask<K> extends CacheTaskAdapter<K, Object, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ContainsKeyTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKey(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearTask extends CacheTaskAdapter<Object, Object, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public ClearTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().clear();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IteratorTask<K, V> extends CacheTaskAdapter<K, V, Collection<Entry<K, V>>> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IteratorTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> o : cache())
+ res.add(o);
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public ReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetNameTask extends CacheTaskAdapter<Void, Void, String> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public GetNameTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String call() throws Exception {
+ return cache().getName();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public RemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Map. */
+ private final Map<? extends K, ? extends V> map;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param map Map.
+ */
+ public PutAllTask(String cacheName, boolean async, Map<? extends K, ? extends V> map) {
+ super(cacheName, async);
+ this.map = map;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().putAll(map);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllKeysTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public RemoveAllKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().removeAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAll(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllOutTxTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllOutTxTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAllOutTx(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeysTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ContainsKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKeys(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPut(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().putIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ */
+ public RemoveIfExistsTask(String cacheName, boolean async, K key, V oldVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key, oldVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndRemoveTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetAndRemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndRemove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /** New value. */
+ private final V newVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ * @param newVal New value.
+ */
+ public ReplaceIfExistsTask(String cacheName, boolean async, K key, V oldVal, V newVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ this.newVal = newVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, oldVal, newVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndReplaceTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndReplace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearKeyTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ClearKeyTask(String cacheName, boolean async, boolean loc, K key) {
+ super(cacheName, async);
+ this.key = key;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClear(key);
+ else
+ cache().clear(key);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearAllKeys<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ClearAllKeys(String cacheName, boolean async, boolean loc, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClearAll(keys);
+ else
+ cache().clearAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeTask<K, V, R> extends CacheTaskAdapter<K, V, R> {
+ /** Key. */
+ private final K key;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, R> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeTask(String cacheName, boolean async, K key, EntryProcessor<K, V, R> processor,
+ Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.key = key;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().invoke(key, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeAllTask<K, V, T> extends CacheTaskAdapter<K, V, Map<K, EntryProcessorResult<T>>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, T> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeAllTask(String cacheName, boolean async, Set<? extends K> keys,
+ EntryProcessor<K, V, T> processor, Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.keys = keys;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, EntryProcessorResult<T>> call() throws Exception {
+ return cache().invokeAll(keys, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CloseTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CloseTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().close();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class DestroyTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public DestroyTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().destroy();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsClosedTask extends CacheTaskAdapter<Void, Void, Boolean> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IsClosedTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isClosed();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class UnwrapTask<R> extends CacheTaskAdapter<Void, Void, R> {
+ /** Clazz. */
+ private final Class<R> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public UnwrapTask(String cacheName, boolean async, Class<R> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().unwrap(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static abstract class CacheTaskAdapter<K, V, R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Cache name. */
+ protected final String cacheName;
+
+ /** Async. */
+ protected final boolean async;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CacheTaskAdapter(String cacheName, boolean async) {
+ this.async = async;
+ this.cacheName = cacheName;
+ }
+
+ /**
+ * Returns cache instance.
+ */
+ protected IgniteCache<K, V> cache() {
+ IgniteCache<K, V> cache = ignite.cache(cacheName);
+
+ return async ? cache.withAsync() : cache;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
index 05d6533..633e9d0 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
@@ -26,7 +26,6 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCluster;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.cluster.ClusterNode;
@@ -36,6 +35,7 @@ import org.apache.ignite.internal.cluster.IgniteClusterEx;
import org.apache.ignite.lang.IgniteCallable;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
/**
@@ -43,9 +43,6 @@ import org.jetbrains.annotations.Nullable;
*/
@SuppressWarnings("TransientFieldInNonSerializableClass")
public class IgniteClusterProcessProxy implements IgniteClusterEx {
- /** Grid id. */
- private final UUID gridId;
-
/** Compute. */
private final transient IgniteCompute compute;
@@ -57,21 +54,11 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
*/
public IgniteClusterProcessProxy(IgniteProcessProxy proxy) {
this.proxy = proxy;
- gridId = proxy.getId();
compute = proxy.remoteCompute();
}
- /**
- * Returns cluster instance. Method to be called from closure at another JVM.
- *
- * @return Cache.
- */
- private IgniteClusterEx cluster() {
- return (IgniteClusterEx)Ignition.ignite(gridId).cluster();
- }
-
/** {@inheritDoc} */
- @Override public ClusterGroupEx forSubjectId(final UUID subjId) {
+ @Override public ClusterGroupEx forSubjectId(UUID subjId) {
throw new UnsupportedOperationException("Operation is not supported yet.");
}
@@ -83,11 +70,7 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
/** {@inheritDoc} */
@Override public ClusterNode localNode() {
- return compute.call(new IgniteCallable<ClusterNode>() {
- @Override public ClusterNode call() throws Exception {
- return cluster().localNode();
- }
- });
+ return compute.call(new LocalNodeTask());
}
/** {@inheritDoc} */
@@ -285,38 +268,22 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
/** {@inheritDoc} */
@Override public Collection<ClusterNode> nodes() {
- return compute.call(new IgniteCallable<Collection<ClusterNode>>() {
- @Override public Collection<ClusterNode> call() throws Exception {
- return cluster().nodes();
- }
- });
+ return compute.call(new NodesTask());
}
/** {@inheritDoc} */
- @Override public ClusterNode node(final UUID nid) {
- return compute.call(new IgniteCallable<ClusterNode>() {
- @Override public ClusterNode call() throws Exception {
- return cluster().node(nid);
- }
- });
+ @Override public ClusterNode node(UUID nid) {
+ return compute.call(new NodeTask(nid));
}
/** {@inheritDoc} */
@Override public ClusterNode node() {
- return compute.call(new IgniteCallable<ClusterNode>() {
- @Override public ClusterNode call() throws Exception {
- return cluster().node();
- }
- });
+ return compute.call(new NodeTask(null));
}
/** {@inheritDoc} */
@Override public Collection<String> hostNames() {
- return compute.call(new IgniteCallable<Collection<String>>() {
- @Override public Collection<String> call() throws Exception {
- return cluster().hostNames();
- }
- });
+ return compute.call(new HostNamesTask());
}
/** {@inheritDoc} */
@@ -333,4 +300,70 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
@Nullable @Override public IgniteFuture<?> clientReconnectFuture() {
throw new UnsupportedOperationException("Operation is not supported yet.");
}
+
+ /**
+ *
+ */
+ private static class LocalNodeTask extends ClusterTaskAdapter<ClusterNode> {
+ /** {@inheritDoc} */
+ @Override public ClusterNode call() throws Exception {
+ return cluster().localNode();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class NodesTask extends ClusterTaskAdapter<Collection<ClusterNode>> {
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> call() throws Exception {
+ return cluster().nodes();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class NodeTask extends ClusterTaskAdapter<ClusterNode> {
+ /** Node id. */
+ private final UUID nodeId;
+
+ /**
+ * @param nodeId Node id.
+ */
+ public NodeTask(UUID nodeId) {
+ this.nodeId = nodeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode call() throws Exception {
+ return nodeId == null ? cluster().node() : cluster().node(nodeId);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class HostNamesTask extends ClusterTaskAdapter<Collection<String>> {
+ /** {@inheritDoc} */
+ @Override public Collection<String> call() throws Exception {
+ return cluster().hostNames();
+ }
+ }
+
+ /**
+ *
+ */
+ private abstract static class ClusterTaskAdapter<R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /**
+ *
+ */
+ protected IgniteCluster cluster() {
+ return ignite.cluster();
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
index 860f889..d5af81e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
@@ -20,15 +20,16 @@ package org.apache.ignite.testframework.junits.multijvm;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
+import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteEvents;
import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.events.Event;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
/**
@@ -39,23 +40,11 @@ public class IgniteEventsProcessProxy implements IgniteEvents {
/** Ignite proxy. */
private final transient IgniteProcessProxy igniteProxy;
- /** Grid id. */
- private final UUID gridId;
-
/**
* @param igniteProxy Ignite proxy.
*/
public IgniteEventsProcessProxy(IgniteProcessProxy igniteProxy) {
this.igniteProxy = igniteProxy;
-
- gridId = igniteProxy.getId();
- }
-
- /**
- * @return Events instance.
- */
- private IgniteEvents events() {
- return Ignition.ignite(gridId).events();
}
/** {@inheritDoc} */
@@ -105,11 +94,7 @@ public class IgniteEventsProcessProxy implements IgniteEvents {
/** {@inheritDoc} */
@Override public void localListen(final IgnitePredicate<? extends Event> lsnr, final int... types) {
- igniteProxy.remoteCompute().run(new IgniteRunnable() {
- @Override public void run() {
- events().localListen(lsnr, types);
- }
- });
+ igniteProxy.remoteCompute().run(new LocalListenTask(lsnr, types));
}
/** {@inheritDoc} */
@@ -151,4 +136,33 @@ public class IgniteEventsProcessProxy implements IgniteEvents {
@Override public <R> IgniteFuture<R> future() {
throw new UnsupportedOperationException("Operation isn't supported yet.");
}
+
+ /**
+ *
+ */
+ private static class LocalListenTask implements IgniteRunnable {
+ /** Ignite. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** Listener. */
+ private final IgnitePredicate<? extends Event> lsnr;
+
+ /** Types. */
+ private final int[] types;
+
+ /**
+ * @param lsnr Listener.
+ * @param types Types.
+ */
+ public LocalListenTask(IgnitePredicate<? extends Event> lsnr, int[] types) {
+ this.lsnr = lsnr;
+ this.types = types;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ ignite.events().localListen(lsnr, types);
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
index f46e8e9..0597eda 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
@@ -25,13 +25,12 @@ import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStream;
-import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.Ignition;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
@@ -39,8 +38,9 @@ import org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfT
import org.apache.ignite.internal.util.GridJavaProcess;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.testframework.junits.IgniteTestResources;
import sun.jvmstat.monitor.HostIdentifier;
import sun.jvmstat.monitor.MonitoredHost;
import sun.jvmstat.monitor.MonitoredVm;
@@ -99,30 +99,6 @@ public class IgniteNodeRunner {
public static String storeToFile(IgniteConfiguration cfg) throws IOException {
String fileName = IGNITE_CONFIGURATION_FILE + cfg.getNodeId();
- // Check marshaller configuration, because read configuration method expect specific marshaller.
- if (cfg.getMarshaller() instanceof OptimizedMarshaller){
- OptimizedMarshaller marsh = (OptimizedMarshaller)cfg.getMarshaller();
-
- try {
- Field isRequireFiled = marsh.getClass().getDeclaredField("requireSer");
-
- isRequireFiled.setAccessible(true);
-
- boolean isRequireSer = isRequireFiled.getBoolean(marsh);
-
- if (isRequireSer)
- throw new UnsupportedOperationException("Unsupported marshaller configuration. " +
- "readCfgFromFileAndDeleteFile method expect " + OptimizedMarshaller.class.getSimpleName() +
- "with requireSerializeble flag in 'false'.");
- }
- catch (NoSuchFieldException|IllegalAccessException e) {
- throw new IgniteException("Failed to check filed of " + OptimizedMarshaller.class.getSimpleName(), e);
- }
- }
- else
- throw new UnsupportedOperationException("Unsupported marshaller. " +
- "readCfgFromFileAndDeleteFile method expect " + OptimizedMarshaller.class.getSimpleName());
-
try(OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName))) {
cfg.setMBeanServer(null);
cfg.setMarshaller(null);
@@ -143,11 +119,16 @@ public class IgniteNodeRunner {
* @throws IOException If failed.
* @see #storeToFile(IgniteConfiguration)
*/
- private static IgniteConfiguration readCfgFromFileAndDeleteFile(String fileName) throws IOException {
+ private static IgniteConfiguration readCfgFromFileAndDeleteFile(String fileName)
+ throws IOException, IgniteCheckedException {
try(BufferedReader cfgReader = new BufferedReader(new FileReader(fileName))) {
IgniteConfiguration cfg = (IgniteConfiguration)new XStream().fromXML(cfgReader);
- cfg.setMarshaller(new OptimizedMarshaller(false));
+ Marshaller marsh = IgniteTestResources.getMarshaller();
+
+ cfg.setMarshaller(marsh);
+
+ X.println("Configured marshaller class: " + marsh.getClass().getName());
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(GridCacheAbstractFullApiSelfTest.LOCAL_IP_FINDER);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
index ec7dab7..aa1d470 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
@@ -41,13 +41,11 @@ import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.IgniteIllegalStateException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteMessaging;
-import org.apache.ignite.internal.portable.api.IgnitePortables;
import org.apache.ignite.IgniteQueue;
import org.apache.ignite.IgniteScheduler;
import org.apache.ignite.IgniteServices;
import org.apache.ignite.IgniteSet;
import org.apache.ignite.IgniteTransactions;
-import org.apache.ignite.Ignition;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterNode;
@@ -62,6 +60,7 @@ import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.cluster.IgniteClusterEx;
+import org.apache.ignite.internal.portable.api.IgnitePortables;
import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
import org.apache.ignite.internal.processors.hadoop.Hadoop;
@@ -78,6 +77,8 @@ import org.apache.ignite.lang.IgniteProductVersion;
import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.plugin.IgnitePlugin;
import org.apache.ignite.plugin.PluginNotFoundException;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.testframework.junits.IgniteTestResources;
import org.jetbrains.annotations.Nullable;
/**
@@ -88,6 +89,9 @@ public class IgniteProcessProxy implements IgniteEx {
/** Grid proxies. */
private static final transient ConcurrentMap<String, IgniteProcessProxy> gridProxies = new ConcurrentHashMap<>();
+ /** Property that specify alternative {@code JAVA_HOME}. */
+ private static final String TEST_MULTIJVM_JAVA_HOME = "test.multijvm.java.home";
+
/** Jvm process with ignite instance. */
private final transient GridJavaProcess proc;
@@ -108,7 +112,7 @@ public class IgniteProcessProxy implements IgniteEx {
* @param log Logger.
* @param locJvmGrid Local JVM grid.
*/
- public IgniteProcessProxy(final IgniteConfiguration cfg, final IgniteLogger log, final Ignite locJvmGrid)
+ public IgniteProcessProxy(IgniteConfiguration cfg, IgniteLogger log, Ignite locJvmGrid)
throws Exception {
this.cfg = cfg;
this.locJvmGrid = locJvmGrid;
@@ -121,7 +125,9 @@ public class IgniteProcessProxy implements IgniteEx {
Collection<String> filteredJvmArgs = new ArrayList<>();
for (String arg : jvmArgs) {
- if(!arg.toLowerCase().startsWith("-agentlib"))
+ if(arg.startsWith("-Xmx") || arg.startsWith("-Xms") ||
+ arg.startsWith("-cp") || arg.startsWith("-classpath") ||
+ arg.startsWith("-D" + IgniteTestResources.MARSH_CLASS_NAME))
filteredJvmArgs.add(arg);
}
@@ -130,7 +136,7 @@ public class IgniteProcessProxy implements IgniteEx {
locJvmGrid.events().localListen(new NodeStartedListener(id, rmtNodeStartedLatch), EventType.EVT_NODE_JOINED);
proc = GridJavaProcess.exec(
- IgniteNodeRunner.class,
+ IgniteNodeRunner.class.getCanonicalName(),
cfgFileName, // Params.
this.log,
// Optional closure to be called each time wrapped process prints line to system.out or system.err.
@@ -140,6 +146,7 @@ public class IgniteProcessProxy implements IgniteEx {
}
},
null,
+ System.getProperty(TEST_MULTIJVM_JAVA_HOME),
filteredJvmArgs, // JVM Args.
System.getProperty("surefire.test.class.path")
);
@@ -149,11 +156,7 @@ public class IgniteProcessProxy implements IgniteEx {
IgniteProcessProxy prevVal = gridProxies.putIfAbsent(cfg.getGridName(), this);
if (prevVal != null) {
- remoteCompute().run(new IgniteRunnable() {
- @Override public void run() {
- G.stop(cfg.getGridName(), true);
- }
- });
+ remoteCompute().run(new StopGridTask(cfg.getGridName(), true));
throw new IllegalStateException("There was found instance assotiated with " + cfg.getGridName() +
", instance= " + prevVal + ". New started node was stopped.");
@@ -208,30 +211,17 @@ public class IgniteProcessProxy implements IgniteEx {
* @param gridName Grid name.
* @param cancel Cacnel flag.
*/
- public static void stop(final String gridName, final boolean cancel) {
+ public static void stop(String gridName, boolean cancel) {
IgniteProcessProxy proxy = gridProxies.get(gridName);
if (proxy != null) {
- proxy.remoteCompute().run(new IgniteRunnable() {
- @Override public void run() {
- G.stop(gridName, cancel);
- }
- });
+ proxy.remoteCompute().run(new StopGridTask(gridName, cancel));
gridProxies.remove(gridName, proxy);
}
}
/**
- * For usage in closures.
- *
- * @return Ignite instance.
- */
- private Ignite igniteById() {
- return Ignition.ignite(id);
- }
-
- /**
* @param locNodeId ID of local node the requested grid instance is managing.
* @return An instance of named grid. This method never returns {@code null}.
* @throws IgniteIllegalStateException Thrown if grid was not properly initialized or grid instance was stopped or
@@ -357,11 +347,7 @@ public class IgniteProcessProxy implements IgniteEx {
/** {@inheritDoc} */
@Override public ClusterNode localNode() {
- return remoteCompute().call(new IgniteCallable<ClusterNode>() {
- @Override public ClusterNode call() throws Exception {
- return ((IgniteEx)Ignition.ignite(id)).localNode();
- }
- });
+ return remoteCompute().call(new NodeTask());
}
/** {@inheritDoc} */
@@ -467,7 +453,10 @@ public class IgniteProcessProxy implements IgniteEx {
}
/** {@inheritDoc} */
- @Override public <K, V> IgniteCache<K, V> createNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) {
+ @Override public <K, V> IgniteCache<K, V> createNearCache(
+ @Nullable String cacheName,
+ NearCacheConfiguration<K, V> nearCfg)
+ {
throw new UnsupportedOperationException("Operation isn't supported yet.");
}
@@ -508,7 +497,8 @@ public class IgniteProcessProxy implements IgniteEx {
}
/** {@inheritDoc} */
- @Override public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create) throws IgniteException {
+ @Override public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
+ throws IgniteException {
throw new UnsupportedOperationException("Operation isn't supported yet.");
}
@@ -524,8 +514,12 @@ public class IgniteProcessProxy implements IgniteEx {
}
/** {@inheritDoc} */
- @Override public <T, S> IgniteAtomicStamped<T, S> atomicStamped(String name, @Nullable T initVal, @Nullable S initStamp,
- boolean create) throws IgniteException {
+ @Override public <T, S> IgniteAtomicStamped<T, S> atomicStamped(
+ String name,
+ @Nullable T initVal,
+ @Nullable S initStamp,
+ boolean create) throws IgniteException
+ {
throw new UnsupportedOperationException("Operation isn't supported yet.");
}
@@ -572,11 +566,7 @@ public class IgniteProcessProxy implements IgniteEx {
}
}, EventType.EVT_NODE_LEFT, EventType.EVT_NODE_FAILED);
- compute().run(new IgniteRunnable() {
- @Override public void run() {
- igniteById().close();
- }
- });
+ compute().run(new StopGridTask(localJvmGrid().name(), true));
try {
assert U.await(rmtNodeStoppedLatch, 15, TimeUnit.SECONDS) : "NodeId=" + id;
@@ -616,4 +606,43 @@ public class IgniteProcessProxy implements IgniteEx {
return locJvmGrid.compute(grp);
}
+
+ /**
+ *
+ */
+ private static class StopGridTask implements IgniteRunnable {
+ /** Grid name. */
+ private final String gridName;
+
+ /** Cancel. */
+ private final boolean cancel;
+
+ /**
+ * @param gridName Grid name.
+ * @param cancel Cancel.
+ */
+ public StopGridTask(String gridName, boolean cancel) {
+ this.gridName = gridName;
+ this.cancel = cancel;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ G.stop(gridName, cancel);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class NodeTask implements IgniteCallable<ClusterNode> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode call() throws Exception {
+ return ((IgniteEx)ignite).localNode();
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationP2PTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationP2PTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationP2PTest.java
index 5298dd4..3777154 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationP2PTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationP2PTest.java
@@ -103,6 +103,7 @@ public class CacheConfigurationP2PTest extends GridCommonAbstractTest {
}
},
null,
+ null,
jvmArgs,
null
);
@@ -119,6 +120,7 @@ public class CacheConfigurationP2PTest extends GridCommonAbstractTest {
}
},
null,
+ null,
jvmArgs,
null
);
@@ -139,6 +141,7 @@ public class CacheConfigurationP2PTest extends GridCommonAbstractTest {
}
},
null,
+ null,
jvmArgs,
cp
);
[03/17] ignite git commit: skip deployment of schema-import demo
(cherry picked from commit 656b118)
Posted by ag...@apache.org.
skip deployment of schema-import demo
(cherry picked from commit 656b118)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b64a8282
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b64a8282
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b64a8282
Branch: refs/heads/master
Commit: b64a828203f94df03f57b66d74bc998f6787ab7b
Parents: e5e72ea
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 25 10:54:22 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 25 11:01:43 2015 +0300
----------------------------------------------------------------------
examples/schema-import/pom.xml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b64a8282/examples/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 05de048..46bc83e 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -20,7 +20,8 @@
<!--
POM file.
-->
-<project xmlns="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">
+<project xmlns="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">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -88,6 +89,14 @@
<target>1.7</target>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
[16/17] ignite git commit: ignite-1.4.2 - Fixed resource cleanup for
caches created from template.
Posted by ag...@apache.org.
ignite-1.4.2 - Fixed resource cleanup for caches created from template.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/30b731b3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/30b731b3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/30b731b3
Branch: refs/heads/master
Commit: 30b731b3c54609b77293e08c401db2d96e48e8d9
Parents: 94f549f
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Oct 12 16:09:59 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Oct 12 16:09:59 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 23 ++++++++++-----
.../IgniteCacheConfigurationTemplateTest.java | 31 ++++++++++++++++++++
2 files changed, 46 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/30b731b3/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 8c96c0c..722e570 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
@@ -639,7 +639,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (ctx.config().isDaemon() && !CU.isMarshallerCache(cfgs[i].getName()))
continue;
- checkSerializable(cfgs[i]);
+ cloneCheckSerializable(cfgs[i]);
CacheConfiguration<?, ?> cfg = new CacheConfiguration(cfgs[i]);
@@ -2023,9 +2023,14 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @return Future that will be completed when cache is deployed.
*/
public IgniteInternalFuture<?> createFromTemplate(String cacheName) {
- CacheConfiguration cfg = createConfigFromTemplate(cacheName);
+ try {
+ CacheConfiguration cfg = createConfigFromTemplate(cacheName);
- return dynamicStartCache(cfg, cacheName, null, true, true);
+ return dynamicStartCache(cfg, cacheName, null, true, true);
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/**
@@ -2052,7 +2057,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @param cacheName Cache name.
* @return Cache configuration.
*/
- private CacheConfiguration createConfigFromTemplate(String cacheName) {
+ private CacheConfiguration createConfigFromTemplate(String cacheName) throws IgniteCheckedException {
CacheConfiguration cfgTemplate = null;
CacheConfiguration dfltCacheCfg = null;
@@ -2112,6 +2117,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (cfgTemplate == null)
cfgTemplate = new CacheConfiguration();
+ else
+ cfgTemplate = cloneCheckSerializable(cfgTemplate);
CacheConfiguration cfg = new CacheConfiguration(cfgTemplate);
@@ -2168,7 +2175,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (ccfg != null) {
try {
- checkSerializable(ccfg);
+ cloneCheckSerializable(ccfg);
}
catch (IgniteCheckedException e) {
return new GridFinishedFuture<>(e);
@@ -3340,9 +3347,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @param val Object to check.
* @throws IgniteCheckedException If validation failed.
*/
- private void checkSerializable(CacheConfiguration val) throws IgniteCheckedException {
+ private CacheConfiguration cloneCheckSerializable(CacheConfiguration val) throws IgniteCheckedException {
if (val == null)
- return;
+ return null;
if (val.getCacheStoreFactory() != null) {
try {
@@ -3356,7 +3363,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
try {
- marshaller.unmarshal(marshaller.marshal(val), val.getClass().getClassLoader());
+ return marshaller.unmarshal(marshaller.marshal(val), val.getClass().getClassLoader());
}
catch (IgniteCheckedException e) {
throw new IgniteCheckedException("Failed to validate cache configuration " +
http://git-wip-us.apache.org/repos/asf/ignite/blob/30b731b3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
index d3ba2d6..87a30a6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheExistsException;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.events.Event;
@@ -365,6 +366,36 @@ public class IgniteCacheConfigurationTemplateTest extends GridCommonAbstractTest
}
/**
+ * @throws Exception If failed.
+ */
+ public void testTemplateCleanup() throws Exception {
+ startGridsMultiThreaded(3);
+
+ try {
+ CacheConfiguration ccfg = new CacheConfiguration("affTemplate-*");
+
+ ccfg.setAffinity(new RendezvousAffinityFunction());
+
+ ignite(0).addCacheConfiguration(ccfg);
+
+ ignite(0).getOrCreateCache("affTemplate-1");
+
+ IgniteCache<Object, Object> cache = ignite(0).getOrCreateCache("affTemplate-2");
+
+ ignite(0).destroyCache("affTemplate-1");
+
+ startGrid(3);
+
+ cache.put(1, 1);
+
+ assertEquals(1, cache.get(1));
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
* @param ignite Ignite.
* @param name Cache name.
* @param expBackups Expected number of backups.
[09/17] ignite git commit: Minor fixes + some debug statements in
scope of slow rebalancing investigation.
Posted by ag...@apache.org.
Minor fixes + some debug statements in scope of slow rebalancing investigation.
Squashed commit of the following:
commit ee4e65088114fd1e2dfa229f0853551c1ecb5e1d
Author: Alexey Goncharuk <al...@gmail.com>
Date: Thu Oct 1 14:45:36 2015 +0300
debug
commit 4d61a0f0c95b16f701993e5a3131ebdcf1beb67c
Author: Alexey Goncharuk <al...@gmail.com>
Date: Thu Oct 1 13:07:40 2015 +0300
debug
commit 663a2d993b9750b34eb8eef89cebf5cea4db8c6d
Author: Yakov Zhdanov <yz...@gridgain.com>
Date: Wed Sep 30 19:21:58 2015 +0300
debugging rebalance
commit 79bc2eb077cb3a8175c25864f2cebdc074372057
Author: Denis Magda <dm...@gridgain.com>
Date: Wed Sep 30 12:33:54 2015 +0300
slow rebalancing
commit a950de96624dcef64b6e8935c4f82ef7629035b3
Author: Denis Magda <dm...@gridgain.com>
Date: Wed Sep 30 12:30:47 2015 +0300
slow rebalancing
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f95be25
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f95be25
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f95be25
Branch: refs/heads/master
Commit: 4f95be256fc49d3d2d58076adb3e2d213822e24c
Parents: 6e3d1b1
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Oct 5 11:26:10 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Oct 5 11:26:10 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 20 ++-
.../GridDhtPartitionDemandMessage.java | 3 +-
.../GridDhtPartitionSupplyMessage.java | 3 +-
.../GridDhtPartitionsExchangeFuture.java | 16 ++-
.../preloader/GridDhtPartitionsFullMessage.java | 13 +-
.../GridDhtPartitionsSingleMessage.java | 11 +-
.../communication/tcp/TcpCommunicationSpi.java | 22 ++-
.../dht/GridCacheDhtPreloadPerformanceTest.java | 133 +++++++++++++++++++
8 files changed, 193 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 421ec82..4000bbf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -28,6 +28,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
@@ -923,9 +924,12 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
", old=" + clsHandlers.get(key) + ", new=" + c + ']';
}
- if (log != null && log.isDebugEnabled())
- log.debug("Registered cache communication handler [cacheId=" + cacheId + ", type=" + type +
- ", msgIdx=" + msgIdx + ", handler=" + c + ']');
+ IgniteLogger log0 = log;
+
+ if (log0 != null && log0.isTraceEnabled())
+ log0.trace(
+ "Registered cache communication handler [cacheId=" + cacheId + ", type=" + type +
+ ", msgIdx=" + msgIdx + ", handler=" + c + ']');
}
/**
@@ -978,15 +982,17 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
*/
@SuppressWarnings({"unchecked"})
public void addOrderedHandler(Object topic, IgniteBiInClosure<UUID, ? extends GridCacheMessage> c) {
+ IgniteLogger log0 = log;
+
if (orderedHandlers.putIfAbsent(topic, c) == null) {
cctx.gridIO().addMessageListener(topic, new OrderedMessageListener(
(IgniteBiInClosure<UUID, GridCacheMessage>)c));
- if (log != null && log.isDebugEnabled())
- log.debug("Registered ordered cache communication handler [topic=" + topic + ", handler=" + c + ']');
+ if (log0 != null && log0.isTraceEnabled())
+ log0.trace("Registered ordered cache communication handler [topic=" + topic + ", handler=" + c + ']');
}
- else if (log != null)
- U.warn(log, "Failed to register ordered cache communication handler because it is already " +
+ else if (log0 != null)
+ U.warn(log0, "Failed to register ordered cache communication handler because it is already " +
"registered for this topic [topic=" + topic + ", handler=" + c + ']');
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index b588372..863ec8f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -45,7 +45,6 @@ public class GridDhtPartitionDemandMessage extends GridCacheMessage {
private long updateSeq;
/** Partition. */
- @GridToStringInclude
@GridDirectCollection(int.class)
private Collection<Integer> parts;
@@ -330,4 +329,4 @@ public class GridDhtPartitionDemandMessage extends GridCacheMessage {
return S.toString(GridDhtPartitionDemandMessage.class, this, "partCnt", parts.size(), "super",
super.toString());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index 3ccc5ae..cf10a13 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -404,7 +404,6 @@ public class GridDhtPartitionSupplyMessage extends GridCacheMessage implements G
@Override public String toString() {
return S.toString(GridDhtPartitionSupplyMessage.class, this,
"size", size(),
- "parts", infos.keySet(),
"super", super.toString());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/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 a1b03c1..eaa5584 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
@@ -475,6 +475,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
busyLock.readLock().unlock();
}
+ // TODO remove
+ long inited;
+
/**
* Starts activity.
*
@@ -488,6 +491,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (isDone())
return;
+ inited = U.currentTimeMillis();
+
try {
// Wait for event to occur to make sure that discovery
// will return corresponding nodes.
@@ -800,7 +805,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
for (Map.Entry<IgniteTxKey, Collection<GridCacheMvccCandidate>> e : locks.entrySet())
U.warn(log, "Awaited locked entry [key=" + e.getKey() + ", mvcc=" + e.getValue() + ']');
-
+
dumpedObjects++;
}
}
@@ -1059,7 +1064,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (super.onDone(res, err) && !dummy && !forcePreload) {
if (log.isDebugEnabled())
- log.debug("Completed partition exchange [localNode=" + cctx.localNodeId() + ", exchange= " + this + ']');
+ log.debug("Completed partition exchange [localNode=" + cctx.localNodeId() + ", exchange= " + this +
+ "duration=" + duration() + ", durationFromInit=" + (U.currentTimeMillis() - inited) + ']');
initFut.onDone(err == null);
@@ -1190,6 +1196,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (match) {
boolean allReceived;
+ long start = U.currentTimeMillis();
+
synchronized (rcvdIds) {
if (rcvdIds.add(nodeId))
updatePartitionSingleMap(msg);
@@ -1197,6 +1205,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
allReceived = allReceived();
}
+ long end = U.currentTimeMillis();
+
// If got all replies, and initialization finished, and reply has not been sent yet.
if (allReceived && ready.get() && replied.compareAndSet(false, true)) {
spreadPartitions();
@@ -1206,7 +1216,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
else if (log.isDebugEnabled())
log.debug("Exchange future full map is not sent [allReceived=" + allReceived() +
", ready=" + ready + ", replied=" + replied.get() + ", init=" + init.get() +
- ", fut=" + this + ']');
+ ", fut=" + GridDhtPartitionsExchangeFuture.this + ", updateDur=" + (end - start) + ']');
}
}
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index b91a2de..5429538 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -43,7 +43,7 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
/** */
@GridToStringInclude
@GridDirectTransient
- private Map<Integer, GridDhtPartitionFullMap> parts = new HashMap<>();
+ private Map<Integer, GridDhtPartitionFullMap> parts;
/** */
private byte[] partsBytes;
@@ -68,7 +68,6 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
@NotNull AffinityTopologyVersion topVer) {
super(id, lastVer);
- assert parts != null;
assert id == null || topVer.equals(id.topologyVersion());
this.topVer = topVer;
@@ -86,6 +85,9 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
* @param fullMap Full partitions map.
*/
public void addFullPartitionsMap(int cacheId, GridDhtPartitionFullMap fullMap) {
+ if (parts == null)
+ parts = new HashMap<>();
+
if (!parts.containsKey(cacheId))
parts.put(cacheId, fullMap);
}
@@ -95,7 +97,7 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
@Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
- if (parts != null)
+ if (parts != null && partsBytes == null)
partsBytes = ctx.marshaller().marshal(parts);
}
@@ -117,7 +119,7 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
@Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
super.finishUnmarshal(ctx, ldr);
- if (partsBytes != null)
+ if (partsBytes != null && parts == null)
parts = ctx.marshaller().unmarshal(partsBytes, ldr);
}
@@ -200,4 +202,5 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
return S.toString(GridDhtPartitionsFullMessage.class, this, "partCnt", parts != null ? parts.size() : 0,
"super", super.toString());
}
-}
\ No newline at end of file
+}
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
index 9b6dcf7..83fbb1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
@@ -41,7 +41,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
/** Local partitions. */
@GridToStringInclude
@GridDirectTransient
- private Map<Integer, GridDhtPartitionMap> parts = new HashMap<>();
+ private Map<Integer, GridDhtPartitionMap> parts;
/** Serialized partitions. */
private byte[] partsBytes;
@@ -83,6 +83,9 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
* @param locMap Local partition map.
*/
public void addLocalPartitionMap(int cacheId, GridDhtPartitionMap locMap) {
+ if (parts == null)
+ parts = new HashMap<>();
+
parts.put(cacheId, locMap);
}
@@ -98,7 +101,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
@Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
- if (parts != null)
+ if (partsBytes == null && parts != null)
partsBytes = ctx.marshaller().marshal(parts);
}
@@ -106,7 +109,7 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
@Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
super.finishUnmarshal(ctx, ldr);
- if (partsBytes != null)
+ if (partsBytes != null && parts == null)
parts = ctx.marshaller().unmarshal(partsBytes, ldr);
}
@@ -188,4 +191,4 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
@Override public String toString() {
return S.toString(GridDhtPartitionsSingleMessage.class, this, super.toString());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index c93d5af..5ea2c02 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -2050,11 +2050,21 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
if (locNode == null)
throw new IgniteCheckedException("Failed to create NIO client (local node is stopping)");
+ if (log.isDebugEnabled())
+ log.debug("Creating NIO client to node: " + node);
+
// If remote node has shared memory server enabled and has the same set of MACs
// then we are likely to run on the same host and shared memory communication could be tried.
if (shmemPort != null && U.sameMacs(locNode, node)) {
try {
- return createShmemClient(node, shmemPort);
+ GridCommunicationClient client = createShmemClient(
+ node,
+ shmemPort);
+
+ if (log.isDebugEnabled())
+ log.debug("Shmem client created: " + client);
+
+ return client;
}
catch (IgniteCheckedException e) {
if (e.hasCause(IpcOutOfSystemResourcesException.class))
@@ -2071,7 +2081,12 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
connectGate.enter();
try {
- return createTcpClient(node);
+ GridCommunicationClient client = createTcpClient(node);
+
+ if (log.isDebugEnabled())
+ log.debug("TCP client created: " + client);
+
+ return client;
}
finally {
connectGate.leave();
@@ -2453,9 +2468,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
throw errs;
}
- if (log.isDebugEnabled())
- log.debug("Created client: " + client);
-
return client;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4f95be25/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPerformanceTest.java
new file mode 100644
index 0000000..8b68829
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadPerformanceTest.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheRebalanceMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Test cases for partitioned cache {@link GridDhtPreloader preloader}.
+ */
+public class GridCacheDhtPreloadPerformanceTest extends GridCommonAbstractTest {
+ /** */
+ private static final int THREAD_CNT = 30;
+
+ /** IP finder. */
+ private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration c = super.getConfiguration(gridName);
+
+ CacheConfiguration cc = defaultCacheConfiguration();
+
+ cc.setCacheMode(
+ CacheMode.PARTITIONED);
+ cc.setWriteSynchronizationMode(
+ CacheWriteSynchronizationMode.FULL_SYNC);
+ cc.setRebalanceMode(
+ CacheRebalanceMode.SYNC);
+ cc.setAffinity(new RendezvousAffinityFunction(false, 1300));
+ cc.setBackups(2);
+
+ CacheConfiguration cc1 = defaultCacheConfiguration();
+
+ cc1.setName("cc1");
+ cc1.setCacheMode(
+ CacheMode.PARTITIONED);
+ cc1.setWriteSynchronizationMode(
+ CacheWriteSynchronizationMode.FULL_SYNC);
+ cc1.setRebalanceMode(
+ CacheRebalanceMode.SYNC);
+ cc1.setAffinity(
+ new RendezvousAffinityFunction(
+ false,
+ 1300));
+ cc1.setBackups(2);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+
+ c.setDiscoverySpi(disco);
+
+ c.setIgfsThreadPoolSize(1);
+ c.setSystemThreadPoolSize(2);
+ c.setPublicThreadPoolSize(2);
+ c.setManagementThreadPoolSize(1);
+ c.setUtilityCachePoolSize(2);
+ c.setPeerClassLoadingThreadPoolSize(1);
+
+ c.setCacheConfiguration(cc, cc1);
+
+ TcpCommunicationSpi comm = new TcpCommunicationSpi();
+
+ comm.setSharedMemoryPort(-1);
+
+ c.setCommunicationSpi(comm);
+
+ return c;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testConcurrentStartPerformance() throws Exception {
+//
+// for (int i = 0; i < 10; i++) {
+// try {
+// startGrid(1);
+// startGrid(2);
+// startGrid(3);
+// }
+// finally {
+// G.stopAll(true);
+// }
+// }
+
+ multithreaded(
+ new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ long start = U.currentTimeMillis();
+
+ Ignite grid = startGrid(Thread.currentThread().getName());
+
+ System.out.println(
+ ">>> Time to start: " + (U.currentTimeMillis() - start) +
+ ", topSize=" + grid.cluster().nodes().size());
+
+ return null;
+ }
+ },
+ THREAD_CNT);
+ }
+}
[06/17] ignite git commit: IGNITE-1554 Fix igniterouter scripts.
Posted by ag...@apache.org.
IGNITE-1554 Fix igniterouter scripts.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1597e6ca
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1597e6ca
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1597e6ca
Branch: refs/heads/master
Commit: 1597e6ca1cf9a3b59b035b0c013aa6d26c8064a1
Parents: ff96888
Author: Raul Kripalani <ra...@apache.org>
Authored: Sat Sep 26 11:31:11 2015 +0100
Committer: Raul Kripalani <ra...@apache.org>
Committed: Sat Sep 26 11:33:13 2015 +0100
----------------------------------------------------------------------
bin/igniterouter.bat | 2 +-
bin/igniterouter.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1597e6ca/bin/igniterouter.bat
----------------------------------------------------------------------
diff --git a/bin/igniterouter.bat b/bin/igniterouter.bat
index b1f9148..0a9775e 100644
--- a/bin/igniterouter.bat
+++ b/bin/igniterouter.bat
@@ -27,7 +27,7 @@ if "%OS%" == "Windows_NT" setlocal
:: Set router service environment.
::
set "DEFAULT_CONFIG=config\router\default-router.xml"
-set MAIN_CLASS=org.apache.ignite.client.router.impl.GridRouterCommandLineStartup
+set MAIN_CLASS=org.apache.ignite.internal.client.router.impl.GridRouterCommandLineStartup
::
:: Start router service.
http://git-wip-us.apache.org/repos/asf/ignite/blob/1597e6ca/bin/igniterouter.sh
----------------------------------------------------------------------
diff --git a/bin/igniterouter.sh b/bin/igniterouter.sh
index 9ab848e..af27f8b 100755
--- a/bin/igniterouter.sh
+++ b/bin/igniterouter.sh
@@ -45,7 +45,7 @@ setIgniteHome
# Set router service environment.
#
export DEFAULT_CONFIG=config/router/default-router.xml
-export MAIN_CLASS=org.apache.ignite.client.router.impl.GridRouterCommandLineStartup
+export MAIN_CLASS=org.apache.ignite.internal.client.router.impl.GridRouterCommandLineStartup
#
# Start router service.
[13/17] ignite git commit: Merge branch master into ignite-1.4.2
Posted by ag...@apache.org.
Merge branch master into ignite-1.4.2
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4ee154c8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4ee154c8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4ee154c8
Branch: refs/heads/master
Commit: 4ee154c808ac0d7384cdfc0dfc5c1ef5733e7e1b
Parents: 6afc2fc 1223525
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Oct 12 12:28:00 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Oct 12 12:28:00 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
examples/schema-import/pom.xml | 5 +-
.../computegrid/ComputeClosureExample.java | 2 +-
.../socket/WordsSocketStreamerServer.java | 5 +-
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/README.txt | 33 +
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
.../JettyRestProcessorAbstractSelfTest.java | 252 ++++-
modules/cloud/pom.xml | 2 +-
.../TcpDiscoveryCloudIpFinderSelfTest.java | 2 +
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../org/apache/ignite/IgniteAtomicLong.java | 15 +-
.../apache/ignite/IgniteAtomicReference.java | 9 +-
.../org/apache/ignite/IgniteAtomicSequence.java | 9 +-
.../org/apache/ignite/IgniteAtomicStamped.java | 13 +-
.../org/apache/ignite/IgniteFileSystem.java | 4 +-
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../configuration/CacheConfiguration.java | 2 +-
.../ignite/configuration/TopologyValidator.java | 38 +-
.../java/org/apache/ignite/igfs/IgfsPath.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 70 +-
.../managers/discovery/CustomEventListener.java | 4 +-
.../discovery/GridDiscoveryManager.java | 541 ++++++++++-
.../cache/DynamicCacheChangeRequest.java | 19 +
.../cache/DynamicCacheDescriptor.java | 36 +
.../processors/cache/GridCacheContext.java | 2 +-
.../processors/cache/GridCacheEventManager.java | 12 +-
.../cache/GridCacheExplicitLockSpan.java | 13 +-
.../processors/cache/GridCacheIoManager.java | 76 +-
.../processors/cache/GridCacheMessage.java | 7 -
.../cache/GridCacheMvccCandidate.java | 5 +-
.../processors/cache/GridCacheMvccManager.java | 67 +-
.../GridCachePartitionExchangeManager.java | 92 +-
.../processors/cache/GridCacheProcessor.java | 157 ++-
.../cache/GridCacheSharedContext.java | 32 -
.../processors/cache/GridCacheSwapManager.java | 4 +-
.../processors/cache/GridCacheUtils.java | 8 -
.../distributed/GridDistributedCacheEntry.java | 2 +-
.../dht/GridDhtAffinityAssignmentRequest.java | 5 -
.../dht/GridDhtAffinityAssignmentResponse.java | 5 -
.../cache/distributed/dht/GridDhtGetFuture.java | 4 +-
.../distributed/dht/GridDhtLockRequest.java | 10 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 5 -
.../distributed/dht/GridDhtTxPrepareFuture.java | 6 +-
.../dht/GridDhtTxPrepareRequest.java | 7 +-
.../dht/GridPartitionedGetFuture.java | 5 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 5 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 17 +-
.../dht/colocated/GridDhtColocatedCache.java | 12 +-
.../colocated/GridDhtColocatedLockFuture.java | 27 +-
.../dht/preloader/GridDhtForceKeysRequest.java | 5 -
.../dht/preloader/GridDhtForceKeysResponse.java | 5 -
.../GridDhtPartitionDemandMessage.java | 5 -
.../GridDhtPartitionSupplyMessage.java | 5 -
.../GridDhtPartitionsAbstractMessage.java | 5 -
.../dht/preloader/GridDhtPreloader.java | 8 +-
.../distributed/near/GridNearGetFuture.java | 2 +
.../distributed/near/GridNearLockFuture.java | 11 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 24 +-
.../near/GridNearTxFinishFuture.java | 4 +-
.../cache/distributed/near/GridNearTxLocal.java | 21 +-
.../cache/local/GridLocalCacheEntry.java | 2 +-
.../cache/query/GridCacheQueryManager.java | 74 +-
.../cache/query/GridCacheSqlIndexMetadata.java | 7 +-
.../cache/query/GridCacheSqlMetadata.java | 22 +-
.../continuous/CacheContinuousQueryHandler.java | 10 +-
.../transactions/IgniteTxLocalAdapter.java | 35 +-
.../continuous/GridContinuousProcessor.java | 17 +-
.../datastructures/DataStructuresProcessor.java | 54 +-
.../internal/processors/igfs/IgfsFileInfo.java | 15 +-
.../internal/processors/igfs/IgfsImpl.java | 208 +---
.../processors/igfs/IgfsMetaManager.java | 594 ++++++++++--
.../processors/rest/GridRestCommand.java | 8 +-
.../processors/rest/GridRestProcessor.java | 411 +++++++-
.../handlers/cache/GridCacheCommandHandler.java | 364 +++----
.../handlers/query/QueryCommandHandler.java | 195 ++--
.../top/GridTopologyCommandHandler.java | 160 ++-
.../rest/request/RestQueryRequest.java | 175 ++++
.../rest/request/RestSqlQueryRequest.java | 125 ---
.../ignite/internal/util/GridArgumentCheck.java | 5 +-
.../ignite/internal/util/IgniteUtils.java | 2 +-
.../util/nio/GridNioRecoveryDescriptor.java | 4 +-
.../org/apache/ignite/stream/StreamAdapter.java | 104 +-
.../stream/StreamMultipleTupleExtractor.java | 38 +
.../stream/StreamSingleTupleExtractor.java | 40 +
.../ignite/stream/StreamTupleExtractor.java | 20 +-
.../ignite/stream/socket/SocketStreamer.java | 3 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../ignite/igfs/IgfsFragmentizerSelfTest.java | 2 +-
.../internal/GridUpdateNotifierSelfTest.java | 1 +
.../IgniteClientReconnectAbstractTest.java | 35 +-
.../IgniteClientReconnectCacheTest.java | 154 +++
.../GridDiscoveryManagerAliveCacheSelfTest.java | 2 +
.../processors/cache/CrossCacheLockTest.java | 142 +++
.../GridCacheAbstractFailoverSelfTest.java | 3 +
.../GridCacheAbstractRemoveFailureTest.java | 3 +
.../GridCacheDeploymentOffHeapSelfTest.java | 15 +
.../GridCacheFinishPartitionsSelfTest.java | 5 +-
.../GridCacheVariableTopologySelfTest.java | 3 +-
...IgniteCacheAtomicPutAllFailoverSelfTest.java | 4 +
.../cache/IgniteCacheCreateRestartSelfTest.java | 3 +
.../cache/IgniteCacheEntryListenerTxTest.java | 4 +
.../IgniteCacheP2pUnmarshallingErrorTest.java | 7 +
...CacheP2pUnmarshallingRebalanceErrorTest.java | 12 +-
.../cache/IgniteCachePutAllRestartTest.java | 4 +-
.../cache/IgniteDynamicCacheFilterTest.java | 150 +++
.../IgniteTxExceptionAbstractSelfTest.java | 3 +
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 -
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 9 +-
...artitionedOffHeapValuesQueueApiSelfTest.java | 4 +
...PartitionedQueueCreateMultiNodeSelfTest.java | 16 +-
...nedQueueFailoverDataConsistencySelfTest.java | 5 -
...GridCachePartitionedSetFailoverSelfTest.java | 4 +
...acheAsyncOperationsFailoverAbstractTest.java | 11 +
.../CacheGetFutureHangsSelfTest.java | 159 ++-
.../CachePutAllFailoverAbstractTest.java | 11 +
.../IgniteCacheAtomicNodeRestartTest.java | 8 +
...niteCacheClientNodeChangingTopologyTest.java | 6 +-
.../IgniteCacheCreatePutMultiNodeSelfTest.java | 151 +++
.../distributed/IgniteCacheCreatePutTest.java | 125 +++
.../IgniteCachePutGetRestartAbstractTest.java | 3 +
.../IgniteCacheSizeFailoverTest.java | 3 +
.../IgniteTxPreloadAbstractTest.java | 43 +-
.../GridCacheColocatedTxExceptionSelfTest.java | 5 -
.../dht/GridNearCacheTxNodeFailureSelfTest.java | 4 +
...gniteAtomicLongChangingTopologySelfTest.java | 186 +++-
.../IgniteCacheCrossCacheTxFailoverTest.java | 3 +
.../IgniteCrossCacheTxNearEnabledSelfTest.java | 28 +
.../dht/IgniteCrossCacheTxSelfTest.java | 213 ++++
...ledFairAffinityMultiNodeFullApiSelfTest.java | 4 +
.../near/GridCacheNearTxExceptionSelfTest.java | 9 +-
.../near/NearCacheMultithreadedUpdateTest.java | 217 +++++
.../GridCacheReplicatedInvalidateSelfTest.java | 249 -----
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 -
.../replicated/GridReplicatedTxPreloadTest.java | 2 -
...eCacheExpiryPolicyWithStoreAbstractTest.java | 5 +-
.../GridCacheLocalTxExceptionSelfTest.java | 5 -
...bledFairAffinityMultiJvmFullApiSelfTest.java | 5 +
...tomicNearEnabledMultiJvmFullApiSelfTest.java | 5 +
.../DataStreamerMultiThreadedSelfTest.java | 4 +-
.../DataStreamerMultinodeCreateCacheTest.java | 2 +
.../processors/igfs/IgfsAbstractSelfTest.java | 378 ++++++--
.../igfs/IgfsClientCacheSelfTest.java | 15 +-
.../igfs/IgfsMetaManagerSelfTest.java | 100 +-
.../processors/igfs/IgfsMetricsSelfTest.java | 2 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 29 +-
.../igfs/UniversalFileSystemAdapter.java | 1 -
.../tcp/TcpClientDiscoverySpiSelfTest.java | 2 +
.../stream/socket/SocketStreamerSelfTest.java | 112 ++-
.../multijvm/IgniteCacheProcessProxy.java | 965 +++++++++++++++++++
.../IgniteCacheFailoverTestSuite.java | 4 -
.../IgniteCacheFailoverTestSuite3.java | 28 +-
.../testsuites/IgniteCacheTestSuite3.java | 2 -
.../testsuites/IgniteCacheTestSuite4.java | 22 +
modules/extdata/p2p/pom.xml | 2 +-
.../extdata/uri/modules/uri-dependency/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
.../processors/hadoop/igfs/HadoopIgfsUtils.java | 36 +
.../ignite/igfs/Hadoop1DualAbstractTest.java | 5 +
...oopFileSystemUniversalFileSystemAdapter.java | 4 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 7 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 5 +-
.../testsuites/IgniteHadoopTestSuite.java | 19 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/sql/GridSqlArray.java | 52 +
.../processors/query/h2/sql/GridSqlElement.java | 2 +-
.../query/h2/sql/GridSqlFunction.java | 60 +-
.../query/h2/sql/GridSqlFunctionType.java | 3 +
.../query/h2/sql/GridSqlPlaceholder.java | 7 +-
.../query/h2/sql/GridSqlQueryParser.java | 84 +-
.../processors/query/h2/sql/GridSqlType.java | 29 +-
.../query/h2/sql/GridQueryParsingTest.java | 27 +
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/mqtt/pom.xml | 114 +++
.../apache/ignite/stream/mqtt/MqttStreamer.java | 611 ++++++++++++
.../stream/mqtt/IgniteMqttStreamerTest.java | 553 +++++++++++
.../mqtt/IgniteMqttStreamerTestSuite.java | 34 +
modules/platform/pom.xml | 2 +-
.../platform/src/main/cpp/common/configure.ac | 2 +-
.../src/main/cpp/core-test/configure.ac | 2 +-
modules/platform/src/main/cpp/core/configure.ac | 2 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Apache.Ignite/Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
modules/rest-http/pom.xml | 2 +-
.../http/jetty/GridJettyJsonConfig.java | 158 ++-
.../http/jetty/GridJettyRestHandler.java | 186 ++--
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
.../scala/org/apache/ignite/visor/visor.scala | 1 -
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../config/benchmark-put-indexed-val.properties | 2 +-
modules/yardstick/pom.xml | 12 +-
modules/yarn/pom.xml | 2 +-
modules/zookeeper/pom.xml | 2 +-
pom.xml | 3 +-
223 files changed, 8182 insertions(+), 2112 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 02c6a26,d89e397..ddce314
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@@ -426,963 -427,963 +427,1927 @@@ public class IgniteCacheProcessProxy<K
*
*/
private static class GetConfigurationTask<K, V, C extends Configuration<K, V>> extends CacheTaskAdapter<K, V, C> {
+ /** Clazz. */
+ private final Class<C> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public GetConfigurationTask(String cacheName, boolean async, Class<C> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public C call() throws Exception {
+ return cache().getConfiguration(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalLoadCacheTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Predicate. */
+ private final IgniteBiPredicate<K, V> p;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param p P.
+ * @param args Args.
+ */
+ public LocalLoadCacheTask(String cacheName, boolean async, IgniteBiPredicate<K, V> p, Object[] args) {
+ super(cacheName, async);
+ this.p = p;
+ this.args = args;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localLoadCache(p, args);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPutIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsLocalLockedTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** By current thread. */
+ private final boolean byCurrThread;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param byCurrThread By current thread.
+ */
+ public IsLocalLockedTask(String cacheName, boolean async, K key, boolean byCurrThread) {
+ super(cacheName, async);
+ this.key = key;
+ this.byCurrThread = byCurrThread;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isLocalLocked(key, byCurrThread);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEntriesTask<K, V> extends CacheTaskAdapter<K, V, Iterable<Entry<K, V>>> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ */
+ public LocalEntriesTask(String cacheName, boolean async, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Iterable<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> e : cache().localEntries(peekModes))
+ res.add(new CacheEntryImpl<>(e.getKey(), e.getValue()));
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEvictTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Collection<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public LocalEvictTask(String cacheName, boolean async, Collection<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localEvict(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalPeekTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param peekModes Peek modes.
+ */
+ public LocalPeekTask(String cacheName, boolean async, K key, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.key = key;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().localPeek(key, peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class SizeTask extends CacheTaskAdapter<Void, Void, Integer> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ * @param loc Local.
+ */
+ public SizeTask(String cacheName, boolean async, CachePeekMode[] peekModes, boolean loc) {
+ super(cacheName, async);
+ this.loc = loc;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ return loc ? cache().localSize(peekModes) : cache().size(peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().get(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public RemoveAllTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ IgniteCache<K, V> cache = cache();
+
+ cache.removeAll();
+
+ if (async)
+ cache.future().get();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().put(key, val);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeyTask<K> extends CacheTaskAdapter<K, Object, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ContainsKeyTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKey(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearTask extends CacheTaskAdapter<Object, Object, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public ClearTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().clear();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IteratorTask<K, V> extends CacheTaskAdapter<K, V, Collection<Entry<K, V>>> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IteratorTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> o : cache())
+ res.add(o);
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public ReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetNameTask extends CacheTaskAdapter<Void, Void, String> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public GetNameTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String call() throws Exception {
+ return cache().getName();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public RemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Map. */
+ private final Map<? extends K, ? extends V> map;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param map Map.
+ */
+ public PutAllTask(String cacheName, boolean async, Map<? extends K, ? extends V> map) {
+ super(cacheName, async);
+ this.map = map;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().putAll(map);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllKeysTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public RemoveAllKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().removeAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAll(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllOutTxTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllOutTxTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAllOutTx(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeysTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ContainsKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKeys(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPut(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().putIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ */
+ public RemoveIfExistsTask(String cacheName, boolean async, K key, V oldVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key, oldVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndRemoveTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetAndRemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndRemove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /** New value. */
+ private final V newVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ * @param newVal New value.
+ */
+ public ReplaceIfExistsTask(String cacheName, boolean async, K key, V oldVal, V newVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ this.newVal = newVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, oldVal, newVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndReplaceTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndReplace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearKeyTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ClearKeyTask(String cacheName, boolean async, boolean loc, K key) {
+ super(cacheName, async);
+ this.key = key;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClear(key);
+ else
+ cache().clear(key);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearAllKeys<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ClearAllKeys(String cacheName, boolean async, boolean loc, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClearAll(keys);
+ else
+ cache().clearAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeTask<K, V, R> extends CacheTaskAdapter<K, V, R> {
+ /** Key. */
+ private final K key;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, R> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeTask(String cacheName, boolean async, K key, EntryProcessor<K, V, R> processor,
+ Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.key = key;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().invoke(key, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeAllTask<K, V, T> extends CacheTaskAdapter<K, V, Map<K, EntryProcessorResult<T>>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, T> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeAllTask(String cacheName, boolean async, Set<? extends K> keys,
+ EntryProcessor<K, V, T> processor, Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.keys = keys;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, EntryProcessorResult<T>> call() throws Exception {
+ return cache().invokeAll(keys, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CloseTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CloseTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().close();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class DestroyTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public DestroyTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().destroy();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsClosedTask extends CacheTaskAdapter<Void, Void, Boolean> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IsClosedTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isClosed();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class UnwrapTask<R> extends CacheTaskAdapter<Void, Void, R> {
+ /** Clazz. */
+ private final Class<R> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public UnwrapTask(String cacheName, boolean async, Class<R> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().unwrap(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static abstract class CacheTaskAdapter<K, V, R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Cache name. */
+ protected final String cacheName;
+
+ /** Async. */
+ protected final boolean async;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CacheTaskAdapter(String cacheName, boolean async) {
+ this.async = async;
+ this.cacheName = cacheName;
+ }
+
+ /**
+ * Returns cache instance.
+ */
+ protected IgniteCache<K, V> cache() {
+ IgniteCache<K, V> cache = ignite.cache(cacheName);
+
+ return async ? cache.withAsync() : cache;
+ }
+ }
-}
++
++ /**
++ *
++ */
++ private static class GetConfigurationTask<K, V, C extends Configuration<K, V>> extends CacheTaskAdapter<K, V, C> {
+ /** Clazz. */
+ private final Class<C> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public GetConfigurationTask(String cacheName, boolean async, Class<C> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public C call() throws Exception {
+ return cache().getConfiguration(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalLoadCacheTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Predicate. */
+ private final IgniteBiPredicate<K, V> p;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param p P.
+ * @param args Args.
+ */
+ public LocalLoadCacheTask(String cacheName, boolean async, IgniteBiPredicate<K, V> p, Object[] args) {
+ super(cacheName, async);
+ this.p = p;
+ this.args = args;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localLoadCache(p, args);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPutIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsLocalLockedTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** By current thread. */
+ private final boolean byCurrThread;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param byCurrThread By current thread.
+ */
+ public IsLocalLockedTask(String cacheName, boolean async, K key, boolean byCurrThread) {
+ super(cacheName, async);
+ this.key = key;
+ this.byCurrThread = byCurrThread;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isLocalLocked(key, byCurrThread);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEntriesTask<K, V> extends CacheTaskAdapter<K, V, Iterable<Entry<K, V>>> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ */
+ public LocalEntriesTask(String cacheName, boolean async, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Iterable<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> e : cache().localEntries(peekModes))
+ res.add(e);
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalEvictTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Collection<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public LocalEvictTask(String cacheName, boolean async, Collection<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().localEvict(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class LocalPeekTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param peekModes Peek modes.
+ */
+ public LocalPeekTask(String cacheName, boolean async, K key, CachePeekMode[] peekModes) {
+ super(cacheName, async);
+ this.key = key;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().localPeek(key, peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class SizeTask extends CacheTaskAdapter<Void, Void, Integer> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ * @param loc Local.
+ */
+ public SizeTask(String cacheName, boolean async, CachePeekMode[] peekModes, boolean loc) {
+ super(cacheName, async);
+ this.loc = loc;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ return loc ? cache().localSize(peekModes) : cache().size(peekModes);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().get(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public RemoveAllTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ IgniteCache<K, V> cache = cache();
+
+ cache.removeAll();
+
+ if (async)
+ cache.future().get();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().put(key, val);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeyTask<K> extends CacheTaskAdapter<K, Object, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ContainsKeyTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKey(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearTask extends CacheTaskAdapter<Object, Object, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public ClearTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().clear();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IteratorTask<K, V> extends CacheTaskAdapter<K, V, Collection<Entry<K, V>>> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IteratorTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<Entry<K, V>> call() throws Exception {
+ Collection<Entry<K, V>> res = new ArrayList<>();
+
+ for (Entry<K, V> o : cache())
+ res.add(o);
+
+ return res;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public ReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetNameTask extends CacheTaskAdapter<Void, Void, String> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public GetNameTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String call() throws Exception {
+ return cache().getName();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public RemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
+ /** Map. */
+ private final Map<? extends K, ? extends V> map;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param map Map.
+ */
+ public PutAllTask(String cacheName, boolean async, Map<? extends K, ? extends V> map) {
+ super(cacheName, async);
+ this.map = map;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().putAll(map);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAllKeysTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public RemoveAllKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().removeAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAll(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAllOutTxTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public GetAllOutTxTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> call() throws Exception {
+ return cache().getAllOutTx(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ContainsKeysTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ContainsKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().containsKeys(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndPutTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndPutTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndPut(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public PutIfAbsentTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().putIfAbsent(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ */
+ public RemoveIfExistsTask(String cacheName, boolean async, K key, V oldVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().remove(key, oldVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndRemoveTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public GetAndRemoveTask(String cacheName, boolean async, K key) {
+ super(cacheName, async);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndRemove(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ReplaceIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Old value. */
+ private final V oldVal;
+
+ /** New value. */
+ private final V newVal;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param oldVal Old value.
+ * @param newVal New value.
+ */
+ public ReplaceIfExistsTask(String cacheName, boolean async, K key, V oldVal, V newVal) {
+ super(cacheName, async);
+ this.key = key;
+ this.oldVal = oldVal;
+ this.newVal = newVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().replace(key, oldVal, newVal);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetAndReplaceTask<K, V> extends CacheTaskAdapter<K, V, V> {
+ /** Key. */
+ private final K key;
+
+ /** Value. */
+ private final V val;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param val Value.
+ */
+ public GetAndReplaceTask(String cacheName, boolean async, K key, V val) {
+ super(cacheName, async);
+ this.key = key;
+ this.val = val;
+ }
+
+ /** {@inheritDoc} */
+ @Override public V call() throws Exception {
+ return cache().getAndReplace(key, val);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearKeyTask<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Key. */
+ private final K key;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ */
+ public ClearKeyTask(String cacheName, boolean async, boolean loc, K key) {
+ super(cacheName, async);
+ this.key = key;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClear(key);
+ else
+ cache().clear(key);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ClearAllKeys<K> extends CacheTaskAdapter<K, Void, Void> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ */
+ public ClearAllKeys(String cacheName, boolean async, boolean loc, Set<? extends K> keys) {
+ super(cacheName, async);
+ this.keys = keys;
+ this.loc = loc;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ if (loc)
+ cache().localClearAll(keys);
+ else
+ cache().clearAll(keys);
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeTask<K, V, R> extends CacheTaskAdapter<K, V, R> {
+ /** Key. */
+ private final K key;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, R> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param key Key.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeTask(String cacheName, boolean async, K key, EntryProcessor<K, V, R> processor,
+ Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.key = key;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().invoke(key, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class InvokeAllTask<K, V, T> extends CacheTaskAdapter<K, V, Map<K, EntryProcessorResult<T>>> {
+ /** Keys. */
+ private final Set<? extends K> keys;
+
+ /** Processor. */
+ private final EntryProcessor<K, V, T> processor;
+
+ /** Args. */
+ private final Object[] args;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param keys Keys.
+ * @param processor Processor.
+ * @param args Args.
+ */
+ public InvokeAllTask(String cacheName, boolean async, Set<? extends K> keys,
+ EntryProcessor<K, V, T> processor, Object[] args) {
+ super(cacheName, async);
+ this.args = args;
+ this.keys = keys;
+ this.processor = processor;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, EntryProcessorResult<T>> call() throws Exception {
+ return cache().invokeAll(keys, processor, args);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CloseTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CloseTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().close();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class DestroyTask extends CacheTaskAdapter<Void, Void, Void> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public DestroyTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Void call() {
+ cache().destroy();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsClosedTask extends CacheTaskAdapter<Void, Void, Boolean> {
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public IsClosedTask(String cacheName, boolean async) {
+ super(cacheName, async);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ return cache().isClosed();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class UnwrapTask<R> extends CacheTaskAdapter<Void, Void, R> {
+ /** Clazz. */
+ private final Class<R> clazz;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param clazz Clazz.
+ */
+ public UnwrapTask(String cacheName, boolean async, Class<R> clazz) {
+ super(cacheName, async);
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ return cache().unwrap(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private static abstract class CacheTaskAdapter<K, V, R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Cache name. */
+ protected final String cacheName;
+
+ /** Async. */
+ protected final boolean async;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ */
+ public CacheTaskAdapter(String cacheName, boolean async) {
+ this.async = async;
+ this.cacheName = cacheName;
+ }
+
+ /**
+ * Returns cache instance.
+ */
+ protected IgniteCache<K, V> cache() {
+ IgniteCache<K, V> cache = ignite.cache(cacheName);
+
+ return async ? cache.withAsync() : cache;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 8e653e3,1876e24..7425cb6
--- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 7cf47c3,03f7fb9..198cfa6
--- a/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index ba4b794,22d74c9..a45f421
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/4ee154c8/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index f474b03,1ebcf24..db88e3b
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--/*
++/*
* 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.
[08/17] ignite git commit: 1. fixed DhtInvalidPartitionException with
force keys request. 2. added proper message to DhtInvalidPartitionException
instantiations.
Posted by ag...@apache.org.
1. fixed DhtInvalidPartitionException with force keys request.
2. added proper message to DhtInvalidPartitionException instantiations.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6e3d1b11
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6e3d1b11
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6e3d1b11
Branch: refs/heads/master
Commit: 6e3d1b11b409a966a351875661e43f48320da3fe
Parents: 93aabaa
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Oct 5 10:59:41 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Oct 5 10:59:41 2015 +0300
----------------------------------------------------------------------
.../dht/GridClientPartitionTopology.java | 13 +++++++++----
.../distributed/dht/GridDhtLocalPartition.java | 3 ++-
.../dht/GridDhtPartitionTopologyImpl.java | 12 +++++++-----
.../dht/preloader/GridDhtPreloader.java | 18 +++++++++++++++---
.../near/GridCacheNearTxForceKeyTest.java | 2 +-
5 files changed, 34 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6e3d1b11/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 5e3cc0b..162c116 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
@@ -313,13 +313,18 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
- @Nullable @Override public GridDhtLocalPartition localPartition(int p, AffinityTopologyVersion topVer, boolean create)
+ @Nullable @Override public GridDhtLocalPartition localPartition(
+ int p,
+ AffinityTopologyVersion topVer,
+ boolean create
+ )
throws GridDhtInvalidPartitionException {
if (!create)
return null;
- throw new GridDhtInvalidPartitionException(p, "Adding entry to evicted partition [part=" + p +
- ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
+ throw new GridDhtInvalidPartitionException(p, "Adding entry to evicted partition (often may be caused by " +
+ "inconsistent 'key.hashCode()' implementation) " +
+ "[part=" + p + ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
}
/** {@inheritDoc} */
@@ -912,4 +917,4 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
}
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6e3d1b11/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 2deabfe..4f124e6 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
@@ -258,7 +258,8 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
GridDhtPartitionState state = state();
if (state == EVICTED)
- throw new GridDhtInvalidPartitionException(id, "Adding entry to invalid partition [part=" + id + ']');
+ throw new GridDhtInvalidPartitionException(id, "Adding entry to invalid partition " +
+ "(often may be caused by inconsistent 'key.hashCode()' implementation) [part=" + id + ']');
map.put(entry.key(), entry);
http://git-wip-us.apache.org/repos/asf/ignite/blob/6e3d1b11/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 a0c9c88..6bd283a 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
@@ -563,16 +563,18 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
return null;
if (!belongs)
- throw new GridDhtInvalidPartitionException(p, "Adding entry to evicted partition [part=" + p +
- ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
+ throw new GridDhtInvalidPartitionException(p, "Adding entry to evicted partition " +
+ "(often may be caused by inconsistent 'key.hashCode()' implementation) " +
+ "[part=" + p + ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
continue;
}
if (loc == null && create) {
if (!belongs)
- throw new GridDhtInvalidPartitionException(p, "Creating partition which does not belong [part=" +
- p + ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
+ throw new GridDhtInvalidPartitionException(p, "Creating partition which does not belong to " +
+ "local node (often may be caused by inconsistent 'key.hashCode()' implementation) " +
+ "[part=" + p + ", topVer=" + topVer + ", this.topVer=" + this.topVer + ']');
lock.writeLock().lock();
@@ -1324,4 +1326,4 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6e3d1b11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 36c80a9..67985a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentResponse;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAssignmentFetchFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.util.GridAtomicLong;
@@ -373,10 +374,13 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
GridDhtLocalPartition locPart = top.localPartition(p, AffinityTopologyVersion.NONE, false);
// If this node is no longer an owner.
- if (locPart == null && !top.owners(p).contains(loc))
+ if (locPart == null && !top.owners(p).contains(loc)) {
res.addMissed(k);
- GridCacheEntryEx entry;
+ continue;
+ }
+
+ GridCacheEntryEx entry = null;
if (cctx.isSwapOrOffheapEnabled()) {
while (true) {
@@ -391,6 +395,14 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
if (log.isDebugEnabled())
log.debug("Got removed entry: " + k);
}
+ catch (GridDhtInvalidPartitionException ignore) {
+ if (log.isDebugEnabled())
+ log.debug("Local node is no longer an owner: " + p);
+
+ res.addMissed(k);
+
+ break;
+ }
}
}
else
@@ -619,4 +631,4 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
*/
protected abstract void onMessage(ClusterNode node, M msg);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6e3d1b11/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
index 6d8c190..348597e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
@@ -76,4 +76,4 @@ public class GridCacheNearTxForceKeyTest extends GridCommonAbstractTest {
assertTrue(ignite0.affinity(null).isPrimary(ignite1.cluster().localNode(), key));
}
-}
\ No newline at end of file
+}
[07/17] ignite git commit: IGNITE-1557 (cherry picked from commit
00e61e5)
Posted by ag...@apache.org.
IGNITE-1557
(cherry picked from commit 00e61e5)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/93aabaa4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/93aabaa4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/93aabaa4
Branch: refs/heads/master
Commit: 93aabaa4b02b1cb58d1ece49638a22d8a26bdb91
Parents: 1597e6c
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Sep 28 14:00:23 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Sep 28 14:02:57 2015 +0300
----------------------------------------------------------------------
pom.xml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/93aabaa4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6a17668..e218453 100644
--- a/pom.xml
+++ b/pom.xml
@@ -901,6 +901,22 @@
</execution>
</executions>
</plugin>
+
+ <plugin><!-- skipping generates dependencies licenses -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>ignite-dependencies</id>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
[04/17] ignite git commit: Merge remote-tracking branch
'origin/ignite-1.4.1' into ignite-1.4.1
Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.4.1' into ignite-1.4.1
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f051e49f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f051e49f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f051e49f
Branch: refs/heads/master
Commit: f051e49fa2a3f664ee680a638e3c8864c4a01859
Parents: b64a828 d2cdf60
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 25 11:02:04 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 25 11:02:04 2015 +0300
----------------------------------------------------------------------
assembly/dependencies-fabric.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[11/17] ignite git commit: ignite-1526: full support of IBM JDK by
Ignite
Posted by ag...@apache.org.
ignite-1526: full support of IBM JDK by Ignite
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5fc682f1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5fc682f1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5fc682f1
Branch: refs/heads/master
Commit: 5fc682f11f43f61d14d6b70be5ccf949a9ae05ac
Parents: 4f95be2
Author: Andrey Gura <ag...@gridgain.com>
Authored: Fri Oct 9 13:54:56 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Oct 9 14:22:34 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 17 +-
.../internal/portable/PortableContext.java | 7 +
.../portable/api/PortableMarshaller.java | 14 +-
.../ignite/internal/util/GridJavaProcess.java | 12 +-
.../ignite/internal/util/lang/GridFunc.java | 12 +
.../apache/ignite/marshaller/Marshaller.java | 2 +-
.../optimized/OptimizedMarshallerUtils.java | 6 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 486 ++++---
.../CacheNoValueClassOnServerNodeTest.java | 1 +
...tomicClientOnlyMultiNodeFullApiSelfTest.java | 71 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 129 +-
.../testframework/junits/GridAbstractTest.java | 116 +-
.../junits/IgniteTestResources.java | 8 +-
.../junits/common/GridCommonAbstractTest.java | 15 +-
.../junits/multijvm/AffinityProcessProxy.java | 440 ++++--
.../multijvm/IgniteCacheProcessProxy.java | 1348 ++++++++++++++----
.../multijvm/IgniteClusterProcessProxy.java | 115 +-
.../multijvm/IgniteEventsProcessProxy.java | 50 +-
.../junits/multijvm/IgniteNodeRunner.java | 39 +-
.../junits/multijvm/IgniteProcessProxy.java | 107 +-
.../cache/CacheConfigurationP2PTest.java | 3 +
21 files changed, 2186 insertions(+), 812 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 1801b9c..cba06de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -987,19 +987,24 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
boolean locP2pEnabled = locNode.attribute(ATTR_PEER_CLASSLOADING);
- boolean warned = false;
+ boolean ipV4Warned = false;
+
+ boolean jvmMajVerWarned = false;
for (ClusterNode n : nodes) {
int rmtJvmMajVer = nodeJavaMajorVersion(n);
- if (locJvmMajVer != rmtJvmMajVer)
- throw new IgniteCheckedException("Local node's java major version is different from remote node's one" +
- " [locJvmMajVer=" + locJvmMajVer + ", rmtJvmMajVer=" + rmtJvmMajVer + "]");
+ if (locJvmMajVer != rmtJvmMajVer && !jvmMajVerWarned) {
+ U.warn(log, "Local java version is different from remote [loc=" +
+ locJvmMajVer + ", rmt=" + rmtJvmMajVer + "]");
+
+ jvmMajVerWarned = true;
+ }
String rmtPreferIpV4 = n.attribute("java.net.preferIPv4Stack");
if (!F.eq(rmtPreferIpV4, locPreferIpV4)) {
- if (!warned)
+ if (!ipV4Warned)
U.warn(log, "Local node's value of 'java.net.preferIPv4Stack' " +
"system property differs from remote node's " +
"(all nodes in topology should have identical value) " +
@@ -1008,7 +1013,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
", rmtAddrs=" + U.addressesAsString(n) + ']',
"Local and remote 'java.net.preferIPv4Stack' system properties do not match.");
- warned = true;
+ ipV4Warned = true;
}
// Daemon nodes are allowed to have any deployment they need.
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
index 2ee96b7..1ad42ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
@@ -967,6 +967,9 @@ public class PortableContext implements Externalizable {
}
}
+ /**
+ * Basic class ID mapper.
+ */
private static class BasicClassIdMapper implements PortableIdMapper {
/** {@inheritDoc} */
@Override public int typeId(String clsName) {
@@ -1121,6 +1124,10 @@ public class PortableContext implements Externalizable {
/** Whether the following type is registered in a cache or not */
private final boolean registered;
+ /**
+ * @param id Id.
+ * @param registered Registered.
+ */
public Type(int id, boolean registered) {
this.id = id;
this.registered = registered;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
index de0df8d..3dfbdf0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/api/PortableMarshaller.java
@@ -29,12 +29,6 @@ import org.apache.ignite.internal.portable.GridPortableMarshaller;
import org.apache.ignite.internal.portable.PortableContext;
import org.apache.ignite.marshaller.AbstractMarshaller;
import org.apache.ignite.marshaller.MarshallerContext;
-import org.apache.ignite.internal.portable.api.PortableException;
-import org.apache.ignite.internal.portable.api.PortableIdMapper;
-import org.apache.ignite.internal.portable.api.PortableObject;
-import org.apache.ignite.internal.portable.api.PortableProtocolVersion;
-import org.apache.ignite.internal.portable.api.PortableSerializer;
-import org.apache.ignite.internal.portable.api.PortableTypeConfiguration;
import org.jetbrains.annotations.Nullable;
/**
@@ -336,7 +330,7 @@ public class PortableMarshaller extends AbstractMarshaller {
/** {@inheritDoc} */
@Override public <T> T unmarshal(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ ByteArrayOutputStream buf = new ByteArrayOutputStream();
byte[] arr = new byte[4096];
int cnt;
@@ -345,11 +339,11 @@ public class PortableMarshaller extends AbstractMarshaller {
// returns number of bytes remaining.
try {
while ((cnt = in.read(arr)) != -1)
- buffer.write(arr, 0, cnt);
+ buf.write(arr, 0, cnt);
- buffer.flush();
+ buf.flush();
- return impl.deserialize(buffer.toByteArray(), clsLdr);
+ return impl.deserialize(buf.toByteArray(), clsLdr);
}
catch (IOException e) {
throw new PortableException("Failed to unmarshal the object from InputStream", e);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
index 92c20fe..3371eb8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
@@ -89,7 +89,7 @@ public final class GridJavaProcess {
*/
public static GridJavaProcess exec(Class cls, String params, @Nullable IgniteLogger log,
@Nullable IgniteInClosure<String> printC, @Nullable GridAbsClosure procKilledC) throws Exception {
- return exec(cls.getCanonicalName(), params, log, printC, procKilledC, null, null);
+ return exec(cls.getCanonicalName(), params, log, printC, procKilledC, null, null, null);
}
/**
@@ -108,7 +108,7 @@ public final class GridJavaProcess {
public static GridJavaProcess exec(Class cls, String params, @Nullable IgniteLogger log,
@Nullable IgniteInClosure<String> printC, @Nullable GridAbsClosure procKilledC,
@Nullable Collection<String> jvmArgs, @Nullable String cp) throws Exception {
- return exec(cls.getCanonicalName(), params, log, printC, procKilledC, jvmArgs, cp);
+ return exec(cls.getCanonicalName(), params, log, printC, procKilledC, null, jvmArgs, cp);
}
/**
@@ -116,9 +116,10 @@ public final class GridJavaProcess {
*
* @param clsName Class with main() method to be run.
* @param params main() method parameters.
+ * @param log Log to use.
* @param printC Optional closure to be called each time wrapped process prints line to system.out or system.err.
* @param procKilledC Optional closure to be called when process termination is detected.
- * @param log Log to use.
+ * @param javaHome Java home location. The process will be started under given JVM.
* @param jvmArgs JVM arguments to use.
* @param cp Additional classpath.
* @return Wrapper around {@link Process}
@@ -126,7 +127,7 @@ public final class GridJavaProcess {
*/
public static GridJavaProcess exec(String clsName, String params, @Nullable IgniteLogger log,
@Nullable IgniteInClosure<String> printC, @Nullable GridAbsClosure procKilledC,
- @Nullable Collection<String> jvmArgs, @Nullable String cp) throws Exception {
+ @Nullable String javaHome, @Nullable Collection<String> jvmArgs, @Nullable String cp) throws Exception {
if (!(U.isLinux() || U.isMacOs() || U.isWindows()))
throw new Exception("Your OS is not supported.");
@@ -140,7 +141,8 @@ public final class GridJavaProcess {
List<String> procCommands = new ArrayList<>();
- String javaBin = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
+ String javaBin = (javaHome == null ? System.getProperty("java.home") : javaHome) +
+ File.separator + "bin" + File.separator + "java";
procCommands.add(javaBin);
procCommands.addAll(jvmArgs == null ? U.jvmArgs() : jvmArgs);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index ffeeca0..43bc5f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -103,6 +103,9 @@ public class GridFunc {
/** */
private static final IgniteClosure IDENTITY = new C1() {
+ /** */
+ private static final long serialVersionUID = -6338573080046225172L;
+
@Override public Object apply(Object o) {
return o;
}
@@ -1196,6 +1199,9 @@ public class GridFunc {
A.notNull(nodeId, "nodeId");
return new P1<T>() {
+ /** */
+ private static final long serialVersionUID = -7082730222779476623L;
+
@Override public boolean apply(ClusterNode e) {
return e.id().equals(nodeId);
}
@@ -1705,6 +1711,9 @@ public class GridFunc {
assert c != null;
return new GridSerializableList<T2>() {
+ /** */
+ private static final long serialVersionUID = 3126625219739967068L;
+
@Override public T2 get(int idx) {
return trans.apply(c.get(idx));
}
@@ -1766,6 +1775,9 @@ public class GridFunc {
assert m != null;
return isEmpty(p) || isAlwaysTrue(p) ? m : new GridSerializableMap<K, V>() {
+ /** */
+ private static final long serialVersionUID = 5531745605372387948L;
+
/** Entry predicate. */
private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K, V>>() {
@Override public boolean apply(Entry<K, V> e) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
index 3e815fd..a76daa8 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
@@ -92,7 +92,7 @@ public interface Marshaller {
public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException;
/**
- * Unmarshals object from the output stream using given class loader.
+ * Unmarshals object from the input stream using given class loader.
* This method should not close given input stream.
*
* @param <T> Type of unmarshalled object.
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
index 4abbd04..584083c 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
@@ -42,6 +42,10 @@ class OptimizedMarshallerUtils {
/** */
private static final Unsafe UNSAFE = GridUnsafe.unsafe();
+ /** Use default {@code serialVersionUid} for {@link Serializable} classes. */
+ private static final boolean USE_DFLT_SUID =
+ Boolean.valueOf(System.getProperty("ignite.marsh.optimized.useDefaultSUID", Boolean.TRUE.toString()));
+
/** */
static final long HASH_SET_MAP_OFF;
@@ -283,7 +287,7 @@ class OptimizedMarshallerUtils {
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
static short computeSerialVersionUid(Class cls, List<Field> fields) throws IOException {
- if (Serializable.class.isAssignableFrom(cls) && !Enum.class.isAssignableFrom(cls))
+ if (USE_DFLT_SUID && Serializable.class.isAssignableFrom(cls) && !Enum.class.isAssignableFrom(cls))
return (short)ObjectStreamClass.lookup(cls).getSerialVersionUID();
MessageDigest md;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 2a64963..ec3ea0c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -49,6 +50,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteTransactions;
import org.apache.ignite.cache.CacheEntryProcessor;
import org.apache.ignite.cache.CacheMemoryMode;
@@ -75,6 +77,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.swapspace.inmemory.GridTestSwapSpaceSpi;
import org.apache.ignite.testframework.GridTestUtils;
@@ -117,48 +120,37 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/** */
public static final CacheEntryProcessor<String, Integer, String> ERR_PROCESSOR =
new CacheEntryProcessor<String, Integer, String>() {
+ /** */
+ private static final long serialVersionUID = 0L;
+
@Override public String process(MutableEntry<String, Integer> e, Object... args) {
throw new RuntimeException("Failed!");
}
};
/** Increment processor for invoke operations. */
- public static final EntryProcessor<String, Integer, String> INCR_PROCESSOR = new EntryProcessor<String, Integer, String>() {
- @Override public String process(MutableEntry<String, Integer> e, Object... args) {
- assertNotNull(e.getKey());
-
- Integer old = e.getValue();
-
- e.setValue(old == null ? 1 : old + 1);
-
- return String.valueOf(old);
- }
- };
+ public static final EntryProcessor<String, Integer, String> INCR_PROCESSOR = new IncrementEntryProcessor();
/** Increment processor for invoke operations with IgniteEntryProcessor. */
public static final CacheEntryProcessor<String, Integer, String> INCR_IGNITE_PROCESSOR =
new CacheEntryProcessor<String, Integer, String>() {
+ /** */
+ private static final long serialVersionUID = 0L;
+
@Override public String process(MutableEntry<String, Integer> e, Object... args) {
return INCR_PROCESSOR.process(e, args);
}
};
/** Increment processor for invoke operations. */
- public static final EntryProcessor<String, Integer, String> RMV_PROCESSOR = new EntryProcessor<String, Integer, String>() {
- @Override public String process(MutableEntry<String, Integer> e, Object... args) {
- assertNotNull(e.getKey());
-
- Integer old = e.getValue();
-
- e.remove();
-
- return String.valueOf(old);
- }
- };
+ public static final EntryProcessor<String, Integer, String> RMV_PROCESSOR = new RemoveEntryProcessor();
/** Increment processor for invoke operations with IgniteEntryProcessor. */
public static final CacheEntryProcessor<String, Integer, String> RMV_IGNITE_PROCESSOR =
new CacheEntryProcessor<String, Integer, String>() {
+ /** */
+ private static final long serialVersionUID = 0L;
+
@Override public String process(MutableEntry<String, Integer> e, Object... args) {
return RMV_PROCESSOR.process(e, args);
}
@@ -346,21 +338,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assert jcache(i).localSize() != 0 || F.isEmpty(keysCol);
}
- for (int i = 0; i < gridCount(); i++) {
- executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- GridCacheContext<String, Integer> ctx = context(idx);
-
- int sum = 0;
-
- for (String key : map.keySet())
- if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
- sum++;
-
- assertEquals("Incorrect key size on cache #" + idx, sum, jcache(idx).localSize(ALL));
- }
- });
- }
+ for (int i = 0; i < gridCount(); i++)
+ executeOnLocalOrRemoteJvm(i, new CheckCacheSizeTask(map));
for (int i = 0; i < gridCount(); i++) {
Collection<String> keysCol = mapped.get(grid(i).localNode());
@@ -1350,13 +1329,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertEquals((Integer)3, cache.get("k1"));
- EntryProcessor<String, Integer, Integer> c = new EntryProcessor<String, Integer, Integer>() {
- @Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
- e.remove();
-
- return null;
- }
- };
+ EntryProcessor<String, Integer, Integer> c = new RemoveAndReturnNullEntryProcessor();
assertNull(cache.invoke("k1", c));
assertNull(cache.get("k1"));
@@ -1364,11 +1337,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++)
assertNull(jcache(i).localPeek("k1", ONHEAP));
- final EntryProcessor<String, Integer, Integer> errProcessor = new EntryProcessor<String, Integer, Integer>() {
- @Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
- throw new EntryProcessorException("Test entry processor exception.");
- }
- };
+ final EntryProcessor<String, Integer, Integer> errProcessor = new FailedEntryProcessor();
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
@@ -2001,7 +1970,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cacheAsync.<Boolean>future().get());
}
- cache.localEvict(Arrays.asList("key2"));
+ cache.localEvict(Collections.singletonList("key2"));
// Same checks inside tx.
Transaction tx = inTx ? transactions().txStart() : null;
@@ -2357,27 +2326,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < cnt; i++)
cache.remove(String.valueOf(i));
- for (int g = 0; g < gridCount(); g++) {
- executeOnLocalOrRemoteJvm(g, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- for (int i = 0; i < cnt; i++) {
- String key = String.valueOf(i);
-
- GridCacheContext<String, Integer> cctx = context(idx);
-
- GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key) :
- cctx.cache().peekEx(key);
-
- if (grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
- assertNotNull(entry);
- assertTrue(entry.deleted());
- }
- else
- assertNull(entry);
- }
- }
- });
- }
+ for (int g = 0; g < gridCount(); g++)
+ executeOnLocalOrRemoteJvm(g, new CheckEntriesDeletedTask(cnt));
}
}
@@ -2587,8 +2537,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
c.add(null);
GridTestUtils.assertThrows(log, new Callable<Void>() {
- @Override
- public Void call() throws Exception {
+ @Override public Void call() throws Exception {
cache.removeAll(c);
return null;
@@ -2725,7 +2674,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
public void testRemoveAfterClear() throws Exception {
IgniteEx ignite = grid(0);
- boolean affNode = ((IgniteKernal)ignite).context().cache().internalCache(null).context().affinityNode();
+ boolean affNode = ignite.context().cache().internalCache(null).context().affinityNode();
if (!affNode) {
if (gridCount() < 2)
@@ -2766,13 +2715,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
/**
- *
- */
- private void xxx() {
- System.out.printf("");
- }
-
- /**
* @throws Exception In case of error.
*/
public void testClear() throws Exception {
@@ -3597,26 +3539,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
info("Local keys (primary + backup): " + locKeys);
}
- for (int i = 0; i < gridCount(); i++) {
- grid(i).events().localListen(new IgnitePredicate<Event>() {
- @Override public boolean apply(Event evt) {
- info("Received event: " + evt);
-
- switch (evt.type()) {
- case EVT_CACHE_OBJECT_SWAPPED:
- swapEvts.incrementAndGet();
-
- break;
- case EVT_CACHE_OBJECT_UNSWAPPED:
- unswapEvts.incrementAndGet();
-
- break;
- }
-
- return true;
- }
- }, EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
- }
+ for (int i = 0; i < gridCount(); i++)
+ grid(i).events().localListen(
+ new SwapEvtsLocalListener(swapEvts, unswapEvts), EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
cache.localEvict(F.asList(k2, k3));
@@ -3934,7 +3859,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
map.put(entry.getKey(), entry.getValue());
}
- assert map != null;
assert map.size() == 2;
assert map.get("key1") == 1;
assert map.get("key2") == 2;
@@ -3951,32 +3875,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (nearEnabled())
assertEquals(keys.size(), jcache().localSize(CachePeekMode.ALL));
else {
- for (int i = 0; i < gridCount(); i++) {
- executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- GridCacheContext<String, Integer> ctx = context(idx);
-
- if (ctx.cache().configuration().getMemoryMode() == OFFHEAP_TIERED)
- return;
-
- int size = 0;
-
- for (String key : keys) {
- if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx())) {
- GridCacheEntryEx e =
- ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
-
- assert e != null : "Entry is null [idx=" + idx + ", key=" + key + ", ctx=" + ctx + ']';
- assert !e.deleted() : "Entry is deleted: " + e;
-
- size++;
- }
- }
-
- assertEquals("Incorrect size on cache #" + idx, size, jcache(idx).localSize(ALL));
- }
- });
- }
+ for (int i = 0; i < gridCount(); i++)
+ executeOnLocalOrRemoteJvm(i, new CheckEntriesTask(keys));
}
}
@@ -3989,21 +3889,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertEquals("Invalid key size: " + jcache().localSize(ALL),
keys.size(), jcache().localSize(ALL));
else {
- for (int i = 0; i < gridCount(); i++) {
- executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- GridCacheContext<String, Integer> ctx = context(idx);
-
- int size = 0;
-
- for (String key : keys)
- if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
- size++;
-
- assertEquals("Incorrect key size on cache #" + idx, size, jcache(idx).localSize(ALL));
- }
- });
- }
+ for (int i = 0; i < gridCount(); i++)
+ executeOnLocalOrRemoteJvm(i, new CheckKeySizeTask(keys));
}
}
@@ -4061,27 +3948,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @param cnt Keys count.
* @return Collection of keys for which given cache is primary.
*/
- protected List<String> primaryKeysForCache(final IgniteCache<String, Integer> cache, final int cnt, final int startFrom) {
- return executeOnLocalOrRemoteJvm(cache, new TestCacheCallable<String, Integer, List<String>>() {
- @Override public List<String> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception {
- List<String> found = new ArrayList<>();
-
- Affinity<Object> affinity = ignite.affinity(cache.getName());
-
- for (int i = startFrom; i < startFrom + 100_000; i++) {
- String key = "key" + i;
-
- if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
- found.add(key);
-
- if (found.size() == cnt)
- return found;
- }
- }
-
- throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
- }
- });
+ protected List<String> primaryKeysForCache(IgniteCache<String, Integer> cache, int cnt, int startFrom) {
+ return executeOnLocalOrRemoteJvm(cache, new CheckPrimaryKeysTask(startFrom, cnt));
}
/**
@@ -4272,18 +4140,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* Checks iterators are cleared.
*/
private void checkIteratorsCleared() {
- for (int j = 0; j < gridCount(); j++) {
- executeOnLocalOrRemoteJvm(j, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- GridCacheQueryManager queries = context(idx).queries();
-
- Map map = GridTestUtils.getFieldValue(queries, GridCacheQueryManager.class, "qryIters");
-
- for (Object obj : map.values())
- assertEquals("Iterators not removed for grid " + idx, 0, ((Map)obj).size());
- }
- });
- }
+ for (int j = 0; j < gridCount(); j++)
+ executeOnLocalOrRemoteJvm(j, new CheckIteratorTask());
}
/**
@@ -5226,4 +5084,280 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/** */
ONE_BY_ONE
}
+
+ /**
+ *
+ */
+ private static class RemoveEntryProcessor implements EntryProcessor<String, Integer, String>, Serializable {
+ /** {@inheritDoc} */
+ @Override public String process(MutableEntry<String, Integer> e, Object... args) {
+ assertNotNull(e.getKey());
+
+ Integer old = e.getValue();
+
+ e.remove();
+
+ return String.valueOf(old);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IncrementEntryProcessor implements EntryProcessor<String, Integer, String>, Serializable {
+ /** {@inheritDoc} */
+ @Override public String process(MutableEntry<String, Integer> e, Object... args) {
+ assertNotNull(e.getKey());
+
+ Integer old = e.getValue();
+
+ e.setValue(old == null ? 1 : old + 1);
+
+ return String.valueOf(old);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckEntriesTask extends TestIgniteIdxRunnable {
+ /** Keys. */
+ private final Collection<String> keys;
+
+ /**
+ * @param keys Keys.
+ */
+ public CheckEntriesTask(Collection<String> keys) {
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = ((IgniteKernal)ignite).<String, Integer>internalCache().context();
+
+ if (ctx.cache().configuration().getMemoryMode() == OFFHEAP_TIERED)
+ return;
+
+ int size = 0;
+
+ for (String key : keys) {
+ if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx())) {
+ GridCacheEntryEx e =
+ ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
+
+ assert e != null : "Entry is null [idx=" + idx + ", key=" + key + ", ctx=" + ctx + ']';
+ assert !e.deleted() : "Entry is deleted: " + e;
+
+ size++;
+ }
+ }
+
+ assertEquals("Incorrect size on cache #" + idx, size, ignite.cache(ctx.name()).localSize(ALL));
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckCacheSizeTask extends TestIgniteIdxRunnable {
+ private final Map<String, Integer> map;
+
+ /**
+ * @param map Map.
+ */
+ public CheckCacheSizeTask(Map<String, Integer> map) {
+ this.map = map;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = ((IgniteKernal)ignite).<String, Integer>internalCache().context();
+
+ int size = 0;
+
+ for (String key : map.keySet())
+ if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
+ size++;
+
+ assertEquals("Incorrect key size on cache #" + idx, size, ignite.cache(ctx.name()).localSize(ALL));
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckPrimaryKeysTask implements TestCacheCallable<String, Integer, List<String>> {
+ /** Start from. */
+ private final int startFrom;
+
+ /** Count. */
+ private final int cnt;
+
+ /**
+ * @param startFrom Start from.
+ * @param cnt Count.
+ */
+ public CheckPrimaryKeysTask(int startFrom, int cnt) {
+ this.startFrom = startFrom;
+ this.cnt = cnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public List<String> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception {
+ List<String> found = new ArrayList<>();
+
+ Affinity<Object> affinity = ignite.affinity(cache.getName());
+
+ for (int i = startFrom; i < startFrom + 100_000; i++) {
+ String key = "key" + i;
+
+ if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+ found.add(key);
+
+ if (found.size() == cnt)
+ return found;
+ }
+ }
+
+ throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckIteratorTask extends TestIgniteIdxCallable<Void> {
+ /**
+ * @param idx Index.
+ */
+ @Override public Void call(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = ((IgniteKernal)ignite).<String, Integer>internalCache().context();
+ GridCacheQueryManager queries = ctx.queries();
+
+ Map map = GridTestUtils.getFieldValue(queries, GridCacheQueryManager.class, "qryIters");
+
+ for (Object obj : map.values())
+ assertEquals("Iterators not removed for grid " + idx, 0, ((Map)obj).size());
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoveAndReturnNullEntryProcessor implements
+ EntryProcessor<String, Integer, Integer>, Serializable {
+
+ /** {@inheritDoc} */
+ @Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
+ e.remove();
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class SwapEvtsLocalListener implements IgnitePredicate<Event> {
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** Swap events. */
+ private final AtomicInteger swapEvts;
+
+ /** Unswap events. */
+ private final AtomicInteger unswapEvts;
+
+ /**
+ * @param swapEvts Swap events.
+ * @param unswapEvts Unswap events.
+ */
+ public SwapEvtsLocalListener(AtomicInteger swapEvts, AtomicInteger unswapEvts) {
+ this.swapEvts = swapEvts;
+ this.unswapEvts = unswapEvts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(Event evt) {
+ log.info("Received event: " + evt);
+
+ switch (evt.type()) {
+ case EVT_CACHE_OBJECT_SWAPPED:
+ swapEvts.incrementAndGet();
+
+ break;
+ case EVT_CACHE_OBJECT_UNSWAPPED:
+ unswapEvts.incrementAndGet();
+
+ break;
+ }
+
+ return true;
+ }
+ }
+
+ private static class CheckEntriesDeletedTask extends TestIgniteIdxRunnable {
+ private final int cnt;
+
+ public CheckEntriesDeletedTask(int cnt) {
+ this.cnt = cnt;
+ }
+
+ @Override public void run(int idx) throws Exception {
+ for (int i = 0; i < cnt; i++) {
+ String key = String.valueOf(i);
+
+ GridCacheContext<String, Integer> ctx = ((IgniteKernal)ignite).<String, Integer>internalCache().context();
+
+ GridCacheEntryEx entry = ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
+
+ if (ignite.affinity(null).mapKeyToPrimaryAndBackups(key).contains(((IgniteKernal)ignite).localNode())) {
+ assertNotNull(entry);
+ assertTrue(entry.deleted());
+ }
+ else
+ assertNull(entry);
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckKeySizeTask extends TestIgniteIdxRunnable {
+ /** Keys. */
+ private final Collection<String> keys;
+
+ /**
+ * @param keys Keys.
+ */
+ public CheckKeySizeTask(Collection<String> keys) {
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = ((IgniteKernal)ignite).<String, Integer>internalCache().context();
+
+ int size = 0;
+
+ for (String key : keys)
+ if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
+ size++;
+
+ assertEquals("Incorrect key size on cache #" + idx, size, ignite.cache(null).localSize(ALL));
+ }
+ }
+
+ /**
+ *
+ */
+ private static class FailedEntryProcessor implements EntryProcessor<String, Integer, Integer>, Serializable {
+ /** {@inheritDoc} */
+ @Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
+ throw new EntryProcessorException("Test entry processor exception.");
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheNoValueClassOnServerNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheNoValueClassOnServerNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheNoValueClassOnServerNodeTest.java
index da694b5..c6ce81e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheNoValueClassOnServerNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheNoValueClassOnServerNodeTest.java
@@ -111,6 +111,7 @@ public class CacheNoValueClassOnServerNodeTest extends GridCommonAbstractTest {
}
},
null,
+ null,
jvmArgs,
cp
);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
index 1511c45..927ee62 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -29,6 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.cache.expiry.Duration;
import javax.cache.expiry.TouchedExpiryPolicy;
import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -37,6 +39,7 @@ import org.apache.ignite.events.Event;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.resources.LoggerResource;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
@@ -106,9 +109,11 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
affinityNodes(); // Just to ack cache configuration to log..
- checkKeySize(map.keySet());
+ Set<String> keys = new LinkedHashSet<>(map.keySet());
- checkSize(map.keySet());
+ checkKeySize(keys);
+
+ checkSize(keys);
int fullCacheSize = 0;
@@ -317,24 +322,8 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
Collection<String> locKeys = new HashSet<>();
for (int i = 0; i < gridCount(); i++) {
- grid(i).events().localListen(new IgnitePredicate<Event>() {
- @Override public boolean apply(Event evt) {
- info("Received event: " + evt);
-
- switch (evt.type()) {
- case EVT_CACHE_OBJECT_SWAPPED:
- swapEvts.incrementAndGet();
-
- break;
- case EVT_CACHE_OBJECT_UNSWAPPED:
- unswapEvts.incrementAndGet();
-
- break;
- }
-
- return true;
- }
- }, EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
+ grid(i).events().localListen(
+ new LocalListener(swapEvts, unswapEvts), EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
}
cache.localEvict(Collections.singleton(k2));
@@ -416,4 +405,46 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
assertEquals(cnt, swapEvts.get());
assertEquals(cnt, unswapEvts.get());
}
+
+ /**
+ *
+ */
+ private static class LocalListener implements IgnitePredicate<Event> {
+ /** Logger. */
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** Swap events. */
+ private final AtomicInteger swapEvts;
+
+ /** Unswap events. */
+ private final AtomicInteger unswapEvts;
+
+ /**
+ * @param swapEvts Swap events.
+ * @param unswapEvts Unswap events.
+ */
+ public LocalListener(AtomicInteger swapEvts, AtomicInteger unswapEvts) {
+ this.swapEvts = swapEvts;
+ this.unswapEvts = unswapEvts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(Event evt) {
+ log.info("Received event: " + evt);
+
+ switch (evt.type()) {
+ case EVT_CACHE_OBJECT_SWAPPED:
+ swapEvts.incrementAndGet();
+
+ break;
+ case EVT_CACHE_OBJECT_UNSWAPPED:
+ unswapEvts.incrementAndGet();
+
+ break;
+ }
+
+ return true;
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index c04bf2e..a2440e2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -20,11 +20,14 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteAtomicLong;
import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.affinity.Affinity;
@@ -36,6 +39,8 @@ import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.resources.LoggerResource;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -93,7 +98,7 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
atomicClockModeDelay(c0);
- c1.removeAll(putMap.keySet());
+ c1.removeAll(new HashSet<>(putMap.keySet()));
for (int i = 0; i < size; i++) {
assertNull(c0.get(i));
@@ -159,22 +164,8 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
info("Finished putting value [i=" + i + ']');
}
- for (int i = 0; i < gridCount(); i++) {
- executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- assertEquals(0, context(idx).tm().idMapSize());
-
- IgniteCache<Object, Object> cache = grid(idx).cache(null);
- ClusterNode node = grid(idx).localNode();
-
- for (int k = 0; k < size; k++) {
- if (affinity(cache).isPrimaryOrBackup(node, k))
- assertEquals("Check failed for node: " + node.id(), k,
- cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
- }
- }
- });
- }
+ for (int i = 0; i < gridCount(); i++)
+ executeOnLocalOrRemoteJvm(i, new CheckAffinityTask(size));
for (int i = 0; i < size; i++) {
info("Putting value 2 [i=" + i + ']');
@@ -199,28 +190,9 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
final IgniteAtomicLong unswapEvts = grid(0).atomicLong("unswapEvts", 0, true);
- for (int i = 0; i < gridCount(); i++) {
- final int iCopy = i;
-
- grid(i).events().localListen(new IgnitePredicate<Event>() {
- @Override public boolean apply(Event evt) {
- info("Received event: " + evt);
-
- switch (evt.type()) {
- case EVT_CACHE_OBJECT_SWAPPED:
- grid(iCopy).atomicLong("swapEvts", 0, false).incrementAndGet();
-
- break;
- case EVT_CACHE_OBJECT_UNSWAPPED:
- grid(iCopy).atomicLong("unswapEvts", 0, false).incrementAndGet();
-
- break;
- }
-
- return true;
- }
- }, EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
- }
+ for (int i = 0; i < gridCount(); i++)
+ grid(i).events().localListen(
+ new SwapUnswapLocalListener(), EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
jcache().put("key", 1);
@@ -254,13 +226,8 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
boolean nearEnabled = nearEnabled(c);
- if (nearEnabled) {
- executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
- @Override public void run(int idx) throws Exception {
- assertTrue(((IgniteKernal)ignite(idx)).internalCache().context().isNear());
- }
- });
- }
+ if (nearEnabled)
+ executeOnLocalOrRemoteJvm(i, new IsNearTask());
Integer nearPeekVal = nearEnabled ? 1 : null;
@@ -476,4 +443,74 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
assertFalse(affinity(cache).isPrimaryOrBackup(other, key));
}
}
+
+ /**
+ *
+ */
+ private static class SwapUnswapLocalListener implements IgnitePredicate<Event> {
+ /** Logger. */
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** Ignite. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(Event evt) {
+ log.info("Received event: " + evt);
+
+ switch (evt.type()) {
+ case EVT_CACHE_OBJECT_SWAPPED:
+ ignite.atomicLong("swapEvts", 0, false).incrementAndGet();
+
+ break;
+ case EVT_CACHE_OBJECT_UNSWAPPED:
+ ignite.atomicLong("unswapEvts", 0, false).incrementAndGet();
+
+ break;
+ }
+
+ return true;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CheckAffinityTask extends TestIgniteIdxRunnable {
+ /** Size. */
+ private final int size;
+
+ /**
+ * @param size Size.
+ */
+ public CheckAffinityTask(int size) {
+ this.size = size;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run(int idx) throws Exception {
+ assertEquals(0, ((IgniteKernal)ignite).<String, Integer>internalCache().context().tm().idMapSize());
+
+ IgniteCache<Object, Object> cache = ignite.cache(null);
+ ClusterNode node = ((IgniteKernal)ignite).localNode();
+
+ for (int k = 0; k < size; k++) {
+ if (affinity(cache).isPrimaryOrBackup(node, k))
+ assertEquals("Check failed for node: " + node.id(), k,
+ cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ private static class IsNearTask extends TestIgniteIdxRunnable {
+ /** {@inheritDoc} */
+ @Override public void run(int idx) throws Exception {
+ assertTrue(((IgniteKernal)ignite).internalCache().context().isNear());
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index f54fe06..d133a84 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -73,6 +73,7 @@ import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.MarshallerExclusions;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
@@ -1471,6 +1472,8 @@ public abstract class GridAbstractTest extends TestCase {
if (!isMultiJvmObject(ignite))
try {
+ job.setIgnite(ignite);
+
return job.call(idx);
}
catch (Exception e) {
@@ -1532,11 +1535,7 @@ public abstract class GridAbstractTest extends TestCase {
IgniteProcessProxy proxy = (IgniteProcessProxy)ignite;
- return proxy.remoteCompute().call(new IgniteCallable<R>() {
- @Override public R call() throws Exception {
- return job.call(idx);
- }
- });
+ return proxy.remoteCompute().call(new ExecuteRemotelyTask<>(job, idx));
}
/**
@@ -1546,15 +1545,7 @@ public abstract class GridAbstractTest extends TestCase {
* @param job Job.
*/
public static <R> R executeRemotely(IgniteProcessProxy proxy, final TestIgniteCallable<R> job) {
- final UUID id = proxy.getId();
-
- return proxy.remoteCompute().call(new IgniteCallable<R>() {
- @Override public R call() throws Exception {
- Ignite ignite = Ignition.ignite(id);
-
- return job.call(ignite);
- }
- });
+ return proxy.remoteCompute().call(new TestRemoteTask<>(proxy.getId(), job));
}
/**
@@ -1571,6 +1562,8 @@ public abstract class GridAbstractTest extends TestCase {
final String cacheName = cache.getName();
return proxy.remoteCompute().call(new IgniteCallable<R>() {
+ private static final long serialVersionUID = -3868429485920845137L;
+
@Override public R call() throws Exception {
Ignite ignite = Ignition.ignite(id);
IgniteCache<K,V> cache = ignite.cache(cacheName);
@@ -1745,6 +1738,22 @@ public abstract class GridAbstractTest extends TestCase {
}
/**
+ * @param name Name.
+ * @param remote Remote.
+ * @param thisRemote This remote.
+ */
+ public static IgniteEx grid(String name, boolean remote, boolean thisRemote) {
+ if (!remote)
+ return (IgniteEx)G.ignite(name);
+ else {
+ if (thisRemote)
+ return IgniteNodeRunner.startedInstance();
+ else
+ return IgniteProcessProxy.ignite(name);
+ }
+ }
+
+ /**
*
*/
private static interface WriteReplaceOwner {
@@ -1781,6 +1790,67 @@ public abstract class GridAbstractTest extends TestCase {
}
/**
+ * Remote computation task.
+ */
+ private static class TestRemoteTask<R> implements IgniteCallable<R> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Node ID. */
+ private final UUID id;
+
+ /** Job. */
+ private final TestIgniteCallable<R> job;
+
+ /**
+ * @param id Id.
+ * @param job Job.
+ */
+ public TestRemoteTask(UUID id, TestIgniteCallable<R> job) {
+ this.id = id;
+ this.job = job;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ Ignite ignite = Ignition.ignite(id);
+
+ return job.call(ignite);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class ExecuteRemotelyTask<R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Job. */
+ private final TestIgniteIdxCallable<R> job;
+
+ /** Index. */
+ private final int idx;
+
+ /**
+ * @param job Job.
+ * @param idx Index.
+ */
+ public ExecuteRemotelyTask(TestIgniteIdxCallable<R> job, int idx) {
+ this.job = job;
+ this.idx = idx;
+ }
+
+ /** {@inheritDoc} */
+ @Override public R call() throws Exception {
+ job.setIgnite(ignite);
+
+ return job.call(idx);
+ }
+ }
+
+ /**
* Test counters.
*/
protected class TestCounters {
@@ -1923,17 +1993,27 @@ public abstract class GridAbstractTest extends TestCase {
}
/** */
- public static interface TestIgniteIdxCallable<R> extends Serializable {
+ public static abstract class TestIgniteIdxCallable<R> implements Serializable {
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /**
+ * @param ignite Ignite.
+ */
+ public void setIgnite(Ignite ignite) {
+ this.ignite = ignite;
+ }
+
/**
* @param idx Grid index.
*/
- R call(int idx) throws Exception;
+ protected abstract R call(int idx) throws Exception;
}
/** */
- public abstract static class TestIgniteIdxRunnable implements TestIgniteIdxCallable<Object> {
+ public abstract static class TestIgniteIdxRunnable extends TestIgniteIdxCallable<Void> {
/** {@inheritDoc} */
- @Override public Object call(int idx) throws Exception {
+ @Override public Void call(int idx) throws Exception {
run(idx);
return null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
index eb72252..406318f 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
@@ -42,6 +42,9 @@ import org.jetbrains.annotations.Nullable;
* Test resources for injection.
*/
public class IgniteTestResources {
+ /** Marshaller class name. */
+ public static final String MARSH_CLASS_NAME = "test.marshaller.class";
+
/** */
private static final IgniteLogger rootLog = new GridTestLog4jLogger(false);
@@ -230,8 +233,9 @@ public class IgniteTestResources {
* @throws IgniteCheckedException If failed.
*/
@SuppressWarnings("unchecked")
- public synchronized Marshaller getMarshaller() throws IgniteCheckedException {
- String marshallerName = GridTestProperties.getProperty(GridTestProperties.MARSH_CLASS_NAME);
+ public static synchronized Marshaller getMarshaller() throws IgniteCheckedException {
+ String marshallerName =
+ System.getProperty(MARSH_CLASS_NAME, GridTestProperties.getProperty(GridTestProperties.MARSH_CLASS_NAME));
Marshaller marsh;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 4bcf51e..e4c2129 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -246,10 +246,12 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
protected static <K, V> boolean nearEnabled(final IgniteCache<K,V> cache) {
CacheConfiguration cfg = GridAbstractTest.executeOnLocalOrRemoteJvm(cache,
new TestCacheCallable<K, V, CacheConfiguration>() {
- @Override public CacheConfiguration call(Ignite ignite, IgniteCache<K, V> cache) throws Exception {
- return ((IgniteKernal)ignite).<K, V>internalCache(cache.getName()).context().config();
- }
- });
+ private static final long serialVersionUID = 0L;
+
+ @Override public CacheConfiguration call(Ignite ignite, IgniteCache<K, V> cache) throws Exception {
+ return ((IgniteKernal)ignite).<K, V>internalCache(cache.getName()).context().config();
+ }
+ });
return isNearEnabled(cfg);
}
@@ -285,10 +287,13 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
- protected static <K> void loadAll(Cache<K, ?> cache, final Set<K> keys, final boolean replaceExistingValues) throws Exception {
+ protected static <K> void loadAll(Cache<K, ?> cache, final Set<K> keys, final boolean replaceExistingValues)
+ throws Exception {
IgniteCache<K, Object> cacheCp = (IgniteCache<K, Object>)cache;
GridAbstractTest.executeOnLocalOrRemoteJvm(cacheCp, new TestCacheRunnable<K, Object>() {
+ private static final long serialVersionUID = -3030833765012500545L;
+
@Override public void run(Ignite ignite, IgniteCache<K, Object> cache) throws Exception {
final AtomicReference<Exception> ex = new AtomicReference<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/5fc682f1/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
index e1959e5..57fbcfc 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
@@ -19,12 +19,12 @@ package org.apache.ignite.testframework.junits.multijvm;
import java.util.Collection;
import java.util.Map;
-import java.util.UUID;
+import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCompute;
-import org.apache.ignite.Ignition;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
/**
@@ -38,160 +38,388 @@ public class AffinityProcessProxy<K> implements Affinity<K> {
/** Cache name. */
private final String cacheName;
- /** Grid id. */
- private final UUID gridId;
-
/**
* @param cacheName Cache name.
- * @param proxy Ignite ptocess proxy.
+ * @param proxy Ignite process proxy.
*/
public AffinityProcessProxy(String cacheName, IgniteProcessProxy proxy) {
this.cacheName = cacheName;
- gridId = proxy.getId();
- compute = proxy.remoteCompute();
- }
-
- /**
- * Returns cache instance. Method to be called from closure at another JVM.
- *
- * @return Cache.
- */
- private Affinity<Object> affinity() {
- return Ignition.ignite(gridId).affinity(cacheName);
+ this.compute = proxy.remoteCompute();
}
/** {@inheritDoc} */
@Override public int partitions() {
- return (int)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().partitions();
- }
- });
+ return compute.call(new PartitionsTask(cacheName));
}
/** {@inheritDoc} */
- @Override public int partition(final K key) {
- return (int)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().partition(key);
- }
- });
+ @Override public int partition(K key) {
+ return compute.call(new PartitionTask<>(cacheName, key));
}
/** {@inheritDoc} */
- @Override public boolean isPrimary(final ClusterNode n, final K key) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().isPrimary(n, key);
- }
- });
+ @Override public boolean isPrimary(ClusterNode n, K key) {
+ return compute.call(new PrimaryOrBackupNodeTask<>(cacheName, key, n, true, false));
}
/** {@inheritDoc} */
- @Override public boolean isBackup(final ClusterNode n, final K key) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().isBackup(n, key);
- }
- });
+ @Override public boolean isBackup(ClusterNode n, K key) {
+ return compute.call(new PrimaryOrBackupNodeTask<>(cacheName, key, n, false, true));
}
/** {@inheritDoc} */
- @Override public boolean isPrimaryOrBackup(final ClusterNode n, final K key) {
- return (boolean)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().isPrimaryOrBackup(n, key);
- }
- });
+ @Override public boolean isPrimaryOrBackup(ClusterNode n, K key) {
+ return compute.call(new PrimaryOrBackupNodeTask<>(cacheName, key, n, true, true));
}
/** {@inheritDoc} */
- @Override public int[] primaryPartitions(final ClusterNode n) {
- return (int[])compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().primaryPartitions(n);
- }
- });
+ @Override public int[] primaryPartitions(ClusterNode n) {
+ return compute.call(new GetPartitionsTask(cacheName, n, true, false));
}
/** {@inheritDoc} */
- @Override public int[] backupPartitions(final ClusterNode n) {
- return (int[])compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().backupPartitions(n);
- }
- });
+ @Override public int[] backupPartitions(ClusterNode n) {
+ return compute.call(new GetPartitionsTask(cacheName, n, false, true));
}
/** {@inheritDoc} */
- @Override public int[] allPartitions(final ClusterNode n) {
- return (int[])compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().allPartitions(n);
- }
- });
+ @Override public int[] allPartitions(ClusterNode n) {
+ return compute.call(new GetPartitionsTask(cacheName, n, true, true));
}
/** {@inheritDoc} */
- @Override public Object affinityKey(final K key) {
- return compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().affinityKey(key);
- }
- });
+ @Override public Object affinityKey(K key) {
+ return compute.call(new AffinityKeyTask<>(cacheName, key));
}
/** {@inheritDoc} */
- @Override public Map<ClusterNode, Collection<K>> mapKeysToNodes(final Collection<? extends K> keys) {
- return (Map<ClusterNode, Collection<K>>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapKeysToNodes(keys);
- }
- });
+ @Override public Map<ClusterNode, Collection<K>> mapKeysToNodes(Collection<? extends K> keys) {
+ return compute.call(new MapKeysToNodesTask<>(cacheName, keys));
}
/** {@inheritDoc} */
- @Nullable @Override public ClusterNode mapKeyToNode(final K key) {
- return (ClusterNode)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapKeyToNode(key);
- }
- });
+ @Nullable @Override public ClusterNode mapKeyToNode(K key) {
+ return compute.call(new MapKeyToNodeTask<>(cacheName, key));
}
/** {@inheritDoc} */
- @Override public Collection<ClusterNode> mapKeyToPrimaryAndBackups(final K key) {
- return (Collection<ClusterNode>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapKeyToPrimaryAndBackups(key);
- }
- });
+ @Override public Collection<ClusterNode> mapKeyToPrimaryAndBackups(K key) {
+ return compute.call(new MapKeyToPrimaryAndBackupsTask<>(cacheName, key));
}
/** {@inheritDoc} */
- @Override public ClusterNode mapPartitionToNode(final int part) {
- return (ClusterNode)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapPartitionToNode(part);
- }
- });
+ @Override public ClusterNode mapPartitionToNode(int part) {
+ return compute.call(new MapPartitionToNode<>(cacheName, part));
}
/** {@inheritDoc} */
- @Override public Map<Integer, ClusterNode> mapPartitionsToNodes(final Collection<Integer> parts) {
- return (Map<Integer, ClusterNode>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapPartitionsToNodes(parts);
- }
- });
+ @Override public Map<Integer, ClusterNode> mapPartitionsToNodes(Collection<Integer> parts) {
+ return compute.call(new MapPartitionsToNodes<>(cacheName, parts));
}
/** {@inheritDoc} */
- @Override public Collection<ClusterNode> mapPartitionToPrimaryAndBackups(final int part) {
- return (Collection<ClusterNode>)compute.call(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
- return affinity().mapPartitionToPrimaryAndBackups(part);
- }
- });
+ @Override public Collection<ClusterNode> mapPartitionToPrimaryAndBackups(int part) {
+ return compute.call(new MapPartitionsToPrimaryAndBackupsTask<>(cacheName, part));
+ }
+
+ /**
+ *
+ */
+ private static class PrimaryOrBackupNodeTask<K> extends AffinityTaskAdapter<K, Boolean> {
+ /** Key. */
+ private final K key;
+
+ /** Node. */
+ private final ClusterNode n;
+
+ /** Primary. */
+ private final boolean primary;
+
+ /** Backup. */
+ private final boolean backup;
+
+ /**
+ * @param cacheName Cache name.
+ * @param key Key.
+ * @param n N.
+ */
+ public PrimaryOrBackupNodeTask(String cacheName, K key, ClusterNode n,
+ boolean primary, boolean backup) {
+ super(cacheName);
+ this.key = key;
+ this.n = n;
+ this.primary = primary;
+ this.backup = backup;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Boolean call() throws Exception {
+ if (primary && backup)
+ return affinity().isPrimaryOrBackup(n, key);
+ else if (primary)
+ return affinity().isPrimary(n, key);
+ else if (backup)
+ return affinity().isBackup(n, key);
+ else
+ throw new IllegalStateException("primary or backup or both flags should be switched on");
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MapKeyToPrimaryAndBackupsTask<K> extends AffinityTaskAdapter<K, Collection<ClusterNode>> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param key Key.
+ */
+ public MapKeyToPrimaryAndBackupsTask(String cacheName, K key) {
+ super(cacheName);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> call() throws Exception {
+ return affinity().mapKeyToPrimaryAndBackups(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PartitionsTask extends AffinityTaskAdapter<Void, Integer> {
+ /**
+ * @param cacheName Cache name.
+ */
+ public PartitionsTask(String cacheName) {
+ super(cacheName);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ return affinity().partitions();
+ }
+ }
+
+ /**
+ *
+ */
+ private static class PartitionTask<K> extends AffinityTaskAdapter<K, Integer> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param key Key.
+ */
+ public PartitionTask(String cacheName, K key) {
+ super(cacheName);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ return affinity().partition(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class GetPartitionsTask extends AffinityTaskAdapter<Void, int[]> {
+ /** Node. */
+ private final ClusterNode n;
+
+ /** Primary. */
+ private final boolean primary;
+
+ /** Backup. */
+ private final boolean backup;
+
+ /**
+ * @param cacheName Cache name.
+ * @param n N.
+ * @param primary Primary.
+ * @param backup Backup.
+ */
+ public GetPartitionsTask(String cacheName, ClusterNode n, boolean primary, boolean backup) {
+ super(cacheName);
+ this.n = n;
+ this.primary = primary;
+ this.backup = backup;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int[] call() throws Exception {
+ if (primary && backup)
+ return affinity().allPartitions(n);
+ else if (primary)
+ return affinity().primaryPartitions(n);
+ else if (backup)
+ return affinity().backupPartitions(n);
+ else
+ throw new IllegalStateException("primary or backup or both flags should be switched on");
+ }
+ }
+
+ /**
+ *
+ */
+ private static class AffinityKeyTask<K> extends AffinityTaskAdapter<K, Object> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param key Key.
+ */
+ public AffinityKeyTask(String cacheName, K key) {
+ super(cacheName);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object call() throws Exception {
+ return affinity().affinityKey(key);
+ }
+ }
+
+ /**
+ * @param <K>
+ */
+ private static class MapKeysToNodesTask<K> extends AffinityTaskAdapter<K, Map<ClusterNode, Collection<K>>> {
+ /** Keys. */
+ private final Collection<? extends K> keys;
+
+ /**
+ * @param cacheName Cache name.
+ * @param keys Keys.
+ */
+ public MapKeysToNodesTask(String cacheName, Collection<? extends K> keys) {
+ super(cacheName);
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<ClusterNode, Collection<K>> call() throws Exception {
+ return affinity().mapKeysToNodes(keys);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MapKeyToNodeTask<K> extends AffinityTaskAdapter<K, ClusterNode> {
+ /** Key. */
+ private final K key;
+
+ /**
+ * @param cacheName Cache name.
+ * @param key Key.
+ */
+ public MapKeyToNodeTask(String cacheName, K key) {
+ super(cacheName);
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode call() throws Exception {
+ return affinity().mapKeyToNode(key);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MapPartitionToNode<K> extends AffinityTaskAdapter<K, ClusterNode> {
+ /** Partition. */
+ private final int part;
+
+ /**
+ * @param cacheName Cache name.
+ * @param part Partition.
+ */
+ public MapPartitionToNode(String cacheName, int part) {
+ super(cacheName);
+ this.part = part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode call() throws Exception {
+ return affinity().mapPartitionToNode(part);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MapPartitionsToNodes<K> extends AffinityTaskAdapter<K, Map<Integer, ClusterNode>> {
+ /** Parts. */
+ private final Collection<Integer> parts;
+
+ /**
+ * @param cacheName Cache name.
+ * @param parts Parts.
+ */
+ public MapPartitionsToNodes(String cacheName, Collection<Integer> parts) {
+ super(cacheName);
+ this.parts = parts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<Integer, ClusterNode> call() throws Exception {
+ return affinity().mapPartitionsToNodes(parts);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MapPartitionsToPrimaryAndBackupsTask<K> extends AffinityTaskAdapter<K, Collection<ClusterNode>> {
+ /** Partition. */
+ private final int part;
+
+ /**
+ * @param cacheName Cache name.
+ * @param part Partition.
+ */
+ public MapPartitionsToPrimaryAndBackupsTask(String cacheName, int part) {
+ super(cacheName);
+ this.part = part;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> call() throws Exception {
+ return affinity().mapPartitionToPrimaryAndBackups(part);
+ }
+ }
+
+ /**
+ *
+ */
+ private abstract static class AffinityTaskAdapter<K, R> implements IgniteCallable<R> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Cache name. */
+ protected final String cacheName;
+
+ /**
+ * @param cacheName Cache name.
+ */
+ public AffinityTaskAdapter(String cacheName) {
+ this.cacheName = cacheName;
+ }
+
+ /**
+ * @return Affinity.
+ */
+ protected Affinity<K> affinity() {
+ return ignite.affinity(cacheName);
+ }
}
}
\ No newline at end of file
[14/17] ignite git commit: ignite-1.4.2 - review and minor changes.
Posted by ag...@apache.org.
ignite-1.4.2 - review and minor changes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/155edd8d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/155edd8d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/155edd8d
Branch: refs/heads/master
Commit: 155edd8d254fa56c4fcc1666fe014c116e649a39
Parents: 4ee154c
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Oct 12 12:41:59 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Oct 12 12:41:59 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheIoManager.java | 9 +-
.../GridDhtPartitionDemandMessage.java | 1 -
.../GridDhtPartitionsExchangeFuture.java | 16 +-
.../preloader/GridDhtPartitionsFullMessage.java | 1 -
.../multijvm/IgniteCacheProcessProxy.java | 966 +------------------
.../Properties/AssemblyInfo.cs | 2 +-
.../Apache.Ignite/Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
9 files changed, 12 insertions(+), 989 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index ae3eb22..476a96c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -24,7 +24,6 @@ import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
@@ -57,8 +56,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPr
import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.GridSpinReadWriteLock;
-import org.apache.ignite.internal.util.future.GridFinishedFuture;
-import org.apache.ignite.internal.util.lang.GridPlainRunnable;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.P1;
@@ -99,9 +96,6 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
/** Stopping flag. */
private boolean stopping;
- /** Error flag. */
- private final AtomicBoolean startErr = new AtomicBoolean();
-
/** Mutex. */
private final GridSpinReadWriteLock rw = new GridSpinReadWriteLock();
@@ -944,10 +938,9 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
/**
* @param nodeId Sender node ID.
* @param cacheMsg Message.
- * @throws IgniteCheckedException If failed.
*/
@SuppressWarnings({"ErrorNotRethrown", "unchecked"})
- private void unmarshall(UUID nodeId, GridCacheMessage cacheMsg) throws IgniteCheckedException {
+ private void unmarshall(UUID nodeId, GridCacheMessage cacheMsg) {
if (cctx.localNodeId().equals(nodeId))
return;
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index 156c37f..848ad87 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.GridDirectTransient;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.GridCacheMessage;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/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 eaa5584..77e47a7 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
@@ -193,6 +193,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
/** */
private boolean clientOnlyExchange;
+ /** Init timestamp. Used to track the amount of time spent to complete the future. */
+ private long initTs;
+
/**
* Dummy future created to trigger reassignments if partition
* topology changed while preloading.
@@ -475,9 +478,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
busyLock.readLock().unlock();
}
- // TODO remove
- long inited;
-
/**
* Starts activity.
*
@@ -491,7 +491,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (isDone())
return;
- inited = U.currentTimeMillis();
+ initTs = U.currentTimeMillis();
try {
// Wait for event to occur to make sure that discovery
@@ -1065,7 +1065,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (super.onDone(res, err) && !dummy && !forcePreload) {
if (log.isDebugEnabled())
log.debug("Completed partition exchange [localNode=" + cctx.localNodeId() + ", exchange= " + this +
- "duration=" + duration() + ", durationFromInit=" + (U.currentTimeMillis() - inited) + ']');
+ "duration=" + duration() + ", durationFromInit=" + (U.currentTimeMillis() - initTs) + ']');
initFut.onDone(err == null);
@@ -1196,8 +1196,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (match) {
boolean allReceived;
- long start = U.currentTimeMillis();
-
synchronized (rcvdIds) {
if (rcvdIds.add(nodeId))
updatePartitionSingleMap(msg);
@@ -1205,8 +1203,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
allReceived = allReceived();
}
- long end = U.currentTimeMillis();
-
// If got all replies, and initialization finished, and reply has not been sent yet.
if (allReceived && ready.get() && replied.compareAndSet(false, true)) {
spreadPartitions();
@@ -1216,7 +1212,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
else if (log.isDebugEnabled())
log.debug("Exchange future full map is not sent [allReceived=" + allReceived() +
", ready=" + ready + ", replied=" + replied.get() + ", init=" + init.get() +
- ", fut=" + GridDhtPartitionsExchangeFuture.this + ", updateDur=" + (end - start) + ']');
+ ", fut=" + GridDhtPartitionsExchangeFuture.this + ']');
}
}
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index 5429538..c06d773 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -203,4 +203,3 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
"super", super.toString());
}
}
-
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index ddce314..d89e397 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -1386,968 +1386,4 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
return async ? cache.withAsync() : cache;
}
}
-
- /**
- *
- */
- private static class GetConfigurationTask<K, V, C extends Configuration<K, V>> extends CacheTaskAdapter<K, V, C> {
- /** Clazz. */
- private final Class<C> clazz;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param clazz Clazz.
- */
- public GetConfigurationTask(String cacheName, boolean async, Class<C> clazz) {
- super(cacheName, async);
- this.clazz = clazz;
- }
-
- /** {@inheritDoc} */
- @Override public C call() throws Exception {
- return cache().getConfiguration(clazz);
- }
- }
-
- /**
- *
- */
- private static class LocalLoadCacheTask<K, V> extends CacheTaskAdapter<K, V, Void> {
- /** Predicate. */
- private final IgniteBiPredicate<K, V> p;
-
- /** Args. */
- private final Object[] args;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param p P.
- * @param args Args.
- */
- public LocalLoadCacheTask(String cacheName, boolean async, IgniteBiPredicate<K, V> p, Object[] args) {
- super(cacheName, async);
- this.p = p;
- this.args = args;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().localLoadCache(p, args);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class GetAndPutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public GetAndPutIfAbsentTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().getAndPutIfAbsent(key, val);
- }
- }
-
- /**
- *
- */
- private static class IsLocalLockedTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
- /** Key. */
- private final K key;
-
- /** By current thread. */
- private final boolean byCurrThread;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param byCurrThread By current thread.
- */
- public IsLocalLockedTask(String cacheName, boolean async, K key, boolean byCurrThread) {
- super(cacheName, async);
- this.key = key;
- this.byCurrThread = byCurrThread;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().isLocalLocked(key, byCurrThread);
- }
- }
-
- /**
- *
- */
- private static class LocalEntriesTask<K, V> extends CacheTaskAdapter<K, V, Iterable<Entry<K, V>>> {
- /** Peek modes. */
- private final CachePeekMode[] peekModes;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param peekModes Peek modes.
- */
- public LocalEntriesTask(String cacheName, boolean async, CachePeekMode[] peekModes) {
- super(cacheName, async);
- this.peekModes = peekModes;
- }
-
- /** {@inheritDoc} */
- @Override public Iterable<Entry<K, V>> call() throws Exception {
- Collection<Entry<K, V>> res = new ArrayList<>();
-
- for (Entry<K, V> e : cache().localEntries(peekModes))
- res.add(e);
-
- return res;
- }
- }
-
- /**
- *
- */
- private static class LocalEvictTask<K> extends CacheTaskAdapter<K, Void, Void> {
- /** Keys. */
- private final Collection<? extends K> keys;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public LocalEvictTask(String cacheName, boolean async, Collection<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().localEvict(keys);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class LocalPeekTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /** Peek modes. */
- private final CachePeekMode[] peekModes;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param peekModes Peek modes.
- */
- public LocalPeekTask(String cacheName, boolean async, K key, CachePeekMode[] peekModes) {
- super(cacheName, async);
- this.key = key;
- this.peekModes = peekModes;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().localPeek(key, peekModes);
- }
- }
-
- /**
- *
- */
- private static class SizeTask extends CacheTaskAdapter<Void, Void, Integer> {
- /** Peek modes. */
- private final CachePeekMode[] peekModes;
-
- /** Local. */
- private final boolean loc;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param peekModes Peek modes.
- * @param loc Local.
- */
- public SizeTask(String cacheName, boolean async, CachePeekMode[] peekModes, boolean loc) {
- super(cacheName, async);
- this.loc = loc;
- this.peekModes = peekModes;
- }
-
- /** {@inheritDoc} */
- @Override public Integer call() throws Exception {
- return loc ? cache().localSize(peekModes) : cache().size(peekModes);
- }
- }
-
- /**
- *
- */
- private static class GetTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- */
- public GetTask(String cacheName, boolean async, K key) {
- super(cacheName, async);
- this.key = key;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().get(key);
- }
- }
-
- /**
- *
- */
- private static class RemoveAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public RemoveAllTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- IgniteCache<K, V> cache = cache();
-
- cache.removeAll();
-
- if (async)
- cache.future().get();
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class PutTask<K, V> extends CacheTaskAdapter<K, V, Void> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public PutTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().put(key, val);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class ContainsKeyTask<K> extends CacheTaskAdapter<K, Object, Boolean> {
- /** Key. */
- private final K key;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- */
- public ContainsKeyTask(String cacheName, boolean async, K key) {
- super(cacheName, async);
- this.key = key;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().containsKey(key);
- }
- }
-
- /**
- *
- */
- private static class ClearTask extends CacheTaskAdapter<Object, Object, Void> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public ClearTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().clear();
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class IteratorTask<K, V> extends CacheTaskAdapter<K, V, Collection<Entry<K, V>>> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public IteratorTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Collection<Entry<K, V>> call() throws Exception {
- Collection<Entry<K, V>> res = new ArrayList<>();
-
- for (Entry<K, V> o : cache())
- res.add(o);
-
- return res;
- }
- }
-
- /**
- *
- */
- private static class ReplaceTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public ReplaceTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().replace(key, val);
- }
- }
-
- /**
- *
- */
- private static class GetNameTask extends CacheTaskAdapter<Void, Void, String> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public GetNameTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public String call() throws Exception {
- return cache().getName();
- }
- }
-
- /**
- *
- */
- private static class RemoveTask<K> extends CacheTaskAdapter<K, Void, Boolean> {
- /** Key. */
- private final K key;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- */
- public RemoveTask(String cacheName, boolean async, K key) {
- super(cacheName, async);
- this.key = key;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().remove(key);
- }
- }
-
- /**
- *
- */
- private static class PutAllTask<K, V> extends CacheTaskAdapter<K, V, Void> {
- /** Map. */
- private final Map<? extends K, ? extends V> map;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param map Map.
- */
- public PutAllTask(String cacheName, boolean async, Map<? extends K, ? extends V> map) {
- super(cacheName, async);
- this.map = map;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().putAll(map);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class RemoveAllKeysTask<K> extends CacheTaskAdapter<K, Void, Void> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public RemoveAllKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().removeAll(keys);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class GetAllTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public GetAllTask(String cacheName, boolean async, Set<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- }
-
- /** {@inheritDoc} */
- @Override public Map<K, V> call() throws Exception {
- return cache().getAll(keys);
- }
- }
-
- /**
- *
- */
- private static class GetAllOutTxTask<K, V> extends CacheTaskAdapter<K, V, Map<K, V>> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public GetAllOutTxTask(String cacheName, boolean async, Set<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- }
-
- /** {@inheritDoc} */
- @Override public Map<K, V> call() throws Exception {
- return cache().getAllOutTx(keys);
- }
- }
-
- /**
- *
- */
- private static class ContainsKeysTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public ContainsKeysTask(String cacheName, boolean async, Set<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().containsKeys(keys);
- }
- }
-
- /**
- *
- */
- private static class GetAndPutTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public GetAndPutTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().getAndPut(key, val);
- }
- }
-
- /**
- *
- */
- private static class PutIfAbsentTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public PutIfAbsentTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().putIfAbsent(key, val);
- }
- }
-
- /**
- *
- */
- private static class RemoveIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
- /** Key. */
- private final K key;
-
- /** Old value. */
- private final V oldVal;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param oldVal Old value.
- */
- public RemoveIfExistsTask(String cacheName, boolean async, K key, V oldVal) {
- super(cacheName, async);
- this.key = key;
- this.oldVal = oldVal;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().remove(key, oldVal);
- }
- }
-
- /**
- *
- */
- private static class GetAndRemoveTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- */
- public GetAndRemoveTask(String cacheName, boolean async, K key) {
- super(cacheName, async);
- this.key = key;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().getAndRemove(key);
- }
- }
-
- /**
- *
- */
- private static class ReplaceIfExistsTask<K, V> extends CacheTaskAdapter<K, V, Boolean> {
- /** Key. */
- private final K key;
-
- /** Old value. */
- private final V oldVal;
-
- /** New value. */
- private final V newVal;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param oldVal Old value.
- * @param newVal New value.
- */
- public ReplaceIfExistsTask(String cacheName, boolean async, K key, V oldVal, V newVal) {
- super(cacheName, async);
- this.key = key;
- this.oldVal = oldVal;
- this.newVal = newVal;
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().replace(key, oldVal, newVal);
- }
- }
-
- /**
- *
- */
- private static class GetAndReplaceTask<K, V> extends CacheTaskAdapter<K, V, V> {
- /** Key. */
- private final K key;
-
- /** Value. */
- private final V val;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param val Value.
- */
- public GetAndReplaceTask(String cacheName, boolean async, K key, V val) {
- super(cacheName, async);
- this.key = key;
- this.val = val;
- }
-
- /** {@inheritDoc} */
- @Override public V call() throws Exception {
- return cache().getAndReplace(key, val);
- }
- }
-
- /**
- *
- */
- private static class ClearKeyTask<K> extends CacheTaskAdapter<K, Void, Void> {
- /** Key. */
- private final K key;
-
- /** Local. */
- private final boolean loc;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- */
- public ClearKeyTask(String cacheName, boolean async, boolean loc, K key) {
- super(cacheName, async);
- this.key = key;
- this.loc = loc;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- if (loc)
- cache().localClear(key);
- else
- cache().clear(key);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class ClearAllKeys<K> extends CacheTaskAdapter<K, Void, Void> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /** Local. */
- private final boolean loc;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- */
- public ClearAllKeys(String cacheName, boolean async, boolean loc, Set<? extends K> keys) {
- super(cacheName, async);
- this.keys = keys;
- this.loc = loc;
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- if (loc)
- cache().localClearAll(keys);
- else
- cache().clearAll(keys);
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class InvokeTask<K, V, R> extends CacheTaskAdapter<K, V, R> {
- /** Key. */
- private final K key;
-
- /** Processor. */
- private final EntryProcessor<K, V, R> processor;
-
- /** Args. */
- private final Object[] args;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param key Key.
- * @param processor Processor.
- * @param args Args.
- */
- public InvokeTask(String cacheName, boolean async, K key, EntryProcessor<K, V, R> processor,
- Object[] args) {
- super(cacheName, async);
- this.args = args;
- this.key = key;
- this.processor = processor;
- }
-
- /** {@inheritDoc} */
- @Override public R call() throws Exception {
- return cache().invoke(key, processor, args);
- }
- }
-
- /**
- *
- */
- private static class InvokeAllTask<K, V, T> extends CacheTaskAdapter<K, V, Map<K, EntryProcessorResult<T>>> {
- /** Keys. */
- private final Set<? extends K> keys;
-
- /** Processor. */
- private final EntryProcessor<K, V, T> processor;
-
- /** Args. */
- private final Object[] args;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param keys Keys.
- * @param processor Processor.
- * @param args Args.
- */
- public InvokeAllTask(String cacheName, boolean async, Set<? extends K> keys,
- EntryProcessor<K, V, T> processor, Object[] args) {
- super(cacheName, async);
- this.args = args;
- this.keys = keys;
- this.processor = processor;
- }
-
- /** {@inheritDoc} */
- @Override public Map<K, EntryProcessorResult<T>> call() throws Exception {
- return cache().invokeAll(keys, processor, args);
- }
- }
-
- /**
- *
- */
- private static class CloseTask extends CacheTaskAdapter<Void, Void, Void> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public CloseTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().close();
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class DestroyTask extends CacheTaskAdapter<Void, Void, Void> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public DestroyTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Void call() {
- cache().destroy();
-
- return null;
- }
- }
-
- /**
- *
- */
- private static class IsClosedTask extends CacheTaskAdapter<Void, Void, Boolean> {
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public IsClosedTask(String cacheName, boolean async) {
- super(cacheName, async);
- }
-
- /** {@inheritDoc} */
- @Override public Boolean call() throws Exception {
- return cache().isClosed();
- }
- }
-
- /**
- *
- */
- private static class UnwrapTask<R> extends CacheTaskAdapter<Void, Void, R> {
- /** Clazz. */
- private final Class<R> clazz;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- * @param clazz Clazz.
- */
- public UnwrapTask(String cacheName, boolean async, Class<R> clazz) {
- super(cacheName, async);
- this.clazz = clazz;
- }
-
- /** {@inheritDoc} */
- @Override public R call() throws Exception {
- return cache().unwrap(clazz);
- }
- }
-
- /**
- *
- */
- private static abstract class CacheTaskAdapter<K, V, R> implements IgniteCallable<R> {
- /** Ignite. */
- @IgniteInstanceResource
- protected Ignite ignite;
-
- /** Cache name. */
- protected final String cacheName;
-
- /** Async. */
- protected final boolean async;
-
- /**
- * @param cacheName Cache name.
- * @param async Async.
- */
- public CacheTaskAdapter(String cacheName, boolean async) {
- this.async = async;
- this.cacheName = cacheName;
- }
-
- /**
- * Returns cache instance.
- */
- protected IgniteCache<K, V> cache() {
- IgniteCache<K, V> cache = ignite.cache(cacheName);
-
- return async ? cache.withAsync() : cache;
- }
- }
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 7425cb6..1876e24 100644
--- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 198cfa6..03f7fb9 100644
--- a/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/main/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index a45f421..22d74c9 100644
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/155edd8d/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index db88e3b..1ebcf24 100644
--- a/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platform/src/test/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
[15/17] ignite git commit: ignite-1.4.2 - review and minor changes.
Posted by ag...@apache.org.
ignite-1.4.2 - review and minor changes.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/94f549f2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/94f549f2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/94f549f2
Branch: refs/heads/master
Commit: 94f549f2ff03c5f1f3eca29eb337eabf7d566cad
Parents: 155edd8
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Oct 12 13:32:36 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Oct 12 13:32:36 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 479 +------------------
.../processors/cache/GridCacheProcessor.java | 40 --
.../cache/query/GridCacheQueryManager.java | 41 --
.../processors/rest/GridRestProcessor.java | 47 --
.../top/GridTopologyCommandHandler.java | 129 -----
5 files changed, 1 insertion(+), 735 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 9e54f6f..6aba211 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2842,484 +2842,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
}
}
- /** Cache for discovery collections. */
- private class DiscoCache {
- /** Remote nodes. */
- private final List<ClusterNode> rmtNodes;
-
- /** All nodes. */
- private final List<ClusterNode> allNodes;
-
- /** All nodes with at least one cache configured. */
- @GridToStringInclude
- private final Collection<ClusterNode> allNodesWithCaches;
-
- /** All nodes with at least one cache configured. */
- @GridToStringInclude
- private final Collection<ClusterNode> rmtNodesWithCaches;
-
- /** Cache nodes by cache name. */
- @GridToStringInclude
- private final Map<String, Collection<ClusterNode>> allCacheNodes;
-
- /** Remote cache nodes by cache name. */
- @GridToStringInclude
- private final Map<String, Collection<ClusterNode>> rmtCacheNodes;
-
- /** Cache nodes by cache name. */
- @GridToStringInclude
- private final Map<String, Collection<ClusterNode>> affCacheNodes;
-
- /** Caches where at least one node has near cache enabled. */
- @GridToStringInclude
- private final Set<String> nearEnabledCaches;
-
- /** Nodes grouped by version. */
- private final NavigableMap<IgniteProductVersion, Collection<ClusterNode>> nodesByVer;
-
- /** Daemon nodes. */
- private final List<ClusterNode> daemonNodes;
-
- /** Node map. */
- private final Map<UUID, ClusterNode> nodeMap;
-
- /** Local node. */
- private final ClusterNode loc;
-
- /** Highest node order. */
- private final long maxOrder;
-
- /**
- * Cached alive nodes list. As long as this collection doesn't accept {@code null}s use {@link
- * #maskNull(String)} before passing raw cache names to it.
- */
- private final ConcurrentMap<String, Collection<ClusterNode>> aliveCacheNodes;
-
- /**
- * Cached alive remote nodes list. As long as this collection doesn't accept {@code null}s use {@link
- * #maskNull(String)} before passing raw cache names to it.
- */
- private final ConcurrentMap<String, Collection<ClusterNode>> aliveRmtCacheNodes;
-
- /**
- * Cached alive remote nodes with caches.
- */
- private final Collection<ClusterNode> aliveNodesWithCaches;
-
- /**
- * Cached alive server remote nodes with caches.
- */
- private final Collection<ClusterNode> aliveSrvNodesWithCaches;
-
- /**
- * Cached alive remote server nodes with caches.
- */
- private final Collection<ClusterNode> aliveRmtSrvNodesWithCaches;
-
- /**
- * @param loc Local node.
- * @param rmts Remote nodes.
- */
- private DiscoCache(ClusterNode loc, Collection<ClusterNode> rmts) {
- this.loc = loc;
-
- rmtNodes = Collections.unmodifiableList(new ArrayList<>(F.view(rmts, daemonFilter)));
-
- assert !rmtNodes.contains(loc) : "Remote nodes collection shouldn't contain local node" +
- " [rmtNodes=" + rmtNodes + ", loc=" + loc + ']';
-
- List<ClusterNode> all = new ArrayList<>(rmtNodes.size() + 1);
-
- if (!loc.isDaemon())
- all.add(loc);
-
- all.addAll(rmtNodes);
-
- Collections.sort(all, GridNodeOrderComparator.INSTANCE);
-
- allNodes = Collections.unmodifiableList(all);
-
- Map<String, Collection<ClusterNode>> cacheMap = new HashMap<>(allNodes.size(), 1.0f);
- Map<String, Collection<ClusterNode>> rmtCacheMap = new HashMap<>(allNodes.size(), 1.0f);
- Map<String, Collection<ClusterNode>> dhtNodesMap = new HashMap<>(allNodes.size(), 1.0f);
- Collection<ClusterNode> nodesWithCaches = new HashSet<>(allNodes.size());
- Collection<ClusterNode> rmtNodesWithCaches = new HashSet<>(allNodes.size());
-
- aliveCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);
- aliveRmtCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);
- aliveNodesWithCaches = new ConcurrentSkipListSet<>();
- aliveSrvNodesWithCaches = new ConcurrentSkipListSet<>();
- aliveRmtSrvNodesWithCaches = new ConcurrentSkipListSet<>();
- nodesByVer = new TreeMap<>();
-
- long maxOrder0 = 0;
-
- Set<String> nearEnabledSet = new HashSet<>();
-
- for (ClusterNode node : allNodes) {
- assert node.order() != 0 : "Invalid node order [locNode=" + loc + ", node=" + node + ']';
-
- if (node.order() > maxOrder0)
- maxOrder0 = node.order();
-
- boolean hasCaches = false;
-
- for (Map.Entry<String, CachePredicate> entry : registeredCaches.entrySet()) {
- String cacheName = entry.getKey();
-
- CachePredicate filter = entry.getValue();
-
- if (filter.cacheNode(node)) {
- nodesWithCaches.add(node);
-
- if (!loc.id().equals(node.id()))
- rmtNodesWithCaches.add(node);
-
- addToMap(cacheMap, cacheName, node);
-
- if (alive(node.id()))
- addToMap(aliveCacheNodes, maskNull(cacheName), node);
-
- if (filter.dataNode(node))
- addToMap(dhtNodesMap, cacheName, node);
-
- if (filter.nearNode(node))
- nearEnabledSet.add(cacheName);
-
- if (!loc.id().equals(node.id())) {
- addToMap(rmtCacheMap, cacheName, node);
-
- if (alive(node.id()))
- addToMap(aliveRmtCacheNodes, maskNull(cacheName), node);
- }
-
- hasCaches = true;
- }
- }
-
- if (hasCaches) {
- if (alive(node.id())) {
- aliveNodesWithCaches.add(node);
-
- if (!CU.clientNode(node)) {
- aliveSrvNodesWithCaches.add(node);
-
- if (!loc.id().equals(node.id()))
- aliveRmtSrvNodesWithCaches.add(node);
- }
- }
- }
-
- IgniteProductVersion nodeVer = U.productVersion(node);
-
- // Create collection for this version if it does not exist.
- Collection<ClusterNode> nodes = nodesByVer.get(nodeVer);
-
- if (nodes == null) {
- nodes = new ArrayList<>(allNodes.size());
-
- nodesByVer.put(nodeVer, nodes);
- }
-
- nodes.add(node);
- }
-
- // Need second iteration to add this node to all previous node versions.
- for (ClusterNode node : allNodes) {
- IgniteProductVersion nodeVer = U.productVersion(node);
-
- // Get all versions lower or equal node's version.
- NavigableMap<IgniteProductVersion, Collection<ClusterNode>> updateView =
- nodesByVer.headMap(nodeVer, false);
-
- for (Collection<ClusterNode> prevVersions : updateView.values())
- prevVersions.add(node);
- }
-
- maxOrder = maxOrder0;
-
- allCacheNodes = Collections.unmodifiableMap(cacheMap);
- rmtCacheNodes = Collections.unmodifiableMap(rmtCacheMap);
- affCacheNodes = Collections.unmodifiableMap(dhtNodesMap);
- allNodesWithCaches = Collections.unmodifiableCollection(nodesWithCaches);
- this.rmtNodesWithCaches = Collections.unmodifiableCollection(rmtNodesWithCaches);
- nearEnabledCaches = Collections.unmodifiableSet(nearEnabledSet);
-
- daemonNodes = Collections.unmodifiableList(new ArrayList<>(
- F.view(F.concat(false, loc, rmts), F0.not(daemonFilter))));
-
- Map<UUID, ClusterNode> nodeMap = new HashMap<>(allNodes().size() + daemonNodes.size(), 1.0f);
-
- for (ClusterNode n : F.concat(false, allNodes(), daemonNodes()))
- nodeMap.put(n.id(), n);
-
- this.nodeMap = nodeMap;
- }
-
- /**
- * Adds node to map.
- *
- * @param cacheMap Map to add to.
- * @param cacheName Cache name.
- * @param rich Node to add
- */
- private void addToMap(Map<String, Collection<ClusterNode>> cacheMap, String cacheName, ClusterNode rich) {
- Collection<ClusterNode> cacheNodes = cacheMap.get(cacheName);
-
- if (cacheNodes == null) {
- cacheNodes = new ArrayList<>(allNodes.size());
-
- cacheMap.put(cacheName, cacheNodes);
- }
-
- cacheNodes.add(rich);
- }
-
- /** @return Local node. */
- ClusterNode localNode() {
- return loc;
- }
-
- /** @return Remote nodes. */
- Collection<ClusterNode> remoteNodes() {
- return rmtNodes;
- }
-
- /** @return All nodes. */
- Collection<ClusterNode> allNodes() {
- return allNodes;
- }
-
- /**
- * Gets collection of nodes which have version equal or greater than {@code ver}.
- *
- * @param ver Version to check.
- * @return Collection of nodes with version equal or greater than {@code ver}.
- */
- Collection<ClusterNode> elderNodes(IgniteProductVersion ver) {
- Map.Entry<IgniteProductVersion, Collection<ClusterNode>> entry = nodesByVer.ceilingEntry(ver);
-
- if (entry == null)
- return Collections.emptyList();
-
- return entry.getValue();
- }
-
- /**
- * @return Versions map.
- */
- NavigableMap<IgniteProductVersion, Collection<ClusterNode>> versionsMap() {
- return nodesByVer;
- }
-
- /**
- * Gets collection of nodes with at least one cache configured.
- *
- * @param topVer Topology version (maximum allowed node order).
- * @return Collection of nodes.
- */
- Collection<ClusterNode> allNodesWithCaches(final long topVer) {
- return filter(topVer, allNodesWithCaches);
- }
-
- /**
- * Gets all nodes that have cache with given name.
- *
- * @param cacheName Cache name.
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> cacheNodes(@Nullable String cacheName, final long topVer) {
- return filter(topVer, allCacheNodes.get(cacheName));
- }
-
- /**
- * Gets all remote nodes that have cache with given name.
- *
- * @param cacheName Cache name.
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> remoteCacheNodes(@Nullable String cacheName, final long topVer) {
- return filter(topVer, rmtCacheNodes.get(cacheName));
- }
-
- /**
- * Gets all remote nodes that have at least one cache configured.
- *
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> remoteCacheNodes(final long topVer) {
- return filter(topVer, rmtNodesWithCaches);
- }
-
- /**
- * Gets all nodes that have cache with given name and should participate in affinity calculation. With
- * partitioned cache nodes with near-only cache do not participate in affinity node calculation.
- *
- * @param cacheName Cache name.
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> cacheAffinityNodes(@Nullable String cacheName, final long topVer) {
- return filter(topVer, affCacheNodes.get(cacheName));
- }
-
- /**
- * Gets all alive nodes that have cache with given name.
- *
- * @param cacheName Cache name.
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> aliveCacheNodes(@Nullable String cacheName, final long topVer) {
- return filter(topVer, aliveCacheNodes.get(maskNull(cacheName)));
- }
-
- /**
- * Gets all alive remote nodes that have cache with given name.
- *
- * @param cacheName Cache name.
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> aliveRemoteCacheNodes(@Nullable String cacheName, final long topVer) {
- return filter(topVer, aliveRmtCacheNodes.get(maskNull(cacheName)));
- }
-
- /**
- * Gets all alive remote server nodes with at least one cache configured.
- *
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> aliveRemoteServerNodesWithCaches(final long topVer) {
- return filter(topVer, aliveRmtSrvNodesWithCaches);
- }
-
- /**
- * Gets all alive server nodes with at least one cache configured.
- *
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> aliveServerNodesWithCaches(final long topVer) {
- return filter(topVer, aliveSrvNodesWithCaches);
- }
-
- /**
- * Gets all alive remote nodes with at least one cache configured.
- *
- * @param topVer Topology version.
- * @return Collection of nodes.
- */
- Collection<ClusterNode> aliveNodesWithCaches(final long topVer) {
- return filter(topVer, aliveNodesWithCaches);
- }
-
- /**
- * Checks if cache with given name has at least one node with near cache enabled.
- *
- * @param cacheName Cache name.
- * @return {@code True} if cache with given name has at least one node with near cache enabled.
- */
- boolean hasNearCache(@Nullable String cacheName) {
- return nearEnabledCaches.contains(cacheName);
- }
-
- /**
- * Removes left node from cached alives lists.
- *
- * @param leftNode Left node.
- */
- void updateAlives(ClusterNode leftNode) {
- if (leftNode.order() > maxOrder)
- return;
-
- filterNodeMap(aliveCacheNodes, leftNode);
-
- filterNodeMap(aliveRmtCacheNodes, leftNode);
-
- aliveNodesWithCaches.remove(leftNode);
- aliveSrvNodesWithCaches.remove(leftNode);
- aliveRmtSrvNodesWithCaches.remove(leftNode);
- }
-
- /**
- * Creates a copy of nodes map without the given node.
- *
- * @param map Map to copy.
- * @param exclNode Node to exclude.
- */
- private void filterNodeMap(ConcurrentMap<String, Collection<ClusterNode>> map, final ClusterNode exclNode) {
- for (String cacheName : registeredCaches.keySet()) {
- String maskedName = maskNull(cacheName);
-
- while (true) {
- Collection<ClusterNode> oldNodes = map.get(maskedName);
-
- if (oldNodes == null || oldNodes.isEmpty())
- break;
-
- Collection<ClusterNode> newNodes = new ArrayList<>(oldNodes);
-
- if (!newNodes.remove(exclNode))
- break;
-
- if (map.replace(maskedName, oldNodes, newNodes))
- break;
- }
- }
- }
-
- /**
- * Replaces {@code null} with {@code NULL_CACHE_NAME}.
- *
- * @param cacheName Cache name.
- * @return Masked name.
- */
- private String maskNull(@Nullable String cacheName) {
- return cacheName == null ? NULL_CACHE_NAME : cacheName;
- }
-
- /**
- * @param topVer Topology version.
- * @param nodes Nodes.
- * @return Filtered collection (potentially empty, but never {@code null}).
- */
- private Collection<ClusterNode> filter(final long topVer, @Nullable Collection<ClusterNode> nodes) {
- if (nodes == null)
- return Collections.emptyList();
-
- // If no filtering needed, return original collection.
- return nodes.isEmpty() || topVer < 0 || topVer >= maxOrder ?
- nodes :
- F.view(nodes, new P1<ClusterNode>() {
- @Override public boolean apply(ClusterNode node) {
- return node.order() <= topVer;
- }
- });
- }
-
- /** @return Daemon nodes. */
- Collection<ClusterNode> daemonNodes() {
- return daemonNodes;
- }
-
- /**
- * @param id Node ID.
- * @return Node.
- */
- @Nullable ClusterNode node(UUID id) {
- return nodeMap.get(id);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(DiscoCache.class, this, "allNodesWithDaemons", U.toShortString(allNodes));
- }
- } /**
+ /**
* Cache predicate.
*/
private static class CachePredicate {
http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/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 736e630..8c96c0c 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
@@ -3482,46 +3482,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/**
*
*/
- @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor")
- private class TemplateConfigurationFuture extends GridFutureAdapter<Object> {
- /** Start ID. */
- @GridToStringInclude
- private IgniteUuid deploymentId;
-
- /** Cache name. */
- private String cacheName;
-
- /**
- * @param cacheName Cache name.
- * @param deploymentId Deployment ID.
- */
- private TemplateConfigurationFuture(String cacheName, IgniteUuid deploymentId) {
- this.deploymentId = deploymentId;
- this.cacheName = cacheName;
- }
-
- /**
- * @return Start ID.
- */
- public IgniteUuid deploymentId() {
- return deploymentId;
- }
-
- /** {@inheritDoc} */
- @Override public boolean onDone(@Nullable Object res, @Nullable Throwable err) {
- // Make sure to remove future before completion.
- pendingTemplateFuts.remove(maskNull(cacheName), this);
-
- return super.onDone(res, err);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(TemplateConfigurationFuture.class, this);
- }
- } /**
- *
- */
private static class LocalAffinityFunction implements AffinityFunction {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 698b035..1c8107e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -3082,47 +3082,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
}
/**
- *
- */
- private class OffheapIteratorClosure
- extends CX2<T2<Long, Integer>, T2<Long, Integer>, IgniteBiTuple<K, V>> {
- /** */
- private static final long serialVersionUID = 7410163202728985912L;
-
- /** */
- private IgniteBiPredicate<K, V> filter;
-
- /** */
- private boolean keepPortable;
-
- /**
- * @param filter Filter.
- * @param keepPortable Keep portable flag.
- */
- private OffheapIteratorClosure(
- @Nullable IgniteBiPredicate<K, V> filter,
- boolean keepPortable) {
- assert filter != null;
-
- this.filter = filter;
- this.keepPortable = keepPortable;
- }
-
- /** {@inheritDoc} */
- @Nullable @Override public IgniteBiTuple<K, V> applyx(T2<Long, Integer> keyPtr,
- T2<Long, Integer> valPtr)
- throws IgniteCheckedException {
- LazyOffheapEntry e = new LazyOffheapEntry(keyPtr, valPtr);
-
- K key = (K)cctx.unwrapPortableIfNeeded(e.key(), keepPortable);
- V val = (V)cctx.unwrapPortableIfNeeded(e.value(), keepPortable);
-
- if (!filter.apply(key, val))
- return null;
-
- return new IgniteBiTuple<>(e.key(), (V)cctx.unwrapTemporary(e.value()));
- }
- } /**
* Creates user's SQL fields query for given clause. For more information refer to {@link CacheQuery}
* documentation.
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index df79232..4bb02c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -565,53 +565,6 @@ public class GridRestProcessor extends GridProcessorAdapter {
}
/**
- * Applies {@link ConnectorMessageInterceptor}
- * from {@link ConnectorConfiguration#getMessageInterceptor()} ()}
- * to all user parameters in the request.
- *
- * @param req Client request.
- */
- private void interceptRequest(GridRestRequest req) {
- ConnectorMessageInterceptor interceptor = config().getMessageInterceptor();
-
- if (interceptor == null)
- return;
-
- if (req instanceof GridRestCacheRequest) {
- GridRestCacheRequest req0 = (GridRestCacheRequest) req;
-
- req0.key(interceptor.onReceive(req0.key()));
- req0.value(interceptor.onReceive(req0.value()));
- req0.value2(interceptor.onReceive(req0.value2()));
-
- Map<Object, Object> oldVals = req0.values();
-
- if (oldVals != null) {
- Map<Object, Object> newVals = U.newHashMap(oldVals.size());
-
- for (Map.Entry<Object, Object> e : oldVals.entrySet())
- newVals.put(interceptor.onReceive(e.getKey()), interceptor.onReceive(e.getValue()));
-
- req0.values(U.sealMap(newVals));
- }
- }
- else if (req instanceof GridRestTaskRequest) {
- GridRestTaskRequest req0 = (GridRestTaskRequest) req;
-
- List<Object> oldParams = req0.params();
-
- if (oldParams != null) {
- Collection<Object> newParams = new ArrayList<>(oldParams.size());
-
- for (Object o : oldParams)
- newParams.add(interceptor.onReceive(o));
-
- req0.params(U.sealList(newParams));
- }
- }
- }
-
- /**
* Applies {@link ConnectorMessageInterceptor} from
* {@link ConnectorConfiguration#getMessageInterceptor()}
* to all user objects in the response.
http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 3b36c6a..eea29d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -307,135 +307,6 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter {
}
/**
- * Creates node bean out of grid node. Notice that cache attribute is handled separately.
- *
- * @param node Grid node.
- * @param mtr {@code true} to add metrics.
- * @param attr {@code true} to add attributes.
- * @return Grid Node bean.
- */
- private GridClientNodeBean createNodeBean(ClusterNode node, boolean mtr, boolean attr) {
- assert node != null;
-
- GridClientNodeBean nodeBean = new GridClientNodeBean();
-
- nodeBean.setNodeId(node.id());
- nodeBean.setConsistentId(node.consistentId());
- nodeBean.setTcpPort(attribute(node, ATTR_REST_TCP_PORT, 0));
-
- nodeBean.setTcpAddresses(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_ADDRS)));
- nodeBean.setTcpHostNames(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_HOST_NAMES)));
-
- Map<String, CacheMode> nodeCaches = ctx.discovery().nodeCaches(node);
-
- Map<String, String> cacheMap = U.newHashMap(nodeCaches.size());
-
- for (Map.Entry<String, CacheMode> cache : nodeCaches.entrySet()) {
- String cacheName = cache.getKey();
-
- if (CU.isSystemCache(cacheName) || CU.isIgfsCache(ctx.config(), cacheName))
- continue;
-
- String mode = cache.getValue().toString();
-
- if (cacheName != null)
- cacheMap.put(cacheName, mode);
- else
- nodeBean.setDefaultCacheMode(mode);
- }
-
- nodeBean.setCaches(cacheMap);
-
- if (mtr) {
- ClusterMetrics metrics = node.metrics();
-
- GridClientNodeMetricsBean metricsBean = new GridClientNodeMetricsBean();
-
- metricsBean.setStartTime(metrics.getStartTime());
- metricsBean.setAverageActiveJobs(metrics.getAverageActiveJobs());
- metricsBean.setAverageCancelledJobs(metrics.getAverageCancelledJobs());
- metricsBean.setAverageCpuLoad(metrics.getAverageCpuLoad());
- metricsBean.setAverageJobExecuteTime(metrics.getAverageJobExecuteTime());
- metricsBean.setAverageJobWaitTime(metrics.getAverageJobWaitTime());
- metricsBean.setAverageRejectedJobs(metrics.getAverageRejectedJobs());
- metricsBean.setAverageWaitingJobs(metrics.getAverageWaitingJobs());
- metricsBean.setCurrentActiveJobs(metrics.getCurrentActiveJobs());
- metricsBean.setCurrentCancelledJobs(metrics.getCurrentCancelledJobs());
- metricsBean.setCurrentCpuLoad(metrics.getCurrentCpuLoad());
- metricsBean.setCurrentGcCpuLoad(metrics.getCurrentGcCpuLoad());
- metricsBean.setCurrentDaemonThreadCount(metrics.getCurrentDaemonThreadCount());
- metricsBean.setCurrentIdleTime(metrics.getCurrentIdleTime());
- metricsBean.setCurrentJobExecuteTime(metrics.getCurrentJobExecuteTime());
- metricsBean.setCurrentJobWaitTime(metrics.getCurrentJobWaitTime());
- metricsBean.setCurrentRejectedJobs(metrics.getCurrentRejectedJobs());
- metricsBean.setCurrentThreadCount(metrics.getCurrentThreadCount());
- metricsBean.setCurrentWaitingJobs(metrics.getCurrentWaitingJobs());
- metricsBean.setHeapMemoryCommitted(metrics.getHeapMemoryCommitted());
- metricsBean.setHeapMemoryInitialized(metrics.getHeapMemoryInitialized());
- metricsBean.setHeapMemoryMaximum(metrics.getHeapMemoryMaximum());
- metricsBean.setHeapMemoryUsed(metrics.getHeapMemoryUsed());
- metricsBean.setLastDataVersion(metrics.getLastDataVersion());
- metricsBean.setLastUpdateTime(metrics.getLastUpdateTime());
- metricsBean.setMaximumActiveJobs(metrics.getMaximumActiveJobs());
- metricsBean.setMaximumCancelledJobs(metrics.getMaximumCancelledJobs());
- metricsBean.setMaximumJobExecuteTime(metrics.getMaximumJobExecuteTime());
- metricsBean.setMaximumJobWaitTime(metrics.getMaximumJobWaitTime());
- metricsBean.setMaximumRejectedJobs(metrics.getMaximumRejectedJobs());
- metricsBean.setMaximumThreadCount(metrics.getMaximumThreadCount());
- metricsBean.setMaximumWaitingJobs(metrics.getMaximumWaitingJobs());
- metricsBean.setNodeStartTime(metrics.getNodeStartTime());
- metricsBean.setNonHeapMemoryCommitted(metrics.getNonHeapMemoryCommitted());
- metricsBean.setNonHeapMemoryInitialized(metrics.getNonHeapMemoryInitialized());
- metricsBean.setNonHeapMemoryMaximum(metrics.getNonHeapMemoryMaximum());
- metricsBean.setNonHeapMemoryUsed(metrics.getNonHeapMemoryUsed());
- metricsBean.setStartTime(metrics.getStartTime());
- metricsBean.setTotalCancelledJobs(metrics.getTotalCancelledJobs());
- metricsBean.setTotalCpus(metrics.getTotalCpus());
- metricsBean.setTotalExecutedJobs(metrics.getTotalExecutedJobs());
- metricsBean.setTotalIdleTime(metrics.getTotalIdleTime());
- metricsBean.setTotalRejectedJobs(metrics.getTotalRejectedJobs());
- metricsBean.setTotalStartedThreadCount(metrics.getTotalStartedThreadCount());
- metricsBean.setTotalExecutedTasks(metrics.getTotalExecutedTasks());
- metricsBean.setSentMessagesCount(metrics.getSentMessagesCount());
- metricsBean.setSentBytesCount(metrics.getSentBytesCount());
- metricsBean.setReceivedMessagesCount(metrics.getReceivedMessagesCount());
- metricsBean.setReceivedBytesCount(metrics.getReceivedBytesCount());
- metricsBean.setUpTime(metrics.getUpTime());
-
- nodeBean.setMetrics(metricsBean);
- }
-
- if (attr) {
- Map<String, Object> attrs = new HashMap<>(node.attributes());
-
- attrs.remove(ATTR_CACHE);
- attrs.remove(ATTR_TX_CONFIG);
- attrs.remove(ATTR_SECURITY_SUBJECT);
- attrs.remove(ATTR_SECURITY_CREDENTIALS);
-
- for (Iterator<Map.Entry<String, Object>> i = attrs.entrySet().iterator(); i.hasNext();) {
- Map.Entry<String, Object> e = i.next();
-
- if (!e.getKey().startsWith("org.apache.ignite.") && !e.getKey().startsWith("plugins.") &&
- System.getProperty(e.getKey()) == null) {
- i.remove();
-
- continue;
- }
-
- if (e.getValue() != null) {
- if (e.getValue().getClass().isEnum() || e.getValue() instanceof InetAddress)
- e.setValue(e.getValue().toString());
- else if (e.getValue().getClass().isArray())
- i.remove();
- }
- }
-
- nodeBean.setAttributes(attrs);
- }
-
- return nodeBean;
- } /**
* @param col Collection;
* @return Non-empty list.
*/
[12/17] ignite git commit: ignite-1526: fixed merging conflicts
Posted by ag...@apache.org.
ignite-1526: fixed merging conflicts
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6afc2fc3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6afc2fc3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6afc2fc3
Branch: refs/heads/master
Commit: 6afc2fc3ca390dad7834105b53804b89f50aecf2
Parents: 5fc682f
Author: Andrey Gura <ag...@gridgain.com>
Authored: Fri Oct 9 14:23:34 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Oct 9 14:23:34 2015 +0300
----------------------------------------------------------------------
.../testframework/junits/multijvm/IgniteCacheProcessProxy.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6afc2fc3/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 04d7893..02c6a26 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -553,7 +553,7 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
Collection<Entry<K, V>> res = new ArrayList<>();
for (Entry<K, V> e : cache().localEntries(peekModes))
- res.add(new CacheEntryImpl<>(e.getKey(), e.getValue()));
+ res.add(e);
return res;
}
[02/17] ignite git commit: ignite-1.4 Added schema-import-demo to
exclude. (cherry picked from commit 008c273)
Posted by ag...@apache.org.
ignite-1.4 Added schema-import-demo to exclude.
(cherry picked from commit 008c273)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2cdf60a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2cdf60a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2cdf60a
Branch: refs/heads/master
Commit: d2cdf60ad5b6500d98dfd7189dbfe7bedc3af354
Parents: e5e72ea
Author: Andrey <an...@gridgain.com>
Authored: Fri Sep 25 10:29:51 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Sep 25 13:01:12 2015 +0700
----------------------------------------------------------------------
assembly/dependencies-fabric.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2cdf60a/assembly/dependencies-fabric.xml
----------------------------------------------------------------------
diff --git a/assembly/dependencies-fabric.xml b/assembly/dependencies-fabric.xml
index f69ffde..f50847e 100644
--- a/assembly/dependencies-fabric.xml
+++ b/assembly/dependencies-fabric.xml
@@ -120,11 +120,11 @@
<exclude>org.apache.ignite:ignite-extdata-uri</exclude>
<exclude>org.apache.ignite:ignite-extdata-uri-dep</exclude>
<exclude>org.apache.ignite:ignite-examples</exclude>
+ <exclude>org.apache.ignite:ignite-schema-import-demo</exclude>
<exclude>org.apache.ignite:ignite-indexing</exclude>
<exclude>org.apache.ignite:ignite-visor-console</exclude>
<exclude>org.apache.ignite:ignite-visor-console_2.10</exclude>
<exclude>org.apache.ignite:ignite-visor-plugins</exclude>
- <exclude>org.apache.ignite:ignite-visor-trial</exclude>
<exclude>org.apache.ignite:ignite-hadoop</exclude>
<exclude>org.apache.ignite:ignite-schema-import</exclude>
<exclude>org.apache.ignite:ignite-codegen</exclude>
[05/17] ignite git commit: fixed sha1 & md5,
again (cherry picked from commit 7752aa9)
Posted by ag...@apache.org.
fixed sha1 & md5, again
(cherry picked from commit 7752aa9)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ff96888e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ff96888e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ff96888e
Branch: refs/heads/master
Commit: ff96888e0ae682ec2c2623c556f332235f25c9b8
Parents: f051e49
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Sep 25 16:01:40 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Sep 25 16:20:59 2015 +0300
----------------------------------------------------------------------
pom.xml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff96888e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 191ed3b..6a17668 100644
--- a/pom.xml
+++ b/pom.xml
@@ -626,7 +626,15 @@
</fileset>
</copy>
- <!-- appending filename to md5 and sha1 files. to be improved. -->
+ <!-- appending filename to md5 and sha1 files. to be improved!! -->
+ <!-- update versions task will replace " " to " ", so additional echo added. -->
+ <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.md5" append="true" message=" " />
+ <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.sha1" append="true" message=" " />
+ <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.md5" append="true" message=" " />
+ <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.sha1" append="true" message=" " />
+ <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.md5" append="true" message=" " />
+ <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.sha1" append="true" message=" " />
+
<echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
<echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.sha1" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
<echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-hadoop-${project.version}-bin.zip" />
[17/17] ignite git commit: Merging fixes to master.
Posted by ag...@apache.org.
Merging fixes to master.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6844370d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6844370d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6844370d
Branch: refs/heads/master
Commit: 6844370dc16790423a59fb9e9f6ec39ca0699b9b
Parents: 075e7d0 30b731b
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Oct 12 20:14:14 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Oct 12 20:14:14 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 479 +------------------
.../processors/cache/GridCacheIoManager.java | 29 +-
.../processors/cache/GridCacheProcessor.java | 63 +--
.../dht/GridClientPartitionTopology.java | 13 +-
.../distributed/dht/GridDhtLocalPartition.java | 3 +-
.../dht/GridDhtPartitionTopologyImpl.java | 12 +-
.../GridDhtPartitionDemandMessage.java | 4 +-
.../GridDhtPartitionSupplyMessage.java | 3 +-
.../GridDhtPartitionsExchangeFuture.java | 12 +-
.../preloader/GridDhtPartitionsFullMessage.java | 12 +-
.../GridDhtPartitionsSingleMessage.java | 11 +-
.../dht/preloader/GridDhtPreloader.java | 18 +-
.../cache/query/GridCacheQueryManager.java | 41 --
.../processors/rest/GridRestProcessor.java | 47 --
.../top/GridTopologyCommandHandler.java | 129 -----
.../communication/tcp/TcpCommunicationSpi.java | 22 +-
.../IgniteCacheConfigurationTemplateTest.java | 31 ++
.../dht/GridCacheDhtPreloadPerformanceTest.java | 133 +++++
.../near/GridCacheNearTxForceKeyTest.java | 2 +-
19 files changed, 270 insertions(+), 794 deletions(-)
----------------------------------------------------------------------