You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2015/07/20 10:41:41 UTC
[01/10] incubator-ignite git commit: GG-10559 - Improvements.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-961 d815e51b4 -> 72b91c180
GG-10559 - Improvements.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/692dd041
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/692dd041
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/692dd041
Branch: refs/heads/ignite-961
Commit: 692dd041af8c45347f193ce6c70bfeff59e1e178
Parents: c559692
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jul 16 18:18:26 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jul 16 18:18:26 2015 -0700
----------------------------------------------------------------------
.../org/apache/ignite/plugin/security/SecurityPermission.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/692dd041/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
index 3cab511..0e660d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
@@ -45,14 +45,17 @@ public enum SecurityPermission {
/** Events {@code disable} permission. */
EVENTS_DISABLE,
- /** Common visor tasks permission. */
+ /** Common visor view tasks permission. */
ADMIN_VIEW,
/** Visor cache read (query) permission. */
ADMIN_QUERY,
/** Visor cache load permission. */
- ADMIN_CACHE;
+ ADMIN_CACHE,
+
+ /** Visor admin operations permissions. */
+ ADMIN_OPS;
/** Enumerated values. */
private static final SecurityPermission[] VALS = values();
[08/10] incubator-ignite git commit: Fixed typo and minor fixes to
javadocs.
Posted by iv...@apache.org.
Fixed typo and minor fixes to javadocs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ede96121
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ede96121
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ede96121
Branch: refs/heads/ignite-961
Commit: ede961215ce3a596f7dcb90e82f48aa723d892bf
Parents: 192fefc
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Jul 20 15:06:04 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Jul 20 15:06:04 2015 +0700
----------------------------------------------------------------------
.../ignite/schema/ui/SchemaImportApp.java | 36 ++++++++++++++++----
1 file changed, 29 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ede96121/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
index 00d1bc8..7b9c220 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
@@ -109,7 +109,7 @@ public class SchemaImportApp extends Application {
"jdbc:mysql://[host]:[port]/[database]", "root"),
new Preset("mssql", "Microsoft SQL Server", "sqljdbc41.jar", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"jdbc:sqlserver://[host]:[port][;databaseName=database]", "sa"),
- new Preset("posgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver",
+ new Preset("postgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver",
"jdbc:postgresql://[host]:[port]/[database]", "sa"),
new Preset("custom", "Custom server...", "custom-jdbc.jar", "org.custom.Driver", "jdbc:custom", "sa")
};
@@ -444,6 +444,11 @@ public class SchemaImportApp extends Application {
final boolean singleXml = xmlSingleFileCh.isSelected();
Runnable task = new Task<Void>() {
+ /**
+ * @param pojo POJO descriptor to check.
+ * @param selected Selected flag.
+ * @param msg Message to show in case of check failed.
+ */
private void checkEmpty(final PojoDescriptor pojo, boolean selected, String msg) {
if (!selected) {
Platform.runLater(new Runnable() {
@@ -694,6 +699,8 @@ public class SchemaImportApp extends Application {
/**
* Create connection pane with controls.
+ *
+ * @return Pane with connection controls.
*/
private Pane createConnectionPane() {
connPnl = paneEx(10, 10, 0, 10);
@@ -1110,10 +1117,10 @@ public class SchemaImportApp extends Application {
if (curPojo != null) {
TableView.TableViewSelectionModel<PojoDescriptor> selMdl = pojosTbl.getSelectionModel();
- List<Integer> idxs = new ArrayList<>(selMdl.getSelectedIndices());
+ List<Integer> selIndices = new ArrayList<>(selMdl.getSelectedIndices());
- if (idxs.size() > 1) {
- for (Integer idx : idxs) {
+ if (selIndices.size() > 1) {
+ for (Integer idx : selIndices) {
if (pojos.get(idx) != curPojo)
selMdl.clearSelection(idx);
}
@@ -1242,6 +1249,7 @@ public class SchemaImportApp extends Application {
*
* @param key Property key.
* @param dflt Default value.
+ * @return Property value as string.
*/
private String getStringProp(String key, String dflt) {
String val = prefs.getProperty(key);
@@ -1267,6 +1275,7 @@ public class SchemaImportApp extends Application {
*
* @param key Property key.
* @param dflt Default value.
+ * @return Property value as int.
*/
private int getIntProp(String key, int dflt) {
String val = prefs.getProperty(key);
@@ -1297,6 +1306,7 @@ public class SchemaImportApp extends Application {
*
* @param key Property key.
* @param dflt Default value.
+ * @return Property value as boolean.
*/
private boolean getBoolProp(String key, boolean dflt) {
String val = prefs.getProperty(key);
@@ -1563,7 +1573,11 @@ public class SchemaImportApp extends Application {
/** Combo box. */
private final ComboBox<String> comboBox;
- /** Creates a ComboBox cell factory for use in TableColumn controls. */
+ /**
+ * Creates a ComboBox cell factory for use in TableColumn controls.
+ *
+ * @return Cell factory for cell with java types combobox.
+ */
public static Callback<TableColumn<PojoField, String>, TableCell<PojoField, String>> cellFactory() {
return new Callback<TableColumn<PojoField, String>, TableCell<PojoField, String>>() {
@Override public TableCell<PojoField, String> call(TableColumn<PojoField, String> col) {
@@ -1637,7 +1651,11 @@ public class SchemaImportApp extends Application {
* Special table cell to select schema or table.
*/
private static class PojoDescriptorCell extends TableCell<PojoDescriptor, Boolean> {
- /** Creates a ComboBox cell factory for use in TableColumn controls. */
+ /**
+ * Creates a ComboBox cell factory for use in TableColumn controls.
+ *
+ * @return Cell factory for schema / table selection.
+ */
public static Callback<TableColumn<PojoDescriptor, Boolean>, TableCell<PojoDescriptor, Boolean>> cellFactory() {
return new Callback<TableColumn<PojoDescriptor, Boolean>, TableCell<PojoDescriptor, Boolean>>() {
@Override public TableCell<PojoDescriptor, Boolean> call(TableColumn<PojoDescriptor, Boolean> col) {
@@ -1694,7 +1712,11 @@ public class SchemaImportApp extends Application {
* Special table cell to select "used" fields for code generation.
*/
private static class PojoFieldUseCell extends TableCell<PojoField, Boolean> {
- /** Creates a ComboBox cell factory for use in TableColumn controls. */
+ /**
+ * Creates a ComboBox cell factory for use in TableColumn controls.
+ *
+ * @return Cell factory for used fields selection.
+ */
public static Callback<TableColumn<PojoField, Boolean>, TableCell<PojoField, Boolean>> cellFactory() {
return new Callback<TableColumn<PojoField, Boolean>, TableCell<PojoField, Boolean>>() {
@Override public TableCell<PojoField, Boolean> call(TableColumn<PojoField, Boolean> col) {
[02/10] incubator-ignite git commit: 1.3.2-SNAPSHOT
Posted by iv...@apache.org.
1.3.2-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7d27103c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7d27103c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7d27103c
Branch: refs/heads/ignite-961
Commit: 7d27103c39be11673f52b6b68ec087742237e258
Parents: 692dd04
Author: Ignite Teamcity <ig...@apache.org>
Authored: Fri Jul 17 05:04:24 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Fri Jul 17 05:04:24 2015 +0300
----------------------------------------------------------------------
examples/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/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
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 +-
pom.xml | 2 +-
41 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index a94b888..6d3fb07 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index fd3e41b..3c55e7d 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 6e22668..2edb962 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 954d19b..4a568b0 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index fbbf4be..68204f3 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 60c87df..a183522 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 2471585..ea9615c 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 2c0dfda..c42be3d 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/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 3a6aa6f..2313ac3 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.3.1-SNAPSHOT
+ignite.version=1.3.2-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 19c9a28..5a80380 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/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 2ea01d9..b8e4742 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 984c744..e4e5bb6 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 3ee4360..b1be8ea 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index a9fbbe8..ecee8d4 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index a07c5b9..555778c 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 54fea68..5976baa 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index dac173f..067ec2d 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 3b5a0be..ed864ce 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index abe3497..ca5546c 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 9541bd4..5a8cb72 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index d1f4823..0489518 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index a8061ad..8a63a57 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<mesos.version>0.22.0</mesos.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index cc6cbc7..5cb522d 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 2dcaba8..0770410 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 863aaa4..4515772 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 70b38dd..3b734b0 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index e542bdb..959e231 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 9eb7958..8fa09cb 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 2dedf6d..82b08bc 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 4ea1a82..107424a 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index f772084..fdd2b0a 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 1d3e4e1..9fddc21 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 5179489..f58fbdc 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 8c93df7..8c6224f 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/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 f37d4ed..fe56751 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index a2d25bc..b310d4c 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 4aca66b..4417b49 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.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 45ae1f0..74dd525 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 4d9adb7..1044df1 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 2679603..35728fa 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<properties>
<hadoop.version>2.7.0</hadoop.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d27103c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 85bfe14..29f5fa5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[09/10] incubator-ignite git commit: #ignite-1087: AffinityRun runs
job on not primary nodes.
Posted by iv...@apache.org.
#ignite-1087: AffinityRun runs job on not primary nodes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f9d2a2ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f9d2a2ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f9d2a2ef
Branch: refs/heads/ignite-961
Commit: f9d2a2ef4424bf166912594791b6414b9a9e8457
Parents: ede9612
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 20 11:25:00 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 20 11:25:00 2015 +0300
----------------------------------------------------------------------
.../ignite/compute/ComputeJobResultPolicy.java | 3 +-
.../failover/GridFailoverContextImpl.java | 28 ++-
.../managers/failover/GridFailoverManager.java | 13 +-
.../processors/closure/AffinityTask.java | 35 ++++
.../closure/GridClosureProcessor.java | 63 ++++++-
.../processors/task/GridTaskWorker.java | 24 ++-
.../ignite/spi/failover/FailoverContext.java | 18 ++
.../spi/failover/always/AlwaysFailoverSpi.java | 25 +++
.../cache/CacheAffinityCallSelfTest.java | 172 +++++++++++++++++++
.../cache/GridCacheAffinityRoutingSelfTest.java | 157 ++++++++++++++++-
.../spi/failover/GridFailoverTestContext.java | 10 ++
.../ignite/testsuites/IgniteCacheTestSuite.java | 1 +
12 files changed, 533 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java b/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
index 37aba91..26eb542 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
@@ -50,8 +50,7 @@ public enum ComputeJobResultPolicy {
* @param ord Ordinal value.
* @return Enumerated value.
*/
- @Nullable
- public static ComputeJobResultPolicy fromOrdinal(byte ord) {
+ @Nullable public static ComputeJobResultPolicy fromOrdinal(byte ord) {
return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
index a3f8e44..c2b104e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.managers.loadbalancer.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.spi.failover.*;
+import org.jetbrains.annotations.*;
import java.util.*;
@@ -41,15 +42,26 @@ public class GridFailoverContextImpl implements FailoverContext {
@GridToStringExclude
private final GridLoadBalancerManager loadMgr;
+ /** Affinity key for affinityCall. */
+ private final Object affKey;
+
+ /** Affinity cache name for affinityCall. */
+ private final String affCacheName;
+
/**
* Initializes failover context.
*
* @param taskSes Grid task session.
* @param jobRes Failed job result.
* @param loadMgr Load manager.
+ * @param affKey Affinity key.
+ * @param affCacheName Affinity cache name.
*/
- public GridFailoverContextImpl(GridTaskSessionImpl taskSes, ComputeJobResult jobRes,
- GridLoadBalancerManager loadMgr) {
+ public GridFailoverContextImpl(GridTaskSessionImpl taskSes,
+ ComputeJobResult jobRes,
+ GridLoadBalancerManager loadMgr,
+ @Nullable Object affKey,
+ @Nullable String affCacheName) {
assert taskSes != null;
assert jobRes != null;
assert loadMgr != null;
@@ -57,6 +69,8 @@ public class GridFailoverContextImpl implements FailoverContext {
this.taskSes = taskSes;
this.jobRes = jobRes;
this.loadMgr = loadMgr;
+ this.affKey = affKey;
+ this.affCacheName = affCacheName;
}
/** {@inheritDoc} */
@@ -75,6 +89,16 @@ public class GridFailoverContextImpl implements FailoverContext {
}
/** {@inheritDoc} */
+ @Nullable @Override public Object affinityKey() {
+ return affKey;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String affinityCacheName() {
+ return affCacheName;
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridFailoverContextImpl.class, this);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
index 714cccb..dffc965 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
@@ -23,6 +23,7 @@ import org.apache.ignite.compute.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.*;
import org.apache.ignite.spi.failover.*;
+import org.jetbrains.annotations.*;
import java.util.*;
@@ -56,11 +57,17 @@ public class GridFailoverManager extends GridManagerAdapter<FailoverSpi> {
/**
* @param taskSes Task session.
* @param jobRes Job result.
- * @param top Collection of all top nodes that does not include the failed node.
+ * @param top Collection of all topology nodes.
+ * @param affKey Affinity key.
+ * @param affCacheName Affinity cache name.
* @return New node to route this job to.
*/
- public ClusterNode failover(GridTaskSessionImpl taskSes, ComputeJobResult jobRes, List<ClusterNode> top) {
+ public ClusterNode failover(GridTaskSessionImpl taskSes,
+ ComputeJobResult jobRes,
+ List<ClusterNode> top,
+ @Nullable Object affKey,
+ @Nullable String affCacheName) {
return getSpi(taskSes.getFailoverSpi()).failover(new GridFailoverContextImpl(taskSes, jobRes,
- ctx.loadBalancing()), top);
+ ctx.loadBalancing(), affKey, affCacheName), top);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
new file mode 100644
index 0000000..1b32444
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
@@ -0,0 +1,35 @@
+/*
+ * 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.closure;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * Affinity mapped task.
+ */
+public interface AffinityTask {
+ /**
+ * @return Affinity key.
+ */
+ public Object affinityKey();
+
+ /**
+ * @return Affinity cache name.
+ */
+ @Nullable public String affinityCacheName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 658557e..21bfc11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -413,9 +413,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
final ClusterNode node = ctx.affinity().mapKeyToNode(cacheName, affKey0);
+ if (node == null)
+ return ComputeTaskInternalFuture.finishedFuture(ctx, T5.class, U.emptyTopologyException());
+
ctx.task().setThreadContext(TC_SUBGRID, nodes);
- return ctx.task().execute(new T5(node, job), null, false);
+ return ctx.task().execute(new T5(node, job, affKey0, cacheName), null, false);
}
catch (IgniteCheckedException e) {
return ComputeTaskInternalFuture.finishedFuture(ctx, T5.class, e);
@@ -445,9 +448,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
final ClusterNode node = ctx.affinity().mapKeyToNode(cacheName, affKey0);
+ if (node == null)
+ return ComputeTaskInternalFuture.finishedFuture(ctx, T4.class, U.emptyTopologyException());
+
ctx.task().setThreadContext(TC_SUBGRID, nodes);
- return ctx.task().execute(new T4(node, job), null, false);
+ return ctx.task().execute(new T4(node, job, affKey0, cacheName), null, false);
}
catch (IgniteCheckedException e) {
return ComputeTaskInternalFuture.finishedFuture(ctx, T4.class, e);
@@ -1223,7 +1229,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
/**
*/
- private static class T4 extends TaskNoReduceAdapter<Void> implements GridNoImplicitInjection {
+ private static class T4 extends TaskNoReduceAdapter<Void> implements GridNoImplicitInjection, AffinityTask {
/** */
private static final long serialVersionUID = 0L;
@@ -1233,15 +1239,27 @@ public class GridClosureProcessor extends GridProcessorAdapter {
/** */
private Runnable job;
+ /** */
+ private Object affKey;
+
+ /** */
+ private String affCacheName;
+
/**
* @param node Cluster node.
* @param job Job.
+ * @param affKey Affinity key.
+ * @param affCacheName Affinity cache name.
*/
- private T4(ClusterNode node, Runnable job) {
+ private T4(ClusterNode node, Runnable job, Object affKey, String affCacheName) {
super(U.peerDeployAware0(job));
+ assert affKey != null;
+
this.node = node;
this.job = job;
+ this.affKey = affKey;
+ this.affCacheName = affCacheName;
}
/** {@inheritDoc} */
@@ -1250,11 +1268,22 @@ public class GridClosureProcessor extends GridProcessorAdapter {
return Collections.singletonMap(job, node);
}
+
+ /** {@inheritDoc} */
+ @Override public Object affinityKey() {
+ return affKey;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String affinityCacheName() {
+ return affCacheName;
+ }
}
/**
*/
- private static class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R> implements GridNoImplicitInjection {
+ private static class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R> implements
+ GridNoImplicitInjection, AffinityTask {
/** */
private static final long serialVersionUID = 0L;
@@ -1264,15 +1293,27 @@ public class GridClosureProcessor extends GridProcessorAdapter {
/** */
private Callable<R> job;
+ /** */
+ private Object affKey;
+
+ /** */
+ private String affCacheName;
+
/**
* @param node Cluster node.
* @param job Job.
+ * @param affKey Affinity key.
+ * @param affCacheName Affinity cache name.
*/
- private T5(ClusterNode node, Callable<R> job) {
+ private T5(ClusterNode node, Callable<R> job, Object affKey, String affCacheName) {
super(U.peerDeployAware0(job));
+ assert affKey != null;
+
this.node = node;
this.job = job;
+ this.affKey = affKey;
+ this.affCacheName = affCacheName;
}
/** {@inheritDoc} */
@@ -1291,6 +1332,16 @@ public class GridClosureProcessor extends GridProcessorAdapter {
throw new IgniteException("Failed to find successful job result: " + res);
}
+
+ /** {@inheritDoc} */
+ @Override public Object affinityKey() {
+ return affKey;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String affinityCacheName() {
+ return affCacheName;
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
index 133a31f..f241bcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.compute.*;
import org.apache.ignite.internal.managers.deployment.*;
+import org.apache.ignite.internal.processors.closure.*;
import org.apache.ignite.internal.processors.timeout.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -136,6 +137,12 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
private final boolean noFailover;
/** */
+ private final Object affKey;
+
+ /** */
+ private final String affCache;
+
+ /** */
private final UUID subjId;
/** Continuous mapper. */
@@ -245,6 +252,17 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
Boolean noFailover = getThreadContext(TC_NO_FAILOVER);
this.noFailover = noFailover != null ? noFailover : false;
+
+ if (task instanceof AffinityTask) {
+ AffinityTask affTask = (AffinityTask)task;
+
+ affKey = affTask.affinityKey();
+ affCache = affTask.affinityCacheName();
+ }
+ else {
+ affKey = null;
+ affCache = null;
+ }
}
/**
@@ -397,7 +415,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
ses.setClassLoader(dep.classLoader());
- final List<ClusterNode> shuffledNodes = getTaskTopology();
+ // Nodes are ignored by affinity tasks.
+ final List<ClusterNode> shuffledNodes =
+ affKey == null ? getTaskTopology() : Collections.<ClusterNode>emptyList();
// Load balancer.
ComputeLoadBalancer balancer = ctx.loadBalancing().getLoadBalancer(ses, shuffledNodes);
@@ -968,7 +988,7 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
ctx.resource().invokeAnnotated(dep, jobRes.getJob(), ComputeJobBeforeFailover.class);
// Map to a new node.
- ClusterNode node = ctx.failover().failover(ses, jobRes, new ArrayList<>(top));
+ ClusterNode node = ctx.failover().failover(ses, jobRes, new ArrayList<>(top), affKey, affCache);
if (node == null) {
String msg = "Failed to failover a job to another node (failover SPI returned null) [job=" +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java b/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
index b0cae92..865f1a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
@@ -20,6 +20,8 @@ package org.apache.ignite.spi.failover;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
import java.util.*;
@@ -52,4 +54,20 @@ public interface FailoverContext {
* @throws IgniteException If anything failed.
*/
public ClusterNode getBalancedNode(List<ClusterNode> top) throws IgniteException;
+
+ /**
+ * Gets affinity key for {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}
+ * and {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)}.
+ *
+ * @return Affinity key.
+ */
+ @Nullable public Object affinityKey();
+
+ /**
+ * Returns affinity cache name {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}
+ * and {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)}.
+ *
+ * @return Cache name.
+ */
+ @Nullable public String affinityCacheName();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
index e075d3e..e925995 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
@@ -92,6 +92,11 @@ public class AlwaysFailoverSpi extends IgniteSpiAdapter implements FailoverSpi,
*/
public static final String FAILED_NODE_LIST_ATTR = "gg:failover:failednodelist";
+ /**
+ * Name of job context attribute containing number of affinity call attempts.
+ */
+ public static final String AFFINITY_CALL_ATTEMPT = "ignite:failover:affinitycallattempt";
+
/** Maximum attempts attribute key should be the same on all nodes. */
public static final String MAX_FAILOVER_ATTEMPT_ATTR = "gg:failover:maxattempts";
@@ -173,6 +178,26 @@ public class AlwaysFailoverSpi extends IgniteSpiAdapter implements FailoverSpi,
return null;
}
+ if (ctx.affinityKey() != null) {
+ Integer affCallAttempt = ctx.getJobResult().getJobContext().getAttribute(AFFINITY_CALL_ATTEMPT);
+
+ if (affCallAttempt == null)
+ affCallAttempt = 1;
+
+ if (maxFailoverAttempts <= affCallAttempt) {
+ U.warn(log, "Job failover failed because number of maximum failover attempts for affinity call" +
+ " is exceeded [failedJob=" + ctx.getJobResult().getJob() + ", maxFailoverAttempts=" +
+ maxFailoverAttempts + ']');
+
+ return null;
+ }
+ else {
+ ctx.getJobResult().getJobContext().setAttribute(AFFINITY_CALL_ATTEMPT, affCallAttempt + 1);
+
+ return ignite.affinity(ctx.affinityCacheName()).mapKeyToNode(ctx.affinityKey());
+ }
+ }
+
Collection<UUID> failedNodes = ctx.getJobResult().getJobContext().getAttribute(FAILED_NODE_LIST_ATTR);
if (failedNodes == null)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
new file mode 100644
index 0000000..c4436ca
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.spi.failover.always.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Test for {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)} and
+ * {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}.
+ */
+public class CacheAffinityCallSelfTest extends GridCommonAbstractTest {
+ /** */
+ private static final String CACHE_NAME = "myCache";
+
+ /** */
+ private static final int MAX_FAILOVER_ATTEMPTS = 5;
+
+ /** */
+ private static final int SERVERS_COUNT = 4;
+
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+ spi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(spi);
+
+ AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi();
+ failSpi.setMaximumFailoverAttempts(MAX_FAILOVER_ATTEMPTS);
+ cfg.setFailoverSpi(failSpi);
+
+ CacheConfiguration ccfg = defaultCacheConfiguration();
+ ccfg.setName(CACHE_NAME);
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setBackups(1);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ if (gridName.equals(getTestGridName(SERVERS_COUNT)))
+ cfg.setClientMode(true);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinityCallRestartNode() throws Exception {
+ startGrids(4);
+
+ Integer key = primaryKey(grid(0).cache(CACHE_NAME));
+
+ IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ U.sleep(500);
+ stopGrid(0);
+
+ return null;
+ }
+ });
+
+ while (!fut.isDone())
+ grid(1).compute().affinityCall(CACHE_NAME, key, new CheckCallable(key));
+
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinityCallNoServerNode() throws Exception {
+ startGrids(SERVERS_COUNT + 1);
+
+ final Integer key = 1;
+
+ final Ignite client = grid(SERVERS_COUNT);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ for (int i = 0; i < SERVERS_COUNT; ++i)
+ stopGrid(i);
+
+ return null;
+ }
+ });
+
+ try {
+ while (!fut.isDone())
+ client.compute().affinityCall(CACHE_NAME, key, new CheckCallable(key));
+ }
+ catch (ComputeTaskCancelledException e) {
+ assertTrue(e.getMessage().contains("stopping"));
+ }
+ catch(ClusterGroupEmptyException e) {
+ assertTrue(e.getMessage().contains("Topology projection is empty"));
+ }
+ catch(IgniteException e) {
+ assertTrue(e.getMessage().contains("cache (or node) is stopping"));
+ }
+
+ stopGrid(SERVERS_COUNT);
+ }
+
+ /**
+ * Test callable.
+ */
+ public static class CheckCallable implements IgniteCallable<Object> {
+ /** Key. */
+ private final Object key;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /**
+ * @param key Key.
+ */
+ public CheckCallable(Object key) {
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object call() throws IgniteCheckedException {
+ assert ignite.cluster().localNode().id().equals(ignite.cluster().mapKeyToNode(CACHE_NAME, key).id());
+
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
index 78ecf08..a56ab9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
@@ -19,17 +19,21 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.spi.failover.always.*;
+import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
+import java.util.concurrent.*;
+
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
@@ -47,6 +51,9 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
private static final int KEY_CNT = 50;
/** */
+ private static final int MAX_FAILOVER_ATTEMPTS = 5;
+
+ /** */
private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
/**
@@ -66,6 +73,10 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(spi);
+ AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi();
+ failSpi.setMaximumFailoverAttempts(MAX_FAILOVER_ATTEMPTS);
+ cfg.setFailoverSpi(failSpi);
+
if (!gridName.equals(getTestGridName(GRID_CNT))) {
// Default cache configuration.
CacheConfiguration dfltCacheCfg = defaultCacheConfiguration();
@@ -129,6 +140,48 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testAffinityCallRestartFails() throws Exception {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key",
+ new FailedCallable("key", MAX_FAILOVER_ATTEMPTS + 1));
+ return null;
+ }
+ }, ClusterTopologyException.class, "Failed to failover a job to another node");
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinityCallRestart() throws Exception {
+ assertEquals(MAX_FAILOVER_ATTEMPTS,
+ grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key",
+ new FailedCallable("key", MAX_FAILOVER_ATTEMPTS)));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinityRunRestartFails() throws Exception {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ grid(0).compute().affinityRun(NON_DFLT_CACHE_NAME, "key",
+ new FailedRunnable("key", MAX_FAILOVER_ATTEMPTS + 1));
+ return null;
+ }
+ }, ClusterTopologyException.class, "Failed to failover a job to another node");
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinityRunRestart() throws Exception {
+ grid(0).compute().affinityRun(NON_DFLT_CACHE_NAME, "key", new FailedRunnable("key", MAX_FAILOVER_ATTEMPTS));
+ }
+
+ /**
* JUnit.
*
* @throws Exception If failed.
@@ -224,6 +277,108 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
}
/**
+ * Test runnable.
+ */
+ private static class FailedCallable implements IgniteCallable<Object> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private static final String ATTR_ATTEMPT = "Attempt";
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** */
+ @JobContextResource
+ private ComputeJobContext jobCtx;
+
+ /** Key. */
+ private final Object key;
+
+ /** Call attempts. */
+ private final Integer callAttempt;
+
+ /**
+ * @param key Key.
+ * @param callAttempt Call attempts.
+ */
+ public FailedCallable(Object key, Integer callAttempt) {
+ this.key = key;
+ this.callAttempt = callAttempt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object call() throws IgniteCheckedException {
+ Integer attempt = jobCtx.getAttribute(ATTR_ATTEMPT);
+
+ if (attempt == null)
+ attempt = 1;
+
+ assertEquals(ignite.affinity(NON_DFLT_CACHE_NAME).mapKeyToNode(key), ignite.cluster().localNode());
+
+ jobCtx.setAttribute(ATTR_ATTEMPT, attempt + 1);
+
+ if (attempt < callAttempt)
+ throw new ComputeJobFailoverException("Failover exception.");
+ else
+ return attempt;
+ }
+ }
+
+ /**
+ * Test runnable.
+ */
+ private static class FailedRunnable implements IgniteRunnable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private static final String ATTR_ATTEMPT = "Attempt";
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** */
+ @JobContextResource
+ private ComputeJobContext jobCtx;
+
+ /** Key. */
+ private final Object key;
+
+ /** Call attempts. */
+ private final Integer callAttempt;
+
+ /**
+ * @param key Key.
+ * @param callAttempt Call attempts.
+ */
+ public FailedRunnable(Object key, Integer callAttempt) {
+ this.key = key;
+ this.callAttempt = callAttempt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ Integer attempt = jobCtx.getAttribute(ATTR_ATTEMPT);
+
+ if (attempt == null)
+ attempt = 1;
+
+ assertEquals(ignite.affinity(NON_DFLT_CACHE_NAME).mapKeyToNode(key), ignite.cluster().localNode());
+
+ jobCtx.setAttribute(ATTR_ATTEMPT, attempt + 1);
+
+ if (attempt < callAttempt)
+ throw new ComputeJobFailoverException("Failover exception.");
+ else
+ assertEquals(callAttempt, attempt);
+ }
+ }
+
+ /**
* Test callable.
*/
private static class CheckCallable implements IgniteCallable<Object> {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
index db64475..bfca83d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
@@ -66,4 +66,14 @@ public class GridFailoverTestContext implements FailoverContext {
@Override public ClusterNode getBalancedNode(List<ClusterNode> grid) {
return grid.get(RAND.nextInt(grid.size()));
}
+
+ /** {@inheritDoc} */
+ @Override public Object affinityKey() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String affinityCacheName() {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 39702a3..bafdfef 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -109,6 +109,7 @@ public class IgniteCacheTestSuite extends TestSuite {
// Common tests.
suite.addTestSuite(GridCacheConcurrentMapSelfTest.class);
suite.addTestSuite(GridCacheAffinityMapperSelfTest.class);
+ suite.addTestSuite(CacheAffinityCallSelfTest.class);
GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityRoutingSelfTest.class, ignoredTests);
GridTestUtils.addTestIfNeeded(suite, GridCacheMvccSelfTest.class, ignoredTests);
suite.addTestSuite(GridCacheMvccPartitionedSelfTest.class);
[06/10] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-961
Posted by iv...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-961
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/595fe6ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/595fe6ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/595fe6ed
Branch: refs/heads/ignite-961
Commit: 595fe6edc1139ceb1061155c2dffacc963a30844
Parents: d815e51 f557728
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 20 10:41:12 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 20 10:41:12 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/plugin/security/SecurityPermission.java | 7 +++++--
.../java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 8 +++-----
2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[03/10] incubator-ignite git commit: GG-10556 Fixed stuck on
unmarshal security subject.
Posted by iv...@apache.org.
GG-10556 Fixed stuck on unmarshal security subject.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6711d2c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6711d2c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6711d2c7
Branch: refs/heads/ignite-961
Commit: 6711d2c799b99d7a0ae3855475cccafbf362f5dd
Parents: 7d27103
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jul 15 10:30:12 2015 +0300
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Jul 17 00:05:31 2015 -0700
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6711d2c7/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index d51293e..a5ae5a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -631,8 +631,7 @@ class ServerImpl extends TcpDiscoveryImpl {
Map<String, Object> attrs = new HashMap<>(locNode.attributes());
- attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
- spi.ignite().configuration().getMarshaller().marshal(subj));
+ attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT, spi.marsh.marshal(subj));
attrs.remove(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS);
locNode.setAttributes(attrs);
@@ -2586,8 +2585,7 @@ class ServerImpl extends TcpDiscoveryImpl {
// Stick in authentication subject to node (use security-safe attributes for copy).
Map<String, Object> attrs = new HashMap<>(node.getAttributes());
- attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
- spi.ignite().configuration().getMarshaller().marshal(subj));
+ attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT, spi.marsh.marshal(subj));
node.setAttributes(attrs);
}
@@ -2935,7 +2933,7 @@ class ServerImpl extends TcpDiscoveryImpl {
else {
SecurityContext subj = spi.nodeAuth.authenticateNode(node, cred);
- SecurityContext coordSubj = spi.ignite().configuration().getMarshaller().unmarshal(
+ SecurityContext coordSubj = spi.marsh.unmarshal(
node.<byte[]>attribute(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT),
U.gridClassLoader());
[04/10] incubator-ignite git commit: Merge branch ignite-1.3.2 into
master.
Posted by iv...@apache.org.
Merge branch ignite-1.3.2 into master.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f557728b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f557728b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f557728b
Branch: refs/heads/ignite-961
Commit: f557728b3108ccd3b5f8ecd1190a8591de27bbca
Parents: f0d24f6 6711d2c
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Fri Jul 17 11:00:53 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Fri Jul 17 11:00:53 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/plugin/security/SecurityPermission.java | 7 +++++--
.../java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 8 +++-----
2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f557728b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
[07/10] incubator-ignite git commit: #ignite-961: remove debug.
Posted by iv...@apache.org.
#ignite-961: remove debug.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9fdb28cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9fdb28cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9fdb28cc
Branch: refs/heads/ignite-961
Commit: 9fdb28cced63a1eba1716e5acf4885ebab5f8186
Parents: 595fe6e
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 20 10:43:07 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 20 10:43:07 2015 +0300
----------------------------------------------------------------------
.../processors/rest/JettyRestProcessorAbstractSelfTest.java | 2 --
.../affinity/rendezvous/RendezvousAffinityFunction.java | 4 ----
.../processors/affinity/GridAffinityAssignmentCache.java | 8 --------
3 files changed, 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdb28cc/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 9509500..5baab05 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.rest.handlers.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.testframework.*;
import java.io.*;
@@ -1551,7 +1550,6 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
protected abstract String signature() throws Exception;
-
/**
* Init cache.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdb28cc/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 81472f0..2b26630 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -290,10 +290,6 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
- if (ignite == null)
- System.out.println("IGNITE IS NULL!!!");
-
-
byte[] nodeHashBytes = ignite.configuration().getMarshaller().marshal(nodeHash);
out.write(U.intToBytes(part), 0, 4); // Avoid IOException.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdb28cc/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 281c153..d40128c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;
import org.jsr166.*;
@@ -186,13 +185,6 @@ public class GridAffinityAssignmentCache {
Collections.sort(sorted, GridNodeOrderComparator.INSTANCE);
}
- /*try {
- ctx.grid().context().resource().injectGeneric(aff);
- }
- catch (IgniteCheckedException e) {
- U.convertException(e);
- }*/
-
List<List<ClusterNode>> prevAssignment = prev == null ? null : prev.assignment();
List<List<ClusterNode>> assignment;
[05/10] incubator-ignite git commit: # master fix tests
Posted by iv...@apache.org.
# master fix tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/192fefc2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/192fefc2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/192fefc2
Branch: refs/heads/ignite-961
Commit: 192fefc2382d479a62504517cf3ddc8d5188657c
Parents: f557728
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 20 10:09:24 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 20 10:09:24 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheUtils.java | 4 +-
.../ignite/internal/util/IgniteUtils.java | 4 +-
.../IgniteClientReconnectFailoverTest.java | 47 ++++++++++++--------
.../cache/IgniteCacheNearLockValueSelfTest.java | 2 +
4 files changed, 32 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index bd2623d..e16e30d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1561,9 +1561,7 @@ public class GridCacheUtils {
*/
@NotNull public static RuntimeException convertToCacheException(IgniteCheckedException e) {
IgniteClientDisconnectedCheckedException disconnectedErr =
- e instanceof IgniteClientDisconnectedCheckedException ?
- (IgniteClientDisconnectedCheckedException)e
- : e.getCause(IgniteClientDisconnectedCheckedException.class);
+ e.getCause(IgniteClientDisconnectedCheckedException.class);
if (disconnectedErr != null) {
assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 66eb596..42982b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -691,9 +691,7 @@ public abstract class IgniteUtils {
}
IgniteClientDisconnectedCheckedException disconnectedErr =
- e instanceof IgniteClientDisconnectedCheckedException ?
- (IgniteClientDisconnectedCheckedException)e
- : e.getCause(IgniteClientDisconnectedCheckedException.class);
+ e.getCause(IgniteClientDisconnectedCheckedException.class);
if (disconnectedErr != null) {
assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
index 7cfc329..b7de3eb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.transactions.*;
+import javax.cache.*;
import java.util.*;
import java.util.concurrent.*;
@@ -114,37 +115,45 @@ public class IgniteClientReconnectFailoverTest extends IgniteClientReconnectFail
reconnectFailover(new Callable<Void>() {
@Override public Void call() throws Exception {
- TreeMap<Integer, Integer> map = new TreeMap<>();
+ try {
+ TreeMap<Integer, Integer> map = new TreeMap<>();
- ThreadLocalRandom rnd = ThreadLocalRandom.current();
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
- for (int i = 0; i < 5; i++) {
- Integer key = rnd.nextInt(0, 100_000);
+ for (int i = 0; i < 5; i++) {
+ Integer key = rnd.nextInt(0, 100_000);
- cache.put(key, key);
+ cache.put(key, key);
- assertEquals(key, cache.get(key));
+ assertEquals(key, cache.get(key));
- map.put(key, key);
- }
+ map.put(key, key);
+ }
- for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
- try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
- for (Map.Entry<Integer, Integer> e : map.entrySet()) {
- cache.put(e.getKey(), e.getValue());
+ for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
+ try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+ for (Map.Entry<Integer, Integer> e : map.entrySet()) {
+ cache.put(e.getKey(), e.getValue());
- assertNotNull(cache.get(e.getKey()));
- }
+ assertNotNull(cache.get(e.getKey()));
+ }
- tx.commit();
+ tx.commit();
+ }
}
- }
- cache.putAll(map);
+ cache.putAll(map);
- Map<Integer, Integer> res = cache.getAll(map.keySet());
+ Map<Integer, Integer> res = cache.getAll(map.keySet());
- assertEquals(map, res);
+ assertEquals(map, res);
+ }
+ catch (CacheException e) {
+ if (e.getCause() instanceof IgniteClientDisconnectedException)
+ throw e;
+ else
+ log.info("Ignore error: " + e);
+ }
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index cd04433..c500bbf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -49,6 +49,8 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void afterTestsStopped() throws Exception {
super.afterTestsStopped();
+
+ stopAllGrids();
}
/** {@inheritDoc} */
[10/10] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-961
Posted by iv...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-961
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/72b91c18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/72b91c18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/72b91c18
Branch: refs/heads/ignite-961
Commit: 72b91c180e52ca1cf962bc1344335d1282d9a060
Parents: 9fdb28c f9d2a2e
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 20 11:40:22 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 20 11:40:22 2015 +0300
----------------------------------------------------------------------
.../ignite/compute/ComputeJobResultPolicy.java | 3 +-
.../failover/GridFailoverContextImpl.java | 28 ++-
.../managers/failover/GridFailoverManager.java | 13 +-
.../processors/cache/GridCacheUtils.java | 4 +-
.../processors/closure/AffinityTask.java | 35 ++++
.../closure/GridClosureProcessor.java | 63 ++++++-
.../processors/task/GridTaskWorker.java | 24 ++-
.../ignite/internal/util/IgniteUtils.java | 4 +-
.../ignite/spi/failover/FailoverContext.java | 18 ++
.../spi/failover/always/AlwaysFailoverSpi.java | 25 +++
.../IgniteClientReconnectFailoverTest.java | 47 +++--
.../cache/CacheAffinityCallSelfTest.java | 172 +++++++++++++++++++
.../cache/GridCacheAffinityRoutingSelfTest.java | 157 ++++++++++++++++-
.../cache/IgniteCacheNearLockValueSelfTest.java | 2 +
.../spi/failover/GridFailoverTestContext.java | 10 ++
.../ignite/testsuites/IgniteCacheTestSuite.java | 1 +
.../ignite/schema/ui/SchemaImportApp.java | 36 +++-
17 files changed, 594 insertions(+), 48 deletions(-)
----------------------------------------------------------------------