You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/05/05 11:09:14 UTC
[1/8] incubator-ignite git commit: src-release zip fix
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-sprint-5 da3d9e73d -> 57ab09ee1
src-release zip fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/09a33fe3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/09a33fe3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/09a33fe3
Branch: refs/heads/ignite-sprint-5
Commit: 09a33fe39b734f43767fd8ed9bbe2f1275f18324
Parents: 44b00ea
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Apr 30 23:32:41 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Apr 30 23:32:41 2015 +0300
----------------------------------------------------------------------
pom.xml | 39 ++++++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09a33fe3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 98541ef..c859021 100644
--- a/pom.xml
+++ b/pom.xml
@@ -467,6 +467,35 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.apache.resources</groupId>
+ <artifactId>apache-source-release-assembly-descriptor</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>source-release-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+ <descriptorRefs>
+ <descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
+ </descriptorRefs>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <finalName>incubator-ignite-${project.version}-src</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
@@ -533,7 +562,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>${project.artifactId}-${project.version}-source-release.zip</include>
+ <include>incubator-ignite-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -561,10 +590,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[7/8] incubator-ignite git commit: IGNITE-856 - gg.client ->
ignite.client
Posted by vo...@apache.org.
IGNITE-856 - gg.client -> ignite.client
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/54f94922
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/54f94922
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/54f94922
Branch: refs/heads/ignite-sprint-5
Commit: 54f949220433d45b543de83896ed3e357a68e04f
Parents: c4bc929
Author: Ignite Teamcity <ig...@apache.org>
Authored: Mon May 4 17:27:14 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon May 4 17:27:14 2015 -0700
----------------------------------------------------------------------
.../config/grid-client-config.properties | 50 ++++++------
.../ClientPropertiesConfigurationSelfTest.java | 12 +--
.../org/apache/ignite/IgniteJdbcDriver.java | 81 ++++++++++----------
.../client/GridClientConfiguration.java | 2 +-
4 files changed, 71 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54f94922/modules/clients/config/grid-client-config.properties
----------------------------------------------------------------------
diff --git a/modules/clients/config/grid-client-config.properties b/modules/clients/config/grid-client-config.properties
index b6bce8d..d25352b 100644
--- a/modules/clients/config/grid-client-config.properties
+++ b/modules/clients/config/grid-client-config.properties
@@ -16,89 +16,89 @@
#
# Required. Comma-separated list of servers to connect to in format "host:port".
-gg.client.servers=localhost:11211
+ignite.client.servers=localhost:11211
# Optional. Default client load balancer. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.balancer=
+#ignite.client.balancer=
# Optional. Socket connect timeout (ms). Default value is "0".
-#gg.client.connectTimeout=10000
+#ignite.client.connectTimeout=10000
# Optional. Credentials if grid requires authentication. Default value is "".
-#gg.client.credentials=
+#ignite.client.credentials=
# Optional. Flag indicating whether topology cache is enabled. Default value is "false".
-#gg.client.cacheTop=false
+#ignite.client.cacheTop=false
# Optional. Max time of connection idleness (ms). Default value is "30000".
-#gg.client.idleTimeout=30000
+#ignite.client.idleTimeout=30000
# Optional. Client protocol, one of TCP or HTTP. Default value is "TCP".
-#gg.client.protocol=TCP
+#ignite.client.protocol=TCP
# Optional. TCP_NODELAY communication flag. Default value is "true".
-#gg.client.tcp.noDelay=true
+#ignite.client.tcp.noDelay=true
# Optional. Topology refresh frequency (ms). Default value is "2000".
-#gg.client.topology.refresh=2000
+#ignite.client.topology.refresh=2000
#
# Data configurations.
#
# Optional. List of comma-separated names of data configurations. Default value is "".
-#gg.client.data.configurations=cfg1, cfg2
+#ignite.client.data.configurations=cfg1, cfg2
# Optional. Cache name (space) to work with (for configuration 'cfg1').
-#gg.client.data.cfg1.name=
+#ignite.client.data.cfg1.name=
# Optional. Specific load balancer for configuration 'cfg1'. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.data.cfg1.balancer=random
+#ignite.client.data.cfg1.balancer=random
# Optional. Specific affinity for configuration 'cfg1'. Default value is "".
# Affinity may be "" (no affinity), "partitioned" or full class name for "your.affinity.ImplementationClass"
-#gg.client.data.cfg1.affinity=
+#ignite.client.data.cfg1.affinity=
# Optional. Cache name (space) to work with (for configuration 'cfg2').
-#gg.client.data.cfg2.name=partitioned
+#ignite.client.data.cfg2.name=partitioned
# Optional. Specific load balancer for configuration 'cfg2'. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.data.cfg2.balancer=roundrobin
+#ignite.client.data.cfg2.balancer=roundrobin
# Optional. Specific affinity for configuration 'cfg2'. Default value is "".
# Affinity may be "" (no affinity), "partitioned" or full class name for "your.affinity.ImplementationClass"
-#gg.client.data.cfg2.affinity=partitioned
+#ignite.client.data.cfg2.affinity=partitioned
#
# SSL configuration.
#
# Optional. SSL enabled. Default value is "false".
-#gg.client.ssl.enabled=false
+#ignite.client.ssl.enabled=false
# Optional. SSL protocol. Default value is "TLS".
-#gg.client.ssl.protocol=TLS
+#ignite.client.ssl.protocol=TLS
# Optional. Key manager algorithm. Default value is "SunX509".
-#gg.client.ssl.key.algorithm=SunX509
+#ignite.client.ssl.key.algorithm=SunX509
# Optional. Keystore to be used by client to connect with Ignite topology over SSL. Default value is "".
-#gg.client.ssl.keystore.location=
+#ignite.client.ssl.keystore.location=
# Optional. Default value is "".
-#gg.client.ssl.keystore.password=
+#ignite.client.ssl.keystore.password=
# Optional. Default value is "jks".
-#gg.client.ssl.keystore.type=jks
+#ignite.client.ssl.keystore.type=jks
# Optional. Truststore to be used by client to connect with Ignite topology over SSL. Default value is "".
-#gg.client.ssl.truststore.location=
+#ignite.client.ssl.truststore.location=
# Optional. Default value is "".
-#gg.client.ssl.truststore.password=
+#ignite.client.ssl.truststore.password=
# Optional. Default value is "jks".
-#gg.client.ssl.truststore.type=jks
+#ignite.client.ssl.truststore.type=jks
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54f94922/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
index 6e2a1eb..8e981d1 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
@@ -85,8 +85,8 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
for (Map.Entry<Object, Object> e : props.entrySet())
props2.put("new." + e.getKey(), e.getValue());
- validateConfig(0, new GridClientConfiguration("new.gg.client", props2));
- validateConfig(0, new GridClientConfiguration("new.gg.client.", props2));
+ validateConfig(0, new GridClientConfiguration("new.ignite.client", props2));
+ validateConfig(0, new GridClientConfiguration("new.ignite.client.", props2));
// Validate loaded test configuration.
File tmp = uncommentProperties(GRID_CLIENT_CONFIG);
@@ -100,14 +100,14 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
for (Map.Entry<Object, Object> e : props.entrySet())
props2.put("new." + e.getKey(), e.getValue());
- validateConfig(2, new GridClientConfiguration("new.gg.client", props2));
- validateConfig(2, new GridClientConfiguration("new.gg.client.", props2));
+ validateConfig(2, new GridClientConfiguration("new.ignite.client", props2));
+ validateConfig(2, new GridClientConfiguration("new.ignite.client.", props2));
// Validate loaded test configuration with empty key prefixes.
props2 = new Properties();
for (Map.Entry<Object, Object> e : props.entrySet())
- props2.put(e.getKey().toString().replace("gg.client.", ""), e.getValue());
+ props2.put(e.getKey().toString().replace("ignite.client.", ""), e.getValue());
validateConfig(2, new GridClientConfiguration("", props2));
validateConfig(2, new GridClientConfiguration(".", props2));
@@ -156,7 +156,7 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
Collection<String> lines = new ArrayList<>();
while (it.hasNext())
- lines.add(it.nextLine().replace("#gg.client.", "gg.client."));
+ lines.add(it.nextLine().replace("#ignite.client.", "ignite.client."));
IgniteUtils.closeQuiet(in);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54f94922/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
index a7c2eae..17ec221 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
@@ -90,101 +90,101 @@ import java.util.logging.*;
* <th>Optional</th>
* </tr>
* <tr>
- * <td><b>gg.client.protocol</b></td>
+ * <td><b>ignite.client.protocol</b></td>
* <td>Communication protocol ({@code TCP} or {@code HTTP}).</td>
* <td>{@code TCP}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.connectTimeout</b></td>
+ * <td><b>ignite.client.connectTimeout</b></td>
* <td>Socket connection timeout.</td>
* <td>{@code 0} (infinite timeout)</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.tcp.noDelay</b></td>
+ * <td><b>ignite.client.tcp.noDelay</b></td>
* <td>Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.</td>
* <td>{@code true}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.enabled</b></td>
+ * <td><b>ignite.client.ssl.enabled</b></td>
* <td>Flag indicating that {@code SSL} is needed for connection.</td>
* <td>{@code false}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.protocol</b></td>
+ * <td><b>ignite.client.ssl.protocol</b></td>
* <td>SSL protocol ({@code SSL} or {@code TLS}).</td>
* <td>{@code TLS}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.key.algorithm</b></td>
+ * <td><b>ignite.client.ssl.key.algorithm</b></td>
* <td>Key manager algorithm.</td>
* <td>{@code SunX509}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.location</b></td>
+ * <td><b>ignite.client.ssl.keystore.location</b></td>
* <td>Key store to be used by client to connect with Ignite topology.</td>
* <td> </td>
* <td>No (if {@code SSL} is enabled)</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.password</b></td>
+ * <td><b>ignite.client.ssl.keystore.password</b></td>
* <td>Key store password.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.type</b></td>
+ * <td><b>ignite.client.ssl.keystore.type</b></td>
* <td>Key store type.</td>
* <td>{@code jks}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.location</b></td>
+ * <td><b>ignite.client.ssl.truststore.location</b></td>
* <td>Trust store to be used by client to connect with Ignite topology.</td>
* <td> </td>
* <td>No (if {@code SSL} is enabled)</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.password</b></td>
+ * <td><b>ignite.client.ssl.truststore.password</b></td>
* <td>Trust store password.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.type</b></td>
+ * <td><b>ignite.client.ssl.truststore.type</b></td>
* <td>Trust store type.</td>
* <td>{@code jks}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.credentials</b></td>
+ * <td><b>ignite.client.credentials</b></td>
* <td>Client credentials used in authentication process.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.cache.top</b></td>
+ * <td><b>ignite.client.cache.top</b></td>
* <td>
* Flag indicating that topology is cached internally. Cache will be refreshed in
- * the background with interval defined by {@code gg.client.topology.refresh}
+ * the background with interval defined by {@code ignite.client.topology.refresh}
* property (see below).
* </td>
* <td>{@code false}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.topology.refresh</b></td>
+ * <td><b>ignite.client.topology.refresh</b></td>
* <td>Topology cache refresh frequency (ms).</td>
* <td>{@code 2000}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.idleTimeout</b></td>
+ * <td><b>ignite.client.idleTimeout</b></td>
* <td>Maximum amount of time that connection can be idle before it is closed (ms).</td>
* <td>{@code 30000}</td>
* <td>Yes</td>
@@ -225,7 +225,7 @@ import java.util.logging.*;
@SuppressWarnings("JavadocReference")
public class IgniteJdbcDriver implements Driver {
/** Prefix for property names. */
- private static final String PROP_PREFIX = "gg.jdbc.";
+ private static final String PROP_PREFIX = "ignite.jdbc.";
/** Hostname property name. */
public static final String PROP_HOST = PROP_PREFIX + "host";
@@ -236,11 +236,8 @@ public class IgniteJdbcDriver implements Driver {
/** Cache name property name. */
public static final String PROP_CACHE = PROP_PREFIX + "cache";
- /** Node ID URL parameter name. */
- public static final String PARAM_NODE_ID = "nodeId";
-
/** Node ID property name. */
- public static final String PROP_NODE_ID = PROP_PREFIX + PARAM_NODE_ID;
+ public static final String PROP_NODE_ID = PROP_PREFIX + "nodeId";
/** URL prefix. */
public static final String URL_PREFIX = "jdbc:ignite://";
@@ -290,40 +287,40 @@ public class IgniteJdbcDriver implements Driver {
props[1] = new PropertyInfo("Port number", info.getProperty(PROP_PORT), "");
props[2] = new PropertyInfo("Cache name", info.getProperty(PROP_CACHE), "");
props[3] = new PropertyInfo("Node ID", info.getProperty(PROP_NODE_ID, ""));
- props[4] = new PropertyInfo("gg.client.protocol", info.getProperty("gg.client.protocol", "TCP"),
+ props[4] = new PropertyInfo("ignite.client.protocol", info.getProperty("ignite.client.protocol", "TCP"),
"Communication protocol (TCP or HTTP).");
- props[5] = new PropertyInfo("gg.client.connectTimeout", info.getProperty("gg.client.connectTimeout", "0"),
+ props[5] = new PropertyInfo("ignite.client.connectTimeout", info.getProperty("ignite.client.connectTimeout", "0"),
"Socket connection timeout.");
- props[6] = new PropertyInfo("gg.client.tcp.noDelay", info.getProperty("gg.client.tcp.noDelay", "true"),
+ props[6] = new PropertyInfo("ignite.client.tcp.noDelay", info.getProperty("ignite.client.tcp.noDelay", "true"),
"Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.");
- props[7] = new PropertyInfo("gg.client.ssl.enabled", info.getProperty("gg.client.ssl.enabled", "false"),
+ props[7] = new PropertyInfo("ignite.client.ssl.enabled", info.getProperty("ignite.client.ssl.enabled", "false"),
"Flag indicating that SSL is needed for connection.");
- props[8] = new PropertyInfo("gg.client.ssl.protocol", info.getProperty("gg.client.ssl.protocol", "TLS"),
+ props[8] = new PropertyInfo("ignite.client.ssl.protocol", info.getProperty("ignite.client.ssl.protocol", "TLS"),
"SSL protocol.");
- props[9] = new PropertyInfo("gg.client.ssl.key.algorithm", info.getProperty("gg.client.ssl.key.algorithm",
+ props[9] = new PropertyInfo("ignite.client.ssl.key.algorithm", info.getProperty("ignite.client.ssl.key.algorithm",
"SunX509"), "Key manager algorithm.");
- props[10] = new PropertyInfo("gg.client.ssl.keystore.location",
- info.getProperty("gg.client.ssl.keystore.location", ""),
+ props[10] = new PropertyInfo("ignite.client.ssl.keystore.location",
+ info.getProperty("ignite.client.ssl.keystore.location", ""),
"Key store to be used by client to connect with Ignite topology.");
- props[11] = new PropertyInfo("gg.client.ssl.keystore.password",
- info.getProperty("gg.client.ssl.keystore.password", ""), "Key store password.");
- props[12] = new PropertyInfo("gg.client.ssl.keystore.type", info.getProperty("gg.client.ssl.keystore.type",
+ props[11] = new PropertyInfo("ignite.client.ssl.keystore.password",
+ info.getProperty("ignite.client.ssl.keystore.password", ""), "Key store password.");
+ props[12] = new PropertyInfo("ignite.client.ssl.keystore.type", info.getProperty("ignite.client.ssl.keystore.type",
"jks"), "Key store type.");
- props[13] = new PropertyInfo("gg.client.ssl.truststore.location",
- info.getProperty("gg.client.ssl.truststore.location", ""),
+ props[13] = new PropertyInfo("ignite.client.ssl.truststore.location",
+ info.getProperty("ignite.client.ssl.truststore.location", ""),
"Trust store to be used by client to connect with Ignite topology.");
- props[14] = new PropertyInfo("gg.client.ssl.keystore.password",
- info.getProperty("gg.client.ssl.truststore.password", ""), "Trust store password.");
- props[15] = new PropertyInfo("gg.client.ssl.truststore.type", info.getProperty("gg.client.ssl.truststore.type",
+ props[14] = new PropertyInfo("ignite.client.ssl.keystore.password",
+ info.getProperty("ignite.client.ssl.truststore.password", ""), "Trust store password.");
+ props[15] = new PropertyInfo("ignite.client.ssl.truststore.type", info.getProperty("ignite.client.ssl.truststore.type",
"jks"), "Trust store type.");
- props[16] = new PropertyInfo("gg.client.credentials", info.getProperty("gg.client.credentials", ""),
+ props[16] = new PropertyInfo("ignite.client.credentials", info.getProperty("ignite.client.credentials", ""),
"Client credentials used in authentication process.");
- props[17] = new PropertyInfo("gg.client.cache.top", info.getProperty("gg.client.cache.top", "false"),
+ props[17] = new PropertyInfo("ignite.client.cache.top", info.getProperty("ignite.client.cache.top", "false"),
"Flag indicating that topology is cached internally. Cache will be refreshed in the background with " +
"interval defined by topologyRefreshFrequency property (see below).");
- props[18] = new PropertyInfo("gg.client.topology.refresh", info.getProperty("gg.client.topology.refresh",
+ props[18] = new PropertyInfo("ignite.client.topology.refresh", info.getProperty("ignite.client.topology.refresh",
"2000"), "Topology cache refresh frequency (ms).");
- props[19] = new PropertyInfo("gg.client.idleTimeout", info.getProperty("gg.client.idleTimeout", "30000"),
+ props[19] = new PropertyInfo("ignite.client.idleTimeout", info.getProperty("ignite.client.idleTimeout", "30000"),
"Maximum amount of time that connection can be idle before it is closed (ms).");
return props;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54f94922/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index 3d01afa..ee16f94 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -160,7 +160,7 @@ public class GridClientConfiguration {
* @throws GridClientException If parsing configuration failed.
*/
public GridClientConfiguration(Properties in) throws GridClientException {
- this("gg.client", in);
+ this("ignite.client", in);
}
/**
[3/8] incubator-ignite git commit: # sprint-4 - Added javadoc for the
close method.
Posted by vo...@apache.org.
# sprint-4 - Added javadoc for the close method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/601cf099
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/601cf099
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/601cf099
Branch: refs/heads/ignite-sprint-5
Commit: 601cf09930a16b1bf477d8407f5deed10c1f50c3
Parents: f298d72
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 30 18:32:56 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Thu Apr 30 18:32:56 2015 -0700
----------------------------------------------------------------------
modules/core/src/main/java/org/apache/ignite/IgniteCache.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/601cf099/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index bf4080a..f9007a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -499,7 +499,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
CacheEntryProcessor<K, V, T> entryProcessor, Object... args);
/**
- * Completely deletes the cache with all its data from the system.
+ * Completely deletes the cache with all its data from the system on all cluster nodes.
*/
@Override void close();
[8/8] incubator-ignite git commit: Merge branch 'ignite-sprint-4'
into ignite-sprint-5
Posted by vo...@apache.org.
Merge branch 'ignite-sprint-4' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/57ab09ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/57ab09ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/57ab09ee
Branch: refs/heads/ignite-sprint-5
Commit: 57ab09ee168d70cbd65266944d263681c51a4f3c
Parents: da3d9e7 54f9492
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 5 12:09:09 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 5 12:09:09 2015 +0300
----------------------------------------------------------------------
.../streaming/wordcount/CacheConfig.java | 5 -
.../config/grid-client-config.properties | 50 +-
.../ClientPropertiesConfigurationSelfTest.java | 12 +-
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../org/apache/ignite/IgniteJdbcDriver.java | 81 ++-
.../ignite/compute/ComputeTaskAdapter.java | 14 +-
.../client/GridClientConfiguration.java | 2 +-
.../processors/cache/GridCacheAdapter.java | 503 +++++++++----------
.../processors/cache/GridCacheProcessor.java | 109 ++--
.../apache/ignite/lang/IgniteAsyncSupport.java | 4 +-
pom.xml | 39 +-
11 files changed, 389 insertions(+), 435 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ab09ee/pom.xml
----------------------------------------------------------------------
[4/8] incubator-ignite git commit: # sprint-4 - Added javadoc for the
withAsync method.
Posted by vo...@apache.org.
# sprint-4 - Added javadoc for the withAsync method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2cb73176
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2cb73176
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2cb73176
Branch: refs/heads/ignite-sprint-5
Commit: 2cb73176d3a671cb2ac784310a4d36b2d03bad29
Parents: 601cf09
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 30 18:45:38 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Thu Apr 30 18:45:38 2015 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cb73176/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
index 76ebcee..f5b5153 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
@@ -22,7 +22,7 @@ package org.apache.ignite.lang;
*/
public interface IgniteAsyncSupport {
/**
- * Gets component with asynchronous mode enabled.
+ * Gets instance of this component with asynchronous mode enabled.
*
* @return Component with asynchronous mode enabled.
*/
[2/8] incubator-ignite git commit: # sprint-4 - Added javadoc for the
close method.
Posted by vo...@apache.org.
# sprint-4 - Added javadoc for the close method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f298d721
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f298d721
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f298d721
Branch: refs/heads/ignite-sprint-5
Commit: f298d7216a81b0416c1cf123efd99fcff2d41e19
Parents: 09a33fe
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 30 18:28:44 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Thu Apr 30 18:28:44 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/examples/streaming/wordcount/CacheConfig.java | 5 -----
modules/core/src/main/java/org/apache/ignite/IgniteCache.java | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f298d721/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
index bb2a18e..58704ca 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
@@ -18,7 +18,6 @@
package org.apache.ignite.examples.streaming.wordcount;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.configuration.*;
import javax.cache.configuration.*;
@@ -44,10 +43,6 @@ public class CacheConfig {
// Sliding window of 1 seconds.
cfg.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new CreatedExpiryPolicy(new Duration(SECONDS, 1))));
- // Do not allow more than 1 million entries.
- // Allows to run this example with smaller available memory.
- cfg.setEvictionPolicy(new FifoEvictionPolicy<>(1_000_000));
-
return cfg;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f298d721/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index d99902a..bf4080a 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -499,6 +499,11 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
CacheEntryProcessor<K, V, T> entryProcessor, Object... args);
/**
+ * Completely deletes the cache with all its data from the system.
+ */
+ @Override void close();
+
+ /**
* This cache node to re-balance its partitions. This method is usually used when
* {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero value.
* When many nodes are started or stopped almost concurrently, it is more efficient to delay
[5/8] incubator-ignite git commit: # sprint-4 - Added javadoc for the
withAsync method.
Posted by vo...@apache.org.
# sprint-4 - Added javadoc for the withAsync method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/281f4ef2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/281f4ef2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/281f4ef2
Branch: refs/heads/ignite-sprint-5
Commit: 281f4ef208e7928c8514992458f34ab96781f671
Parents: 2cb7317
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Thu Apr 30 18:50:18 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Thu Apr 30 18:50:18 2015 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/281f4ef2/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
index f5b5153..be05a38 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteAsyncSupport.java
@@ -24,7 +24,7 @@ public interface IgniteAsyncSupport {
/**
* Gets instance of this component with asynchronous mode enabled.
*
- * @return Component with asynchronous mode enabled.
+ * @return Instance of this component with asynchronous mode enabled.
*/
public IgniteAsyncSupport withAsync();
[6/8] incubator-ignite git commit: Revert "#ignite-732:
IgniteCache.size() should not fail in case of topology changes."
Posted by vo...@apache.org.
Revert "#ignite-732: IgniteCache.size() should not fail in case of topology changes."
This reverts commit 139aa270ae61494c0757867f2dc531ec7251b1da.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c4bc9297
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c4bc9297
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c4bc9297
Branch: refs/heads/ignite-sprint-5
Commit: c4bc92974bace5e4cdb3ac9dc80790193e46d203
Parents: 281f4ef
Author: ivasilinets <iv...@gridgain.com>
Authored: Sat May 2 10:05:35 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Sat May 2 10:05:35 2015 +0300
----------------------------------------------------------------------
.../ignite/compute/ComputeTaskAdapter.java | 14 +-
.../processors/cache/GridCacheAdapter.java | 503 +++++++++----------
.../processors/cache/GridCacheProcessor.java | 109 ++--
3 files changed, 277 insertions(+), 349 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c4bc9297/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskAdapter.java b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskAdapter.java
index 87081fc..c2ad198 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskAdapter.java
@@ -24,16 +24,15 @@ import java.util.*;
/**
* Convenience adapter for {@link ComputeTask} interface. Here is an example of
- * how {@code ComputeTaskAdapter} can be used:
+ * how {@code GridComputeTaskAdapter} can be used:
* <pre name="code" class="java">
- * public class MyFooBarTask extends ComputeTaskAdapter<String, String> {
+ * public class MyFooBarTask extends GridComputeTaskAdapter<String, String> {
* // Inject load balancer.
* @LoadBalancerResource
* ComputeLoadBalancer balancer;
*
* // Map jobs to grid nodes.
- * public Map<? extends ComputeJob, GridNode> map(List<GridNode> subgrid, String arg)
- * throws IgniteCheckedException {
+ * public Map<? extends ComputeJob, GridNode> map(List<GridNode> subgrid, String arg) throws IgniteCheckedException {
* Map<MyFooBarJob, GridNode> jobs = new HashMap<MyFooBarJob, GridNode>(subgrid.size());
*
* // In more complex cases, you can actually do
@@ -77,8 +76,8 @@ public abstract class ComputeTaskAdapter<T, R> implements ComputeTask<T, R> {
* <p>
* If remote job resulted in exception ({@link ComputeJobResult#getException()} is not {@code null}),
* then {@link ComputeJobResultPolicy#FAILOVER} policy will be returned if the exception is instance
- * of {@link org.apache.ignite.cluster.ClusterTopologyException} or {@link ComputeExecutionRejectedException},
- * which means that remote node either failed or job execution was rejected before it got a chance to start. In all
+ * of {@link org.apache.ignite.cluster.ClusterTopologyException} or {@link ComputeExecutionRejectedException}, which means that
+ * remote node either failed or job execution was rejected before it got a chance to start. In all
* other cases the exception will be rethrown which will ultimately cause task to fail.
*
* @param res Received remote grid executable result.
@@ -88,8 +87,7 @@ public abstract class ComputeTaskAdapter<T, R> implements ComputeTask<T, R> {
* @throws IgniteException If handling a job result caused an error effectively rejecting
* a failover. This exception will be thrown out of {@link ComputeTaskFuture#get()} method.
*/
- @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd)
- throws IgniteException {
+ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) throws IgniteException {
IgniteException e = res.getException();
// Try to failover if result is failed.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c4bc9297/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 39f19b1..3f4e97b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -75,9 +75,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** */
private static final long serialVersionUID = 0L;
- /** Failed result. */
- private static final Object FAIL = new Integer(-1);
-
/** clearLocally() split threshold. */
public static final int CLEAR_ALL_SPLIT_THRESHOLD = 10000;
@@ -885,7 +882,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public Set<Cache.Entry<K, V>> entrySet() {
- return entrySet((CacheEntryPredicate[])null);
+ return entrySet((CacheEntryPredicate[]) null);
}
/** {@inheritDoc} */
@@ -900,17 +897,17 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public Set<K> keySet() {
- return keySet((CacheEntryPredicate[])null);
+ return keySet((CacheEntryPredicate[]) null);
}
/** {@inheritDoc} */
@Override public Set<K> primaryKeySet() {
- return primaryKeySet((CacheEntryPredicate[])null);
+ return primaryKeySet((CacheEntryPredicate[]) null);
}
/** {@inheritDoc} */
@Override public Collection<V> values() {
- return values((CacheEntryPredicate[])null);
+ return values((CacheEntryPredicate[]) null);
}
/**
@@ -1083,31 +1080,36 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public void clear() throws IgniteCheckedException {
- clearAll(0, new GlobalClearAllCallable(name(), ctx.affinity().affinityTopologyVersion()));
+ // Clear local cache synchronously.
+ clearLocally();
+
+ clearRemotes(0, new GlobalClearAllCallable(name()));
}
/** {@inheritDoc} */
@Override public void clear(K key) throws IgniteCheckedException {
- clearAll(0, new GlobalClearKeySetCallable<K, V>(name(), ctx.affinity().affinityTopologyVersion(),
- Collections.singleton(key)));
+ // Clear local cache synchronously.
+ clearLocally(key);
+
+ clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), Collections.singleton(key)));
}
/** {@inheritDoc} */
@Override public void clearAll(Set<? extends K> keys) throws IgniteCheckedException {
- clearAll(0, new GlobalClearKeySetCallable<K, V>(name(), ctx.affinity().affinityTopologyVersion(),
- keys));
+ // Clear local cache synchronously.
+ clearLocallyAll(keys);
+
+ clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), keys));
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync(K key) {
- return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), ctx.affinity().affinityTopologyVersion(),
- Collections.singleton(key)));
+ return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), Collections.singleton(key)));
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync(Set<? extends K> keys) {
- return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), ctx.affinity().affinityTopologyVersion(),
- keys));
+ return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), keys));
}
/**
@@ -1116,13 +1118,19 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param clearCall Global clear callable object.
* @throws IgniteCheckedException In case of cache could not be cleared on any of the nodes.
*/
- private void clearAll(long timeout, TopologyVersionAwareCallable clearCall) throws IgniteCheckedException {
+ private void clearRemotes(long timeout, GlobalClearCallable clearCall) throws IgniteCheckedException {
try {
+ // Send job to remote nodes only.
+ Collection<ClusterNode> nodes =
+ ctx.grid().cluster().forCacheNodes(name(), true, true, false).forRemotes().nodes();
+
IgniteInternalFuture<Object> fut = null;
- ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, timeout);
+ if (!nodes.isEmpty()) {
+ ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, timeout);
- fut = new ClearFuture(ctx, clearCall);
+ fut = ctx.closures().callAsyncNoFailover(BROADCAST, clearCall, nodes, true);
+ }
if (fut != null)
fut.get();
@@ -1141,18 +1149,19 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync() {
- return clearAsync(new GlobalClearAllCallable(name(), ctx.affinity().affinityTopologyVersion()));
+ return clearAsync(new GlobalClearAllCallable(name()));
}
/**
* @param clearCall Global clear callable object.
* @return Future.
*/
- private IgniteInternalFuture<?> clearAsync(TopologyVersionAwareCallable clearCall) {
+ private IgniteInternalFuture<?> clearAsync(GlobalClearCallable clearCall) {
Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name(), true, true, false).nodes();
if (!nodes.isEmpty()) {
- IgniteInternalFuture<Object> fut = new ClearFuture(ctx, clearCall);
+ IgniteInternalFuture<Object> fut =
+ ctx.closures().callAsyncNoFailover(BROADCAST, clearCall, nodes, true);
return fut.chain(new CX1<IgniteInternalFuture<Object>, Object>() {
@Override public Object applyx(IgniteInternalFuture<Object> fut) throws IgniteCheckedException {
@@ -2108,7 +2117,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
throws IgniteCheckedException {
Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys,
new C1<K, EntryProcessor<K, V, Object>>() {
- @Override public EntryProcessor apply(K k) {
+ @Override public EntryProcessor apply(K k) {
return entryProcessor;
}
});
@@ -2136,7 +2145,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp() {
@Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) {
Map<? extends K, EntryProcessor<K, V, Object>> invokeMap =
- Collections.singletonMap(key, (EntryProcessor<K, V, Object>)entryProcessor);
+ Collections.singletonMap(key, (EntryProcessor<K, V, Object>) entryProcessor);
return tx.invokeAsync(ctx, invokeMap, args);
}
@@ -2362,7 +2371,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
IgniteInternalFuture<V> fut = asyncOp(new AsyncOp<V>() {
@Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) {
return tx.putAllAsync(ctx, F.t(key, val), true, null, -1, ctx.noValArray())
- .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>)RET2VAL);
+ .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>) RET2VAL);
}
@Override public String toString() {
@@ -2517,7 +2526,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
return asyncOp(new AsyncOp<Boolean>() {
@Override public IgniteInternalFuture<Boolean> op(IgniteTxLocalAdapter tx) {
return tx.putAllAsync(ctx, F.t(key, val), false, null, -1, ctx.hasValArray()).chain(
- (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>)RET2FLAG);
+ (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>) RET2FLAG);
}
@Override public String toString() {
@@ -2906,7 +2915,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (ctx.deploymentEnabled())
ctx.deploy().registerClass(oldVal);
- return tx.putAllAsync(ctx,
+ return (GridCacheReturn) tx.putAllAsync(ctx,
F.t(key, newVal),
true,
null,
@@ -3008,7 +3017,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
ctx.deploy().registerClass(val);
return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
- ctx.equalsValArray(val)).get().success();
+ ctx.equalsValArray(val)).get().success();
}
@Override public String toString() {
@@ -3221,10 +3230,10 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
TransactionConfiguration cfg = ctx.gridConfig().getTransactionConfiguration();
return txStart(
- concurrency,
- isolation,
- cfg.getDefaultTxTimeout(),
- 0
+ concurrency,
+ isolation,
+ cfg.getDefaultTxTimeout(),
+ 0
);
}
@@ -3567,7 +3576,22 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (nodes.isEmpty())
return new GridFinishedFuture<>(0);
- return new SizeFuture(peekModes, ctx, modes.near);
+ IgniteInternalFuture<Collection<Integer>> fut =
+ ctx.closures().broadcastNoFailover(new SizeCallable(ctx.name(), peekModes), null, nodes);
+
+ return fut.chain(new CX1<IgniteInternalFuture<Collection<Integer>>, Integer>() {
+ @Override public Integer applyx(IgniteInternalFuture<Collection<Integer>> fut)
+ throws IgniteCheckedException {
+ Collection<Integer> res = fut.get();
+
+ int totalSize = 0;
+
+ for (Integer size : res)
+ totalSize += size;
+
+ return totalSize;
+ }
+ });
}
/** {@inheritDoc} */
@@ -3651,7 +3675,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
return F.iterator(iterator(),
new IgniteClosure<Cache.Entry<K, V>, Cache.Entry<K, V>>() {
private IgniteCacheExpiryPolicy expiryPlc =
- ctx.cache().expiryPolicy(opCtx != null ? opCtx.expiry() : null);
+ ctx.cache().expiryPolicy(opCtx != null ? opCtx.expiry() : null);
@Override public Cache.Entry<K, V> apply(Cache.Entry<K, V> lazyEntry) {
CacheOperationContext prev = ctx.gate().enter(opCtx);
@@ -3885,6 +3909,50 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
+ * Gets cache global size (with or without backups).
+ *
+ * @param primaryOnly {@code True} if only primary sizes should be included.
+ * @return Global size.
+ * @throws IgniteCheckedException If internal task execution failed.
+ */
+ private int globalSize(boolean primaryOnly) throws IgniteCheckedException {
+ try {
+ // Send job to remote nodes only.
+ Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name()).forRemotes().nodes();
+
+ IgniteInternalFuture<Collection<Integer>> fut = null;
+
+ if (!nodes.isEmpty()) {
+ ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, gridCfg.getNetworkTimeout());
+
+ fut = ctx.closures().broadcastNoFailover(new GlobalSizeCallable(name(), primaryOnly), null, nodes);
+ }
+
+ // Get local value.
+ int globalSize = primaryOnly ? primarySize() : size();
+
+ if (fut != null) {
+ for (Integer i : fut.get())
+ globalSize += i;
+ }
+
+ return globalSize;
+ }
+ catch (ClusterGroupEmptyCheckedException ignore) {
+ if (log.isDebugEnabled())
+ log.debug("All remote nodes left while cache clearLocally [cacheName=" + name() + "]");
+
+ return primaryOnly ? primarySize() : size();
+ }
+ catch (ComputeTaskTimeoutCheckedException e) {
+ U.warn(log, "Timed out waiting for remote nodes to finish cache clear (consider increasing " +
+ "'networkTimeout' configuration property) [cacheName=" + name() + "]");
+
+ throw e;
+ }
+ }
+
+ /**
* @param op Cache operation.
* @param <T> Return type.
* @return Operation result.
@@ -4825,10 +4893,47 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
+ * Internal callable which performs clear operation on a cache with the given name.
+ */
+ @GridInternal
+ private static abstract class GlobalClearCallable implements Callable<Object>, Externalizable {
+ /** Cache name. */
+ protected String cacheName;
+
+ /** Injected grid instance. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /**
+ * Empty constructor for serialization.
+ */
+ public GlobalClearCallable() {
+ // No-op.
+ }
+
+ /**
+ * @param cacheName Cache name.
+ */
+ protected GlobalClearCallable(String cacheName) {
+ this.cacheName = cacheName;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ U.writeString(out, cacheName);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ cacheName = U.readString(in);
+ }
+ }
+
+ /**
* Global clear all.
*/
@GridInternal
- private static class GlobalClearAllCallable extends TopologyVersionAwareCallable {
+ private static class GlobalClearAllCallable extends GlobalClearCallable {
/** */
private static final long serialVersionUID = 0L;
@@ -4841,30 +4946,24 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/**
* @param cacheName Cache name.
- * @param topVer Affinity topology version.
*/
- private GlobalClearAllCallable(String cacheName, AffinityTopologyVersion topVer) {
- super(cacheName, topVer);
+ private GlobalClearAllCallable(String cacheName) {
+ super(cacheName);
}
/** {@inheritDoc} */
- @Override protected Object callLocal() {
+ @Override public Object call() throws Exception {
((IgniteEx)ignite).cachex(cacheName).clearLocally();
return null;
}
-
- /** {@inheritDoc} */
- @Override protected Collection<ClusterNode> nodes(GridCacheContext ctx) {
- return ctx.grid().cluster().forCacheNodes(ctx.name(), true, true, false).nodes();
- }
}
/**
* Global clear keys.
*/
@GridInternal
- private static class GlobalClearKeySetCallable<K, V> extends TopologyVersionAwareCallable {
+ private static class GlobalClearKeySetCallable<K, V> extends GlobalClearCallable {
/** */
private static final long serialVersionUID = 0L;
@@ -4880,25 +4979,33 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/**
* @param cacheName Cache name.
- * @param topVer Affinity topology version.
* @param keys Keys to clear.
*/
- protected GlobalClearKeySetCallable(String cacheName, AffinityTopologyVersion topVer, Set<? extends K> keys) {
- super(cacheName, topVer);
+ private GlobalClearKeySetCallable(String cacheName, Set<? extends K> keys) {
+ super(cacheName);
this.keys = keys;
}
/** {@inheritDoc} */
- @Override protected Collection<ClusterNode> nodes(GridCacheContext ctx) {
- return ctx.grid().cluster().forCacheNodes(ctx.name(), true, true, false).nodes();
+ @Override public Object call() throws Exception {
+ ((IgniteEx)ignite).<K, V>cachex(cacheName).clearLocallyAll(keys);
+
+ return null;
}
/** {@inheritDoc} */
- @Override protected Object callLocal() {
- ((IgniteEx)ignite).<K, V>cachex(cacheName).clearLocallyAll(keys);
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ super.writeExternal(out);
- return null;
+ out.writeObject(keys);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ super.readExternal(in);
+
+ keys = (Set<K>) in.readObject();
}
}
@@ -4906,202 +5013,127 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* Internal callable for global size calculation.
*/
@GridInternal
- private static class GlobalSizeCallable extends TopologyVersionAwareCallable {
+ private static class SizeCallable extends IgniteClosureX<Object, Integer> implements Externalizable {
/** */
private static final long serialVersionUID = 0L;
+ /** Cache name. */
+ private String cacheName;
+
/** Peek modes. */
private CachePeekMode[] peekModes;
- /** Near enable. */
- private boolean nearEnable;
+ /** Injected grid instance. */
+ @IgniteInstanceResource
+ private Ignite ignite;
/**
* Required by {@link Externalizable}.
*/
- public GlobalSizeCallable() {
+ public SizeCallable() {
// No-op.
}
/**
* @param cacheName Cache name.
- * @param topVer Affinity topology version.
* @param peekModes Cache peek modes.
*/
- private GlobalSizeCallable(String cacheName, AffinityTopologyVersion topVer, CachePeekMode[] peekModes, boolean nearEnable) {
- super(cacheName, topVer);
-
+ private SizeCallable(String cacheName, CachePeekMode[] peekModes) {
+ this.cacheName = cacheName;
this.peekModes = peekModes;
- this.nearEnable = nearEnable;
- }
-
- /** {@inheritDoc} */
- @Override protected Object callLocal() {
- try {
- IgniteInternalCache<Object, Object> cache = ((IgniteEx)ignite).cachex(cacheName);
-
- return cache == null ? 0 : cache.localSize(peekModes);
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
}
/** {@inheritDoc} */
- @Override protected Collection<ClusterNode> nodes(GridCacheContext ctx) {
- IgniteClusterEx cluster = ctx.grid().cluster();
+ @Override public Integer applyx(Object o) throws IgniteCheckedException {
+ IgniteInternalCache<Object, Object> cache = ((IgniteEx)ignite).cachex(cacheName);
- ClusterGroup grp = nearEnable ? cluster.forCacheNodes(ctx.name(), true, true, false) : cluster.forDataNodes(ctx.name());
+ assert cache != null : cacheName;
- return grp.nodes();
+ return cache.localSize(peekModes);
}
/** {@inheritDoc} */
- public String toString() {
- return S.toString(GlobalSizeCallable.class, this);
- }
- }
-
- /**
- * Cache size future.
- */
- private static class SizeFuture extends RetryFuture {
- /** Size. */
- private int size = 0;
-
- /**
- * @param peekModes Peek modes.
- */
- public SizeFuture(CachePeekMode[] peekModes, GridCacheContext ctx, boolean near) {
- super(ctx, new GlobalSizeCallable(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes, near));
- }
+ @SuppressWarnings("ForLoopReplaceableByForEach")
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ U.writeString(out, cacheName);
- /** {@inheritDoc} */
- @Override protected void onInit() {
- size = 0;
- }
+ out.writeInt(peekModes.length);
- /** {@inheritDoc} */
- @Override protected void onLocal(Object localRes) {
- size += (Integer)localRes;
+ for (int i = 0; i < peekModes.length; i++)
+ U.writeEnum(out, peekModes[i]);
}
/** {@inheritDoc} */
- @Override protected void allDone() {
- onDone(size);
- }
- }
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ cacheName = U.readString(in);
- /**
- * Cache clear future.
- */
- private static class ClearFuture extends RetryFuture {
- /**
- */
- public ClearFuture(GridCacheContext ctx, TopologyVersionAwareCallable clearCall) {
- super(ctx, clearCall);
- }
+ int len = in.readInt();
- /** {@inheritDoc} */
- @Override protected void onInit() {
- // No-op.
- }
+ peekModes = new CachePeekMode[len];
- /** {@inheritDoc} */
- @Override protected void onLocal(Object localRes) {
- // No-op.
+ for (int i = 0; i < len; i++)
+ peekModes[i] = CachePeekMode.fromOrdinal(in.readByte());
}
/** {@inheritDoc} */
- @Override protected void allDone() {
- onDone();
+ public String toString() {
+ return S.toString(SizeCallable.class, this);
}
}
/**
- * Retry future.
+ * Internal callable which performs {@link IgniteInternalCache#size()} or {@link IgniteInternalCache#primarySize()}
+ * operation on a cache with the given name.
*/
- protected static abstract class RetryFuture<T> extends GridFutureAdapter<T> {
- /** Context. */
- private final GridCacheContext ctx;
+ @GridInternal
+ private static class GlobalSizeCallable implements IgniteClosure<Object, Integer>, Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
- /** Callable. */
- private final TopologyVersionAwareCallable call;
+ /** Cache name. */
+ private String cacheName;
- /** Max retries count before issuing an error. */
- private volatile int retries = 32;
+ /** Primary only flag. */
+ private boolean primaryOnly;
+
+ /** Injected grid instance. */
+ @IgniteInstanceResource
+ private Ignite ignite;
/**
+ * Empty constructor for serialization.
*/
- public RetryFuture(GridCacheContext ctx, TopologyVersionAwareCallable call) {
- this.ctx = ctx;
- this.call = call;
-
- init();
+ public GlobalSizeCallable() {
+ // No-op.
}
/**
- * Init.
+ * @param cacheName Cache name.
+ * @param primaryOnly Primary only flag.
*/
- private void init() {
- Collection<ClusterNode> nodes = call.nodes(ctx);
-
- call.topologyVersion(ctx.affinity().affinityTopologyVersion());
-
- IgniteInternalFuture<Collection<Object>> fut = ctx.closures().callAsyncNoFailover(BROADCAST,
- F.asSet((Callable<Object>)call), nodes, true);
-
- fut.listen(new IgniteInClosure<IgniteInternalFuture<Collection<Object>>>() {
- @Override public void apply(IgniteInternalFuture<Collection<Object>> fut) {
- try {
- Collection<Object> res = fut.get();
-
- onInit();
-
- for (Object locRes : res) {
- if (locRes == FAIL) {
- if (retries-- > 0)
- init();
- else {
- onDone(new ClusterTopologyException("Failed to wait topology."));
-
- return;
- }
- }
+ private GlobalSizeCallable(String cacheName, boolean primaryOnly) {
+ this.cacheName = cacheName;
+ this.primaryOnly = primaryOnly;
+ }
- onLocal(locRes);
- }
+ /** {@inheritDoc} */
+ @Override public Integer apply(Object o) {
+ IgniteInternalCache<Object, Object> cache = ((IgniteEx)ignite).cachex(cacheName);
- allDone();
- }
- catch (IgniteCheckedException e) {
- if (X.hasCause(e, ClusterTopologyException.class)) {
- if (retries-- > 0)
- init();
- else
- onDone(e);
- }
- else
- onDone(e);
- }
- }
- });
+ return primaryOnly ? cache.primarySize() : cache.size();
}
- /**
- * Init reducer.
- */
- protected abstract void onInit();
-
- /**
- * @param localRes Add local result to global result.
- */
- protected abstract void onLocal(Object localRes);
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ U.writeString(out, cacheName);
+ out.writeBoolean(primaryOnly);
+ }
- /**
- * On done.
- */
- protected abstract void allDone();
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ cacheName = U.readString(in);
+ primaryOnly = in.readBoolean();
+ }
}
/**
@@ -5665,89 +5697,4 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
metrics.addPutAndGetTimeNanos(System.nanoTime() - start);
}
}
-
- /**
- * Delayed callable class.
- */
- protected static abstract class TopologyVersionAwareCallable<K, V> implements Serializable, Callable<Object> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Injected grid instance. */
- @IgniteInstanceResource
- protected Ignite ignite;
-
- /** Affinity topology version. */
- protected AffinityTopologyVersion topVer;
-
- /** Cache name. */
- protected String cacheName;
-
- /**
- * Empty constructor for serialization.
- */
- public TopologyVersionAwareCallable() {
- // No-op.
- }
-
- /**
- * @param topVer Affinity topology version.
- */
- public TopologyVersionAwareCallable(String cacheName, AffinityTopologyVersion topVer) {
- this.cacheName = cacheName;
- this.topVer = topVer;
- }
-
- /** {@inheritDoc} */
- @Override public Object call() throws Exception {
- if (!compareTopologyVersions())
- return FAIL;
-
- Object res = callLocal();
-
- if (!compareTopologyVersions())
- return FAIL;
- else
- return res;
- }
-
- /**
- * Call local.
- *
- * @return Local result.
- * @throws IgniteCheckedException If failed.
- */
- protected abstract Object callLocal() throws IgniteCheckedException;
-
- /**
- * @param ctx Grid cache context.
- * @return Nodes to call.
- */
- protected abstract Collection<ClusterNode> nodes(GridCacheContext ctx);
-
- /**
- * Compare topology versions.
- */
- public boolean compareTopologyVersions() {
- GridCacheProcessor cacheProc = ((IgniteKernal) ignite).context().cache();
-
- GridCacheAdapter<K, V> cacheAdapter = cacheProc.internalCache(cacheName);
-
- if (cacheAdapter == null)
- return false;
-
- final GridCacheContext<K, V> ctx = cacheAdapter.context();
-
- AffinityTopologyVersion locTopVer = ctx.affinity().affinityTopologyVersion();
-
- return locTopVer.compareTo(topVer) == 0;
- }
-
- /**
- * @param topVer Affinity topology version.
- */
- public void topologyVersion(AffinityTopologyVersion topVer) {
- this.topVer = topVer;
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c4bc9297/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 77fa104..c0026ab 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
@@ -124,9 +124,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** Must use JDK marshaller since it is used by discovery to fire custom events. */
private Marshaller marshaller = new JdkMarshaller();
- /** Count down latch for caches. */
- private CountDownLatch cacheStartedLatch = new CountDownLatch(1);
-
/**
* @param ctx Kernal context.
*/
@@ -660,92 +657,87 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void onKernalStart() throws IgniteCheckedException {
- try {
- if (ctx.config().isDaemon())
- return;
+ if (ctx.config().isDaemon())
+ return;
- ClusterNode locNode = ctx.discovery().localNode();
+ ClusterNode locNode = ctx.discovery().localNode();
- // Init cache plugin managers.
- final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
+ // Init cache plugin managers.
+ final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- CacheConfiguration locCcfg = desc.cacheConfiguration();
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ CacheConfiguration locCcfg = desc.cacheConfiguration();
- CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
+ CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
- cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
- }
+ cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
+ }
- if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
- for (ClusterNode n : ctx.discovery().remoteNodes()) {
- checkTransactionConfiguration(n);
+ if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
+ for (ClusterNode n : ctx.discovery().remoteNodes()) {
+ checkTransactionConfiguration(n);
- DeploymentMode locDepMode = ctx.config().getDeploymentMode();
- DeploymentMode rmtDepMode = n.attribute(IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE);
+ DeploymentMode locDepMode = ctx.config().getDeploymentMode();
+ DeploymentMode rmtDepMode = n.attribute(IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE);
- CU.checkAttributeMismatch(log, null, n.id(), "deploymentMode", "Deployment mode",
- locDepMode, rmtDepMode, true);
+ CU.checkAttributeMismatch(log, null, n.id(), "deploymentMode", "Deployment mode",
+ locDepMode, rmtDepMode, true);
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
- if (rmtCfg != null) {
- CacheConfiguration locCfg = desc.cacheConfiguration();
+ if (rmtCfg != null) {
+ CacheConfiguration locCfg = desc.cacheConfiguration();
- checkCache(locCfg, rmtCfg, n);
+ checkCache(locCfg, rmtCfg, n);
- // Check plugin cache configurations.
- CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
+ // Check plugin cache configurations.
+ CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ assert pluginMgr != null : " Map=" + cache2PluginMgr;
- pluginMgr.validateRemotes(rmtCfg, n);
- }
+ pluginMgr.validateRemotes(rmtCfg, n);
}
}
}
+ }
- // Start dynamic caches received from collect discovery data.
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- boolean started = desc.onStart();
+ // Start dynamic caches received from collect discovery data.
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ boolean started = desc.onStart();
- assert started : "Failed to change started flag for locally configured cache: " + desc;
+ assert started : "Failed to change started flag for locally configured cache: " + desc;
- desc.clearRemoteConfigurations();
+ desc.clearRemoteConfigurations();
- CacheConfiguration ccfg = desc.cacheConfiguration();
+ CacheConfiguration ccfg = desc.cacheConfiguration();
- IgnitePredicate filter = ccfg.getNodeFilter();
+ IgnitePredicate filter = ccfg.getNodeFilter();
- if (filter.apply(locNode)) {
- CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
+ if (filter.apply(locNode)) {
+ CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
- CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
+ CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ assert pluginMgr != null : " Map=" + cache2PluginMgr;
- GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
+ GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
- ctx.dynamicDeploymentId(desc.deploymentId());
+ ctx.dynamicDeploymentId(desc.deploymentId());
- sharedCtx.addCacheContext(ctx);
+ sharedCtx.addCacheContext(ctx);
- GridCacheAdapter cache = ctx.cache();
+ GridCacheAdapter cache = ctx.cache();
- String name = ccfg.getName();
+ String name = ccfg.getName();
- caches.put(maskNull(name), cache);
+ caches.put(maskNull(name), cache);
- startCache(cache);
+ startCache(cache);
- jCacheProxies.put(maskNull(name), new IgniteCacheProxy(ctx, cache, null, false));
- }
+ jCacheProxies.put(maskNull(name), new IgniteCacheProxy(ctx, cache, null, false));
}
}
- finally {
- cacheStartedLatch.countDown();
- }
ctx.marshallerContext().onMarshallerCacheStarted(ctx);
@@ -843,8 +835,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void onKernalStop(boolean cancel) {
- cacheStartedLatch.countDown();
-
if (ctx.config().isDaemon())
return;
@@ -2696,13 +2686,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (log.isDebugEnabled())
log.debug("Getting internal cache adapter: " + name);
- try {
- cacheStartedLatch.await();
- }
- catch (InterruptedException e) {
- throw new IgniteException("Failed to wait starting caches.");
- }
-
return (GridCacheAdapter<K, V>)caches.get(maskNull(name));
}