You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by yz...@apache.org on 2015/06/02 15:24:07 UTC
[11/50] incubator-ignite git commit: # ignite-857 review
# ignite-857 review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9cddb6fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9cddb6fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9cddb6fe
Branch: refs/heads/ignite-916
Commit: 9cddb6fe669ef9f4ac6792a306a665fa2037f773
Parents: 3dea5f1
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu May 28 17:58:49 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu May 28 17:58:49 2015 +0300
----------------------------------------------------------------------
.../managers/discovery/GridDiscoveryManager.java | 3 ++-
.../apache/ignite/spi/discovery/DiscoverySpi.java | 3 ++-
.../ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 18 ++++++++++++------
.../spi/discovery/tcp/TcpDiscoverySpiMBean.java | 2 +-
...itionedClientOnlyNoPrimaryFullApiSelfTest.java | 3 ++-
5 files changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cddb6fe/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index a910950..4ef602e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -285,7 +285,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** {@inheritDoc} */
@Override protected void onKernalStart0() throws IgniteCheckedException {
if (Boolean.TRUE.equals(ctx.config().isClientMode()) && !getSpi().isClientMode())
- ctx.performance().add("Enable client mode for TcpDiscoverySpi (set TcpDiscoverySpi.forceServerMode to true)");
+ ctx.performance().add("Enable client mode for TcpDiscoverySpi " +
+ "(set TcpDiscoverySpi.forceServerMode to false)");
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cddb6fe/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
index e7fbadc..b952087 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpi.java
@@ -78,7 +78,8 @@ public interface DiscoverySpi extends IgniteSpi {
/**
* Sets node attributes and node version which will be distributed in grid during
* join process. Note that these attributes cannot be changed and set only once.
- * @param attrs Map of node attributes.
+ *
+ * @param attrs Map of node attributes.
* @param ver Product version.
*/
public void setNodeAttributes(Map<String, Object> attrs, IgniteProductVersion ver);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cddb6fe/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 52ea78c..64e6001 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -54,10 +54,12 @@ import java.util.concurrent.atomic.*;
* done across it.
* <p>
* If node is configured as client node (see {@link IgniteConfiguration#clientMode})
- * TcpDiscoverySpi starts in client mode too. In this case node does not insert to the ring,
- * it connects to any node in the ring router and communicated with that node only.
- * Thereby slowing or shutdown of client node will not affect whole cluster. If you want to start TcpDiscoverySpi in
- * server mode regardless {@link IgniteConfiguration#clientMode} you can set {@link #forceSrvMode} to true.
+ * TcpDiscoverySpi starts in client mode as well. In this case node does not take its place in the ring,
+ * but it connects to random node in the ring (IP taken from IP finder configured) and
+ * use it as a router for discovery traffic.
+ * Therefore slow client node or its shutdown will not affect whole cluster. If TcpDiscoverySpi
+ * needs to be started in server mode regardless of {@link IgniteConfiguration#clientMode},
+ * {@link #forceSrvMode} should be set to true.
* <p>
* At startup SPI tries to send messages to random IP taken from
* {@link TcpDiscoveryIpFinder} about self start (stops when send succeeds)
@@ -388,11 +390,15 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
}
/**
- * If {@code true} TcpDiscoverySpi will started in server mode regardless
- * of {@link IgniteConfiguration#isClientMode()}
+ * Sets force server mode flag.
+ * <p>
+ * If {@code true} TcpDiscoverySpi is started in server mode regardless
+ * of {@link IgniteConfiguration#isClientMode()}.
*
* @param forceSrvMode forceServerMode flag.
+ * @return {@code this} for chaining.
*/
+ @IgniteSpiConfiguration(optional = true)
public TcpDiscoverySpi setForceServerMode(boolean forceSrvMode) {
this.forceSrvMode = forceSrvMode;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cddb6fe/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
index 6f2ea6f..f338fab 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
@@ -277,7 +277,7 @@ public interface TcpDiscoverySpiMBean extends IgniteSpiManagementMBean {
* Whether or not discovery is started in client mode.
*
* @return {@code true} if node is in client mode.
- * @throws IllegalStateException If discovery SPI has not started.
+ * @throws IllegalStateException If discovery SPI is not started.
*/
@MXBeanDescription("Client mode.")
public boolean isClientMode() throws IllegalStateException;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cddb6fe/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest.java
index 931e347..6b7d1ad 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest.java
@@ -65,7 +65,8 @@ public class GridCachePartitionedClientOnlyNoPrimaryFullApiSelfTest extends Grid
@Override protected IgniteClosure<Throwable, Throwable> errorHandler() {
return new IgniteClosure<Throwable, Throwable>() {
@Override public Throwable apply(Throwable e) {
- if (e instanceof IgniteException || e instanceof IgniteCheckedException || X.hasCause(e, ClusterTopologyCheckedException.class)) {
+ if (e instanceof IgniteException || e instanceof IgniteCheckedException ||
+ X.hasCause(e, ClusterTopologyCheckedException.class)) {
info("Discarding exception: " + e);
return null;