ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject incubator-ignite git commit: # IGNITE-709 Add documentation for TcpClientDiscoverySpi, remove 'disconnectCheckInterval' property
Date Mon, 25 May 2015 15:55:03 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-709_2 3dd778209 -> b746fd25c


# IGNITE-709 Add documentation for TcpClientDiscoverySpi, remove 'disconnectCheckInterval'
property


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b746fd25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b746fd25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b746fd25

Branch: refs/heads/ignite-709_2
Commit: b746fd25c6590e27080d3ba4bc62c3148ed8f364
Parents: 3dd7782
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Mon May 25 18:54:23 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Mon May 25 18:54:23 2015 +0300

----------------------------------------------------------------------
 .../discovery/tcp/TcpClientDiscoverySpi.java    | 86 +++++++++++++++-----
 .../tcp/TcpClientDiscoverySpiMBean.java         |  8 --
 2 files changed, 65 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b746fd25/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 84e3493..de954d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -53,15 +53,77 @@ import static org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeat
  * nodes and will maintain connection only with this node (will not enter the ring).
  * If this connection is broken, it will try to reconnect using addresses from
  * the same IP finder.
+ *
+ * <h1 class="header">Configuration</h1>
+ * <h2 class="header">Mandatory</h2>
+ * There are no mandatory configuration parameters.
+ * <h2 class="header">Optional</h2>
+ * The following configuration parameters are optional:
+ * <ul>
+ * <li>IP finder to share info about nodes IP addresses
+ * (see {@link #setIpFinder(TcpDiscoveryIpFinder)}).
+ * See the following IP finder implementations for details on configuration:
+ * <ul>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder}</li>
+ * <li>{@ignitelink org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder}</li>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder}</li>
+ * <li>{@link org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder}</li>
+ * <li>{@link TcpDiscoveryMulticastIpFinder} - default</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * <ul>
+ * <li>Local address (see {@link #setLocalAddress(String)})</li>
+ * <li>Heartbeat frequency (see {@link #setHeartbeatFrequency(long)})</li>
+ * <li>Network timeout (see {@link #setNetworkTimeout(long)})</li>
+ * <li>Socket timeout (see {@link #setSocketTimeout(long)})</li>
+ * <li>Message acknowledgement timeout (see {@link #setAckTimeout(long)})</li>
+ * <li>Join timeout (see {@link #setJoinTimeout(long)})</li>
+ * <li>Thread priority for threads started by SPI (see {@link #setThreadPriority(int)})</li>
+ * </ul>
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * TcpClientDiscoverySpi spi = new TcpClientDiscoverySpi();
+ *
+ * TcpDiscoveryVmIpFinder finder =
+ *     new GridTcpDiscoveryVmIpFinder();
+ *
+ * spi.setIpFinder(finder);
+ *
+ * IgniteConfiguration cfg = new IgniteConfiguration();
+ *
+ * // Override default discovery SPI.
+ * cfg.setDiscoverySpi(spi);
+ *
+ * // Start grid.
+ * Ignition.start(cfg);
+ * </pre>
+ * <h2 class="header">Spring Example</h2>
+ * TcpClientDiscoverySpi can be configured from Spring XML configuration file:
+ * <pre name="code" class="xml">
+ * &lt;bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"
singleton="true"&gt;
+ *         ...
+ *         &lt;property name="discoverySpi"&gt;
+ *             &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpClientDiscoverySpi"&gt;
+ *                 &lt;property name="ipFinder"&gt;
+ *                     &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"
/&gt;
+ *                 &lt;/property&gt;
+ *             &lt;/bean&gt;
+ *         &lt;/property&gt;
+ *         ...
+ * &lt;/bean&gt;
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * @see DiscoverySpi
  */
 @SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
 @IgniteSpiMultipleInstancesSupport(true)
 @DiscoverySpiOrderSupport(true)
 @DiscoverySpiHistorySupport(true)
 public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpClientDiscoverySpiMBean
{
-    /** Default disconnect check interval. */
-    public static final long DFLT_DISCONNECT_CHECK_INT = 2000;
-
     /** Default socket operations timeout in milliseconds (value is <tt>700ms</tt>).
*/
     public static final long DFLT_SOCK_TIMEOUT = 700;
 
@@ -110,9 +172,6 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
     /** Left latch. */
     private final CountDownLatch leaveLatch = new CountDownLatch(1);
 
-    /** Disconnect check interval. */
-    private long disconnectCheckInt = DFLT_DISCONNECT_CHECK_INT;
-
     /** */
     private final Timer timer = new Timer("TcpClientDiscoverySpi.timer");
 
@@ -128,21 +187,6 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
     }
 
     /** {@inheritDoc} */
-    @Override public long getDisconnectCheckInterval() {
-        return disconnectCheckInt;
-    }
-
-    /**
-     * Sets disconnect check interval.
-     *
-     * @param disconnectCheckInt Disconnect check interval.
-     */
-    @IgniteSpiConfiguration(optional = true)
-    public void setDisconnectCheckInterval(long disconnectCheckInt) {
-        this.disconnectCheckInt = disconnectCheckInt;
-    }
-
-    /** {@inheritDoc} */
     @Override public long getSocketTimeout() {
         return sockTimeout;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b746fd25/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
index 9fe4adc..3101da8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMBean.java
@@ -27,14 +27,6 @@ import java.util.*;
  */
 public interface TcpClientDiscoverySpiMBean extends IgniteSpiManagementMBean {
     /**
-     * Gets disconnect check interval.
-     *
-     * @return Disconnect check interval.
-     */
-    @MXBeanDescription("Disconnect check interval.")
-    public long getDisconnectCheckInterval();
-
-    /**
      * Gets socket timeout.
      *
      * @return Socket timeout.


Mime
View raw message