geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [1/2] incubator-geode git commit: removed isHostReachable from SockCreator and its implementations.
Date Tue, 13 Oct 2015 18:29:14 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-397 7beba45f1 -> 4a26338b1


removed isHostReachable from SockCreator and its implementations.


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

Branch: refs/heads/feature/GEODE-397
Commit: f49c0d8a31d4de5d98af96575dddaecb2ccbd4cb
Parents: 7beba45
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Tue Oct 13 11:25:10 2015 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Tue Oct 13 11:25:10 2015 -0700

----------------------------------------------------------------------
 .../gemfire/internal/SocketCreator.java         | 40 --------------------
 .../org/jgroups/stack/SockCreatorImpl.java      |  5 ---
 .../gemstone/org/jgroups/util/SockCreator.java  |  8 +++-
 3 files changed, 6 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f49c0d8a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SocketCreator.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SocketCreator.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SocketCreator.java
index 1469c7c..b73a986 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SocketCreator.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SocketCreator.java
@@ -1029,46 +1029,6 @@ public class SocketCreator  implements com.gemstone.org.jgroups.util.SockCreator
 //       }
   }
 
-// commenting out isHostReachable since it was turned into deadcode
-// a long time ago because it could block.
-//  /** has the isReachable method been looked up already? */
-//  volatile boolean isReachableChecked;
-//  
-//  /** InetAddress.isReachable() is in v1.5 and later */
-//  volatile Method isReachableMethod;
-//  
-//  public boolean isHostReachable(InetAddress host) {
-//    boolean result = true;
-//    try {
-//      Method m = null;
-//      if (isReachableChecked) {
-//        m = isReachableMethod;
-//      }
-//      else {
-//        // deadcoded - InetAddress.isReachable uses the ECHO port
-//        // if we don't have root permission, and the ECHO port may
-//        // be blocked
-//        //m = InetAddress.class.getMethod("isReachable", new Class[] { int.class });
-//        //isReachableMethod = m;
-//        isReachableChecked = true;
-//      }
-//      if (m != null) {
-//        result = ((Boolean)m.invoke(host, new Object[] {Integer.valueOf(250)})).booleanValue();
-//        return result;
-//      }
-//    }
-//    catch (InvocationTargetException e) {
-//    }
-////    catch (NoSuchMethodException e) {
-////    }
-//    catch (IllegalAccessException e) {
-//    }
-//    // any other bright ideas?  attempts to connect a socket to a missing
-//    // machine may hang, so don't try the echo port or anything requiring
-//    // full Sockets
-//    return result;
-//  }
-  
   /** Will be a server socket... this one simply registers the listeners. */
   public void configureServerSSLSocket( Socket socket ) throws IOException {
 //       rw.readLock().lockInterruptibly();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f49c0d8a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/stack/SockCreatorImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/stack/SockCreatorImpl.java
b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/stack/SockCreatorImpl.java
index 946507a..27ca179 100755
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/stack/SockCreatorImpl.java
+++ b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/stack/SockCreatorImpl.java
@@ -32,11 +32,6 @@ public class SockCreatorImpl implements SockCreator {
   }
 
   @Override
-  public boolean isHostReachable(InetAddress ipAddress) {
-    return true;
-  }
-
-  @Override
   public Socket connect(InetAddress ipAddress, int port, int i,
       ConnectionWatcher watcher, boolean clientToServer) throws IOException {
     Socket socket = new Socket();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f49c0d8a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/util/SockCreator.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/util/SockCreator.java
b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/util/SockCreator.java
index 3ff053d..8b063f3 100755
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/util/SockCreator.java
+++ b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/util/SockCreator.java
@@ -4,6 +4,12 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
 
+/** This interface does not define how to create socks
+ * but defines a factory for creating sockets.
+ * One of its implementations had already used
+ * the name "SocketCreator" at the time the interface
+ * was created.
+ */
 public interface SockCreator {
 
   boolean useSSL();
@@ -11,8 +17,6 @@ public interface SockCreator {
   Socket connect(InetAddress ipAddress, int port, int connectTimeout,
       ConnectionWatcher watcher, boolean clientToServer, int timeout, boolean useSSL) throws
IOException;
 
-  boolean isHostReachable(InetAddress ipAddress);
-
   Socket connect(InetAddress ipAddress, int port, int timeout,
       ConnectionWatcher watcher, boolean clientToServer
       ) throws IOException;


Mime
View raw message