You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2014/12/05 15:07:15 UTC
[14/52] [abbrv] incubator-ignite git commit: # Renaming
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinder.java b/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinder.java
deleted file mode 100644
index 3778c3f..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinder.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.spi.discovery.tcp.ipfinder.sharedfs;
-
-import org.apache.ignite.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.spi.*;
-import org.gridgain.grid.*;
-import org.gridgain.grid.spi.discovery.tcp.ipfinder.*;
-import org.gridgain.grid.util.typedef.*;
-import org.gridgain.grid.util.typedef.internal.*;
-import org.gridgain.grid.util.tostring.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Shared filesystem-based IP finder.
- * <h1 class="header">Configuration</h1>
- * <h2 class="header">Mandatory</h2>
- * There are no mandatory configuration parameters.
- * <h2 class="header">Optional</h2>
- * <ul>
- * <li>Path (see {@link #setPath(String)})</li>
- * <li>Shared flag (see {@link #setShared(boolean)})</li>
- * </ul>
- * <p>
- * If {@link #getPath()} is not provided, then {@link #DFLT_PATH} will be used and
- * only local nodes will discover each other. To enable discovery over network
- * you must provide a path to a shared directory explicitly.
- * <p>
- * The directory will contain empty files named like the following 192.168.1.136#1001.
- * <p>
- * Note that this finder is shared by default (see {@link org.gridgain.grid.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder#isShared()}.
- */
-public class GridTcpDiscoverySharedFsIpFinder extends TcpDiscoveryIpFinderAdapter {
- /**
- * Default path for discovering of local nodes (testing only). Note that this path is relative to
- * {@code GRIDGAIN_HOME/work} folder if {@code GRIDGAIN_HOME} system or environment variable specified,
- * otherwise it is relative to {@code work} folder under system {@code java.io.tmpdir} folder.
- *
- * @see org.apache.ignite.configuration.IgniteConfiguration#getWorkDirectory()
- */
- public static final String DFLT_PATH = "disco/tcp";
-
- /** Delimiter to use between address and port tokens in file names. */
- public static final String DELIM = "#";
-
- /** Grid logger. */
- @IgniteLoggerResource
- private IgniteLogger log;
-
- /** File-system path. */
- private String path = DFLT_PATH;
-
- /** Folder to keep items in. */
- @GridToStringExclude
- private File folder;
-
- /** Warning guard. */
- @GridToStringExclude
- private final AtomicBoolean warnGuard = new AtomicBoolean();
-
- /** Init guard. */
- @GridToStringExclude
- private final AtomicBoolean initGuard = new AtomicBoolean();
-
- /** Init latch. */
- @GridToStringExclude
- private final CountDownLatch initLatch = new CountDownLatch(1);
-
- /**
- * Constructor.
- */
- public GridTcpDiscoverySharedFsIpFinder() {
- setShared(true);
- }
-
- /**
- * Gets path.
- *
- * @return Shared path.
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Sets path.
- *
- * @param path Shared path.
- */
- @IgniteSpiConfiguration(optional = true)
- public void setPath(String path) {
- this.path = path;
- }
-
- /**
- * Initializes folder to work with.
- *
- * @return Folder.
- * @throws org.apache.ignite.spi.IgniteSpiException If failed.
- */
- private File initFolder() throws IgniteSpiException {
- if (initGuard.compareAndSet(false, true)) {
- if (path == null)
- throw new IgniteSpiException("Shared file system path is null " +
- "(it should be configured via setPath(..) configuration property).");
-
- if (path.equals(DFLT_PATH) && warnGuard.compareAndSet(false, true))
- U.warn(log, "Default local computer-only share is used by IP finder.");
-
- try {
- File tmp;
-
- if (new File(path).exists())
- tmp = new File(path);
- else {
- try {
- tmp = U.resolveWorkDirectory(path, false);
- }
- catch (GridException e) {
- throw new IgniteSpiException("Failed to resolve directory [path=" + path +
- ", exception=" + e.getMessage() + ']');
- }
- }
-
- if (!tmp.isDirectory())
- throw new IgniteSpiException("Failed to initialize shared file system path " +
- "(path must point to folder): " + path);
-
- if (!tmp.canRead() || !tmp.canWrite())
- throw new IgniteSpiException("Failed to initialize shared file system path " +
- "(path must be readable and writable): " + path);
-
- folder = tmp;
- }
- finally {
- initLatch.countDown();
- }
- }
- else {
- try {
- U.await(initLatch);
- }
- catch (GridInterruptedException e) {
- throw new IgniteSpiException("Thread has been interrupted.", e);
- }
-
- if (folder == null)
- throw new IgniteSpiException("Failed to initialize shared file system folder (check logs for errors).");
- }
-
- return folder;
- }
-
- /** {@inheritDoc} */
- @Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
- initFolder();
-
- Collection<InetSocketAddress> addrs = new LinkedList<>();
-
- for (String fileName : folder.list())
- if (!".svn".equals(fileName)) {
- InetSocketAddress addr = null;
-
- StringTokenizer st = new StringTokenizer(fileName, DELIM);
-
- if (st.countTokens() == 2) {
- String addrStr = st.nextToken();
- String portStr = st.nextToken();
-
- try {
- int port = Integer.parseInt(portStr);
-
- addr = new InetSocketAddress(addrStr, port);
- }
- catch (IllegalArgumentException e) {
- U.error(log, "Failed to parse file entry: " + fileName, e);
- }
- }
-
- if (addr != null)
- addrs.add(addr);
- }
-
- return Collections.unmodifiableCollection(addrs);
- }
-
- /** {@inheritDoc} */
- @Override public void registerAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException {
- assert !F.isEmpty(addrs);
-
- initFolder();
-
- try {
- for (InetSocketAddress addr : addrs) {
- File file = new File(folder, name(addr));
-
- file.createNewFile();
- }
- }
- catch (IOException e) {
- throw new IgniteSpiException("Failed to create file.", e);
- }
- }
-
- /** {@inheritDoc} */
- @Override public void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException {
- assert !F.isEmpty(addrs);
-
- initFolder();
-
- try {
- for (InetSocketAddress addr : addrs) {
- File file = new File(folder, name(addr));
-
- file.delete();
- }
- }
- catch (SecurityException e) {
- throw new IgniteSpiException("Failed to delete file.", e);
- }
- }
-
- /**
- * Creates file name for address.
- *
- * @param addr Node address.
- * @return Name.
- */
- private String name(InetSocketAddress addr) {
- assert addr != null;
-
- SB sb = new SB();
-
- sb.a(addr.getAddress().getHostAddress())
- .a(DELIM)
- .a(addr.getPort());
-
- return sb.toString();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridTcpDiscoverySharedFsIpFinder.class, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java b/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java
new file mode 100644
index 0000000..7ee5631
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/TcpDiscoverySharedFsIpFinder.java
@@ -0,0 +1,258 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.spi.discovery.tcp.ipfinder.sharedfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.*;
+import org.gridgain.grid.*;
+import org.gridgain.grid.spi.discovery.tcp.ipfinder.*;
+import org.gridgain.grid.util.typedef.*;
+import org.gridgain.grid.util.typedef.internal.*;
+import org.gridgain.grid.util.tostring.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Shared filesystem-based IP finder.
+ * <h1 class="header">Configuration</h1>
+ * <h2 class="header">Mandatory</h2>
+ * There are no mandatory configuration parameters.
+ * <h2 class="header">Optional</h2>
+ * <ul>
+ * <li>Path (see {@link #setPath(String)})</li>
+ * <li>Shared flag (see {@link #setShared(boolean)})</li>
+ * </ul>
+ * <p>
+ * If {@link #getPath()} is not provided, then {@link #DFLT_PATH} will be used and
+ * only local nodes will discover each other. To enable discovery over network
+ * you must provide a path to a shared directory explicitly.
+ * <p>
+ * The directory will contain empty files named like the following 192.168.1.136#1001.
+ * <p>
+ * Note that this finder is shared by default (see {@link org.gridgain.grid.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder#isShared()}.
+ */
+public class TcpDiscoverySharedFsIpFinder extends TcpDiscoveryIpFinderAdapter {
+ /**
+ * Default path for discovering of local nodes (testing only). Note that this path is relative to
+ * {@code GRIDGAIN_HOME/work} folder if {@code GRIDGAIN_HOME} system or environment variable specified,
+ * otherwise it is relative to {@code work} folder under system {@code java.io.tmpdir} folder.
+ *
+ * @see org.apache.ignite.configuration.IgniteConfiguration#getWorkDirectory()
+ */
+ public static final String DFLT_PATH = "disco/tcp";
+
+ /** Delimiter to use between address and port tokens in file names. */
+ public static final String DELIM = "#";
+
+ /** Grid logger. */
+ @IgniteLoggerResource
+ private IgniteLogger log;
+
+ /** File-system path. */
+ private String path = DFLT_PATH;
+
+ /** Folder to keep items in. */
+ @GridToStringExclude
+ private File folder;
+
+ /** Warning guard. */
+ @GridToStringExclude
+ private final AtomicBoolean warnGuard = new AtomicBoolean();
+
+ /** Init guard. */
+ @GridToStringExclude
+ private final AtomicBoolean initGuard = new AtomicBoolean();
+
+ /** Init latch. */
+ @GridToStringExclude
+ private final CountDownLatch initLatch = new CountDownLatch(1);
+
+ /**
+ * Constructor.
+ */
+ public TcpDiscoverySharedFsIpFinder() {
+ setShared(true);
+ }
+
+ /**
+ * Gets path.
+ *
+ * @return Shared path.
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * Sets path.
+ *
+ * @param path Shared path.
+ */
+ @IgniteSpiConfiguration(optional = true)
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ /**
+ * Initializes folder to work with.
+ *
+ * @return Folder.
+ * @throws org.apache.ignite.spi.IgniteSpiException If failed.
+ */
+ private File initFolder() throws IgniteSpiException {
+ if (initGuard.compareAndSet(false, true)) {
+ if (path == null)
+ throw new IgniteSpiException("Shared file system path is null " +
+ "(it should be configured via setPath(..) configuration property).");
+
+ if (path.equals(DFLT_PATH) && warnGuard.compareAndSet(false, true))
+ U.warn(log, "Default local computer-only share is used by IP finder.");
+
+ try {
+ File tmp;
+
+ if (new File(path).exists())
+ tmp = new File(path);
+ else {
+ try {
+ tmp = U.resolveWorkDirectory(path, false);
+ }
+ catch (GridException e) {
+ throw new IgniteSpiException("Failed to resolve directory [path=" + path +
+ ", exception=" + e.getMessage() + ']');
+ }
+ }
+
+ if (!tmp.isDirectory())
+ throw new IgniteSpiException("Failed to initialize shared file system path " +
+ "(path must point to folder): " + path);
+
+ if (!tmp.canRead() || !tmp.canWrite())
+ throw new IgniteSpiException("Failed to initialize shared file system path " +
+ "(path must be readable and writable): " + path);
+
+ folder = tmp;
+ }
+ finally {
+ initLatch.countDown();
+ }
+ }
+ else {
+ try {
+ U.await(initLatch);
+ }
+ catch (GridInterruptedException e) {
+ throw new IgniteSpiException("Thread has been interrupted.", e);
+ }
+
+ if (folder == null)
+ throw new IgniteSpiException("Failed to initialize shared file system folder (check logs for errors).");
+ }
+
+ return folder;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
+ initFolder();
+
+ Collection<InetSocketAddress> addrs = new LinkedList<>();
+
+ for (String fileName : folder.list())
+ if (!".svn".equals(fileName)) {
+ InetSocketAddress addr = null;
+
+ StringTokenizer st = new StringTokenizer(fileName, DELIM);
+
+ if (st.countTokens() == 2) {
+ String addrStr = st.nextToken();
+ String portStr = st.nextToken();
+
+ try {
+ int port = Integer.parseInt(portStr);
+
+ addr = new InetSocketAddress(addrStr, port);
+ }
+ catch (IllegalArgumentException e) {
+ U.error(log, "Failed to parse file entry: " + fileName, e);
+ }
+ }
+
+ if (addr != null)
+ addrs.add(addr);
+ }
+
+ return Collections.unmodifiableCollection(addrs);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void registerAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException {
+ assert !F.isEmpty(addrs);
+
+ initFolder();
+
+ try {
+ for (InetSocketAddress addr : addrs) {
+ File file = new File(folder, name(addr));
+
+ file.createNewFile();
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteSpiException("Failed to create file.", e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException {
+ assert !F.isEmpty(addrs);
+
+ initFolder();
+
+ try {
+ for (InetSocketAddress addr : addrs) {
+ File file = new File(folder, name(addr));
+
+ file.delete();
+ }
+ }
+ catch (SecurityException e) {
+ throw new IgniteSpiException("Failed to delete file.", e);
+ }
+ }
+
+ /**
+ * Creates file name for address.
+ *
+ * @param addr Node address.
+ * @return Name.
+ */
+ private String name(InetSocketAddress addr) {
+ assert addr != null;
+
+ SB sb = new SB();
+
+ sb.a(addr.getAddress().getHostAddress())
+ .a(DELIM)
+ .a(addr.getPort());
+
+ return sb.toString();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(TcpDiscoverySharedFsIpFinder.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml
index 6cc5a3b..7e1f68b 100644
--- a/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml
+++ b/modules/core/src/test/config/loaders/grid-cfg-2-grids.xml
@@ -26,7 +26,7 @@
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.GridTcpDiscoveryMulticastIpFinder">
+ <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="multicastGroup" value="228.111.111.111"/>
<property name="multicastPort" value="54535"/>
</bean>
@@ -43,7 +43,7 @@
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.GridTcpDiscoveryMulticastIpFinder">
+ <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="multicastGroup" value="228.111.111.111"/>
<property name="multicastPort" value="54535"/>
</bean>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/config/loaders/grid-cfg.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/loaders/grid-cfg.xml b/modules/core/src/test/config/loaders/grid-cfg.xml
index d121d3a..c414c48 100644
--- a/modules/core/src/test/config/loaders/grid-cfg.xml
+++ b/modules/core/src/test/config/loaders/grid-cfg.xml
@@ -26,7 +26,7 @@
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.GridTcpDiscoveryMulticastIpFinder">
+ <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="multicastGroup" value="228.111.111.222"/>
<property name="multicastPort" value="54522"/>
</bean>
@@ -43,7 +43,7 @@
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.GridTcpDiscoveryMulticastIpFinder">
+ <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="multicastGroup" value="228.111.111.222"/>
<property name="multicastPort" value="54522"/>
</bean>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/GridTcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/GridTcpDiscoverySelfTest.java b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/GridTcpDiscoverySelfTest.java
index eefb52b..bd51479 100644
--- a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/GridTcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/GridTcpDiscoverySelfTest.java
@@ -115,7 +115,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest {
spi.setIpFinder(finder);
}
else if (gridName.contains("MulticastIpFinder")) {
- GridTcpDiscoveryMulticastIpFinder finder = new GridTcpDiscoveryMulticastIpFinder();
+ TcpDiscoveryMulticastIpFinder finder = new TcpDiscoveryMulticastIpFinder();
finder.setAddressRequestAttempts(10);
finder.setMulticastGroup(GridTestUtils.getNextMulticastGroup(getClass()));
@@ -703,7 +703,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest {
TcpDiscoverySpi spi = (TcpDiscoverySpi)g.configuration().getDiscoverySpi();
- GridTcpDiscoveryMulticastIpFinder ipFinder = (GridTcpDiscoveryMulticastIpFinder)spi.getIpFinder();
+ TcpDiscoveryMulticastIpFinder ipFinder = (TcpDiscoveryMulticastIpFinder)spi.getIpFinder();
boolean found = false;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/jdbc/GridTcpDiscoveryJdbcIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/jdbc/GridTcpDiscoveryJdbcIpFinderSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/jdbc/GridTcpDiscoveryJdbcIpFinderSelfTest.java
index 02c85ed..9422458 100644
--- a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/jdbc/GridTcpDiscoveryJdbcIpFinderSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/jdbc/GridTcpDiscoveryJdbcIpFinderSelfTest.java
@@ -17,7 +17,7 @@ import org.gridgain.grid.spi.discovery.tcp.ipfinder.*;
* JDBC IP finder self test.
*/
public class GridTcpDiscoveryJdbcIpFinderSelfTest extends
- GridTcpDiscoveryIpFinderAbstractSelfTest<GridTcpDiscoveryJdbcIpFinder> {
+ GridTcpDiscoveryIpFinderAbstractSelfTest<TcpDiscoveryJdbcIpFinder> {
/** */
private ComboPooledDataSource dataSrc;
@@ -34,8 +34,8 @@ public class GridTcpDiscoveryJdbcIpFinderSelfTest extends
}
/** {@inheritDoc} */
- @Override protected GridTcpDiscoveryJdbcIpFinder ipFinder() throws Exception {
- GridTcpDiscoveryJdbcIpFinder finder = new GridTcpDiscoveryJdbcIpFinder();
+ @Override protected TcpDiscoveryJdbcIpFinder ipFinder() throws Exception {
+ TcpDiscoveryJdbcIpFinder finder = new TcpDiscoveryJdbcIpFinder();
assert finder.isShared() : "IP finder should be shared by default.";
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/multicast/GridTcpDiscoveryMulticastIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/multicast/GridTcpDiscoveryMulticastIpFinderSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/multicast/GridTcpDiscoveryMulticastIpFinderSelfTest.java
index 7978be2..e24fd57 100644
--- a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/multicast/GridTcpDiscoveryMulticastIpFinderSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/multicast/GridTcpDiscoveryMulticastIpFinderSelfTest.java
@@ -19,7 +19,7 @@ import java.util.*;
* GridTcpDiscoveryMulticastIpFinder test.
*/
public class GridTcpDiscoveryMulticastIpFinderSelfTest
- extends GridTcpDiscoveryIpFinderAbstractSelfTest<GridTcpDiscoveryMulticastIpFinder> {
+ extends GridTcpDiscoveryIpFinderAbstractSelfTest<TcpDiscoveryMulticastIpFinder> {
/**
* @throws Exception In case of error.
*/
@@ -28,8 +28,8 @@ public class GridTcpDiscoveryMulticastIpFinderSelfTest
}
/** {@inheritDoc} */
- @Override protected GridTcpDiscoveryMulticastIpFinder ipFinder() throws Exception {
- GridTcpDiscoveryMulticastIpFinder ipFinder = new GridTcpDiscoveryMulticastIpFinder();
+ @Override protected TcpDiscoveryMulticastIpFinder ipFinder() throws Exception {
+ TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setMulticastGroup(GridTestUtils.getNextMulticastGroup(getClass()));
ipFinder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
@@ -44,19 +44,19 @@ public class GridTcpDiscoveryMulticastIpFinderSelfTest
public void testExchange() throws Exception {
String locAddr = null;
- GridTcpDiscoveryMulticastIpFinder ipFinder1 = null;
- GridTcpDiscoveryMulticastIpFinder ipFinder2 = null;
- GridTcpDiscoveryMulticastIpFinder ipFinder3 = null;
+ TcpDiscoveryMulticastIpFinder ipFinder1 = null;
+ TcpDiscoveryMulticastIpFinder ipFinder2 = null;
+ TcpDiscoveryMulticastIpFinder ipFinder3 = null;
try {
ipFinder1 = ipFinder();
- ipFinder2 = new GridTcpDiscoveryMulticastIpFinder();
+ ipFinder2 = new TcpDiscoveryMulticastIpFinder();
ipFinder2.setMulticastGroup(ipFinder1.getMulticastGroup());
ipFinder2.setMulticastPort(ipFinder1.getMulticastPort());
- ipFinder3 = new GridTcpDiscoveryMulticastIpFinder();
+ ipFinder3 = new TcpDiscoveryMulticastIpFinder();
ipFinder3.setMulticastGroup(ipFinder1.getMulticastGroup());
ipFinder3.setMulticastPort(ipFinder1.getMulticastPort());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinderSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinderSelfTest.java
index 71bcd48..31cb8e2 100644
--- a/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinderSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/spi/discovery/tcp/ipfinder/sharedfs/GridTcpDiscoverySharedFsIpFinderSelfTest.java
@@ -18,7 +18,7 @@ import java.util.*;
* GridTcpDiscoverySharedFsIpFinder test.
*/
public class GridTcpDiscoverySharedFsIpFinderSelfTest
- extends GridTcpDiscoveryIpFinderAbstractSelfTest<GridTcpDiscoverySharedFsIpFinder> {
+ extends GridTcpDiscoveryIpFinderAbstractSelfTest<TcpDiscoverySharedFsIpFinder> {
/**
* Constructor.
*
@@ -29,8 +29,8 @@ public class GridTcpDiscoverySharedFsIpFinderSelfTest
}
/** {@inheritDoc} */
- @Override protected GridTcpDiscoverySharedFsIpFinder ipFinder() {
- GridTcpDiscoverySharedFsIpFinder finder = new GridTcpDiscoverySharedFsIpFinder();
+ @Override protected TcpDiscoverySharedFsIpFinder ipFinder() {
+ TcpDiscoverySharedFsIpFinder finder = new TcpDiscoverySharedFsIpFinder();
assert finder.isShared() : "Ip finder should be shared by default.";
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
index c14ae35..15271ad 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
@@ -1066,7 +1066,7 @@ public abstract class GridAbstractTest extends TestCase {
String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
if (!F.isEmpty(mcastAddr)) {
- GridTcpDiscoveryMulticastIpFinder ipFinder = new GridTcpDiscoveryMulticastIpFinder();
+ TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setMulticastGroup(mcastAddr);
ipFinder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f31df32/modules/core/src/test/java/org/gridgain/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/spi/GridSpiAbstractTest.java b/modules/core/src/test/java/org/gridgain/testframework/junits/spi/GridSpiAbstractTest.java
index f2596ee..4b9b4ac 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/spi/GridSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/spi/GridSpiAbstractTest.java
@@ -394,12 +394,12 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends GridAbstr
if (spi instanceof TcpDiscoverySpi) {
TcpDiscoveryIpFinder ipFinder = ((TcpDiscoverySpi)spi).getIpFinder();
- if (ipFinder instanceof GridTcpDiscoveryMulticastIpFinder) {
+ if (ipFinder instanceof TcpDiscoveryMulticastIpFinder) {
String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
if (mcastAddr != null && !mcastAddr.isEmpty()) {
- ((GridTcpDiscoveryMulticastIpFinder)ipFinder).setMulticastGroup(mcastAddr);
- ((GridTcpDiscoveryMulticastIpFinder)ipFinder).setMulticastPort(
+ ((TcpDiscoveryMulticastIpFinder)ipFinder).setMulticastGroup(mcastAddr);
+ ((TcpDiscoveryMulticastIpFinder)ipFinder).setMulticastPort(
GridTestUtils.getNextMulticastPort(getClass()));
}
}