geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hiteshkhame...@apache.org
Subject geode git commit: Revert "GEODE-2804 Caching the InetAddress for configured ip string"
Date Tue, 27 Jun 2017 18:50:11 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2804 58afd6869 -> d303e7c95


Revert "GEODE-2804 Caching the InetAddress for configured ip string"

This reverts commit 58afd6869980028e6b8d0e5848a8fc7a00270262.


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

Branch: refs/heads/feature/GEODE-2804
Commit: d303e7c953535c11df0547e2282cc27bad1d6f57
Parents: 58afd68
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Tue Jun 27 11:49:49 2017 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Tue Jun 27 11:49:49 2017 -0700

----------------------------------------------------------------------
 geode-assembly/build.gradle                     |   1 -
 .../src/test/resources/expected_jars.txt        |   3 +-
 geode-core/build.gradle                         |   3 -
 .../admin/internal/DistributionLocatorImpl.java |   6 +-
 .../internal/AutoConnectionSourceImpl.java      | 133 ++++++++-----------
 .../geode/cache/client/internal/PoolImpl.java   |  15 +--
 .../internal/AbstractDistributionConfig.java    |   8 +-
 .../internal/InternalDistributedSystem.java     |   6 +-
 .../internal/membership/gms/GMSUtil.java        |  11 +-
 .../membership/gms/locator/GMSLocator.java      |   9 +-
 .../membership/gms/membership/GMSJoinLeave.java |   8 +-
 .../internal/tcpserver/TcpClient.java           |   3 +-
 .../admin/remote/DistributionLocatorId.java     |  45 ++-----
 .../admin/remote/RemoteTransportConfig.java     |   5 +-
 .../cache/ClusterConfigurationLoader.java       |   2 +-
 .../geode/internal/cache/PoolFactoryImpl.java   |  30 ++---
 .../internal/AutoConnectionSourceDUnitTest.java |  12 +-
 .../AutoConnectionSourceImplJUnitTest.java      |  84 ++----------
 .../internal/DistributionConfigJUnitTest.java   |   2 +-
 .../internal/StartupMessageDataJUnitTest.java   |   4 +-
 .../gms/membership/GMSJoinLeaveJUnitTest.java   |   1 -
 .../geode/codeAnalysis/excludedClasses.txt      |   3 +-
 .../internal/locator/wan/LocatorDiscovery.java  |  10 +-
 .../wan/LocatorMembershipListenerImpl.java      |   8 +-
 .../cache/wan/AbstractRemoteGatewaySender.java  |   4 +-
 .../wan/misc/WanAutoDiscoveryDUnitTest.java     |   7 +-
 gradle/dependency-versions.properties           |   1 -
 27 files changed, 139 insertions(+), 285 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index 95ccc70..39bb542 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -140,7 +140,6 @@ def cp = {
         it.contains('commons-collections') ||
         it.contains('commons-lang') ||
         it.contains('commons-logging') ||
-        it.contains('commons-validator') ||        
         it.contains('fast-classpath-scanner') ||
         it.contains('fastutil') ||
         it.contains('jackson-annotations') ||

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-assembly/src/test/resources/expected_jars.txt
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/resources/expected_jars.txt b/geode-assembly/src/test/resources/expected_jars.txt
index b0e7154..6260167 100644
--- a/geode-assembly/src/test/resources/expected_jars.txt
+++ b/geode-assembly/src/test/resources/expected_jars.txt
@@ -85,5 +85,4 @@ springfox-spring-web
 springfox-swagger
 springfox-swagger-common
 springfox-swagger-ui
-swagger-models
-commons-validator
+swagger-models
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 9ecb0f9..7f34b4a 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -39,8 +39,6 @@ dependencies {
   compile 'antlr:antlr:' + project.'antlr.version'
   compile 'com.fasterxml.jackson.core:jackson-databind:' + project.'jackson.version'
   compile 'commons-io:commons-io:' + project.'commons-io.version'
-  compile 'commons-validator:commons-validator:' + project.'commons-validator.version'
-
   compile 'commons-lang:commons-lang:' + project.'commons-lang.version'
   compile ('commons-modeler:commons-modeler:' + project.'commons-modeler.version') {
     exclude module: 'commons-digester'
@@ -135,7 +133,6 @@ dependencies {
   testRuntime 'commons-collections:commons-collections:' + project.'commons-collections.version'
   testRuntime 'commons-configuration:commons-configuration:' + project.'commons-configuration.version'
   testRuntime 'commons-io:commons-io:' + project.'commons-io.version'
-  testRuntime 'commons-validator:commons-validator:' + project.'commons-validator.version'
   testCompile 'net.spy:spymemcached:' + project.'spymemcached.version'
   testCompile 'redis.clients:jedis:' + project.'jedis.version'
 

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
index 97c5c7d..c1bfc93 100755
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
@@ -193,14 +193,14 @@ public class DistributionLocatorImpl implements DistributionLocator, InternalMan
       for (Iterator<String> locatorIter =
           hostedLocators.get(memberIter.next()).iterator(); locatorIter.hasNext();) {
         DistributionLocatorId locator = new DistributionLocatorId(locatorIter.next());
-        found = found || locator.getHostName().equals(host);
+        found = found || locator.getHost().getHostAddress().equals(host);
+        found = found || locator.getHost().getHostName().equals(host);
         if (!found && !host.contains(".")) {
           try {
             InetAddress inetAddr = InetAddress.getByName(host);
             found = locator.getHost().getHostName().equals(inetAddr.getHostName());
             if (!found) {
-              found =
-                  locator.getHost().getAddress().getHostAddress().equals(inetAddr.getHostAddress());
+              found = locator.getHost().getHostAddress().equals(inetAddr.getHostAddress());
             }
           } catch (UnknownHostException e) {
             // try config host as if it is an IP address instead of host name

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
index 7bf9f23..070451c 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
@@ -49,7 +49,6 @@ import org.apache.geode.cache.client.internal.locator.ServerLocationRequest;
 import org.apache.geode.cache.client.internal.locator.ServerLocationResponse;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -70,11 +69,9 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   private TcpClient tcpClient;
 
   protected static final LocatorListRequest LOCATOR_LIST_REQUEST = new LocatorListRequest();
-  private static final Comparator<HostAddress> SOCKET_ADDRESS_COMPARATOR =
-      new Comparator<HostAddress>() {
-        public int compare(HostAddress la1, HostAddress la2) {
-          InetSocketAddress o1 = la1.getSocketInetAddress();
-          InetSocketAddress o2 = la2.getSocketInetAddress();
+  private static final Comparator<InetSocketAddress> SOCKET_ADDRESS_COMPARATOR =
+      new Comparator<InetSocketAddress>() {
+        public int compare(InetSocketAddress o1, InetSocketAddress o2) {
           // shouldn't happen, but if it does we'll say they're the same.
           if (o1.getAddress() == null || o2.getAddress() == null) {
             return 0;
@@ -90,7 +87,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
             return o1.getPort() - o2.getPort();
         }
       };
-  protected final List<HostAddress> initialLocators;
+  protected final List<InetSocketAddress> initialLocators;
   private final String serverGroup;
   private AtomicReference<LocatorList> locators = new AtomicReference<LocatorList>();
   private AtomicReference<LocatorList> onlineLocators = new AtomicReference<LocatorList>();
@@ -111,18 +108,12 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * @param serverGroup
    * @param handshakeTimeout
    */
-  public AutoConnectionSourceImpl(List<InetSocketAddress> locators, List<HostAddress> contacts,
-      String serverGroup, int handshakeTimeout) {
-    /*
-     * if (contacts == null || contacts.size() == 0) { contacts = new ArrayList<>(); for
-     * (InetSocketAddress l : locators) { LocatorAddress la = new LocatorAddress(l,
-     * l.getHostName()); contacts.add(la); } }
-     */
-    ArrayList<HostAddress> tmpContacts =
-        new ArrayList<HostAddress>(Collections.unmodifiableList(contacts));
+  public AutoConnectionSourceImpl(List<InetSocketAddress> contacts, String serverGroup,
+      int handshakeTimeout) {
+    ArrayList<InetSocketAddress> tmpContacts = new ArrayList<InetSocketAddress>(contacts);
     this.locators.set(new LocatorList(tmpContacts));
     this.onlineLocators.set(new LocatorList(Collections.emptyList()));
-    this.initialLocators = Collections.unmodifiableList(this.locators.get().getLocatorAddresses());
+    this.initialLocators = Collections.unmodifiableList(tmpContacts);
     this.connectionTimeout = handshakeTimeout;
     this.serverGroup = serverGroup;
     this.tcpClient = new TcpClient();
@@ -211,21 +202,20 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   }
 
 
-  private ServerLocationResponse queryOneLocator(HostAddress locator,
+  private ServerLocationResponse queryOneLocator(InetSocketAddress locator,
       ServerLocationRequest request) {
     Object returnObj = null;
     try {
       pool.getStats().incLocatorRequests();
-      returnObj = tcpClient.requestToServer(locator.getSocketInetAddressC(), request,
-          connectionTimeout, true);
+      returnObj = tcpClient.requestToServer(locator, request, connectionTimeout, true);
       ServerLocationResponse response = (ServerLocationResponse) returnObj;
       pool.getStats().incLocatorResponses();
       if (response != null) {
-        reportLiveLocator(locator.getSocketInetAddressC());
+        reportLiveLocator(locator);
       }
       return response;
     } catch (IOException ioe) {
-      reportDeadLocator(locator.getSocketInetAddressC(), ioe);
+      reportDeadLocator(locator, ioe);
       updateLocatorInLocatorList(locator);
       return null;
     } catch (ClassNotFoundException e) {
@@ -238,7 +228,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       if (logger.isDebugEnabled()) {
         logger.debug("Received odd response object from the locator: {}", returnObj);
       }
-      reportDeadLocator(locator.getSocketInetAddressC(), e);
+      reportDeadLocator(locator, e);
       return null;
     }
   }
@@ -250,20 +240,19 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * 
    * @param locator
    */
-  protected void updateLocatorInLocatorList(HostAddress locator) {
-    if (locator.getSocketInetAddressC().getHostName() != null && !locator.isIpString()) {
+  protected void updateLocatorInLocatorList(InetSocketAddress locator) {
+    if (locator.getHostName() != null) {
       LocatorList locatorList = locators.get();
-      List<HostAddress> newLocatorsList = new ArrayList<>();
+      List<InetSocketAddress> newLocatorsList = new ArrayList<>();
 
-      for (HostAddress tloc : locatorList.getLocatorAddresses()) {
+      for (InetSocketAddress tloc : locatorList.getLocators()) {
         if (tloc.equals(locator)) {
           /**
            * This call doesn't throw UnknownHostException;
            */
-          InetSocketAddress changeLoc = new InetSocketAddress(locator.getHostName(),
-              locator.getSocketInetAddressC().getPort());
-          HostAddress la = new HostAddress(changeLoc, locator.getHostName());
-          newLocatorsList.add(la);
+          InetSocketAddress changeLoc =
+              new InetSocketAddress(locator.getHostName(), locator.getPort());
+          newLocatorsList.add(changeLoc);
           logger.info("updateLocatorInLocatorList changing locator list: loc form: " + locator
               + " ,loc to: " + changeLoc);
         } else {
@@ -280,7 +269,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   }
 
   protected List<InetSocketAddress> getCurrentLocators() {
-    return locators.get().getLocators();
+    return locators.get().locators;
   }
 
   protected ServerLocationResponse queryLocators(ServerLocationRequest request) {
@@ -289,13 +278,13 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
 
     final boolean isDebugEnabled = logger.isDebugEnabled();
     do {
-      HostAddress la = (HostAddress) controllerItr.next();
+      InetSocketAddress locator = (InetSocketAddress) controllerItr.next();
       if (isDebugEnabled) {
-        logger.debug("Sending query to locator {}: {}", la, request);
+        logger.debug("Sending query to locator {}: {}", locator, request);
       }
-      response = queryOneLocator(la, request);
+      response = queryOneLocator(locator, request);
       if (isDebugEnabled) {
-        logger.debug("Received query response from locator {}: {}", la, response);
+        logger.debug("Received query response from locator {}: {}", locator, response);
       }
     } while (controllerItr.hasNext() && (response == null || !response.hasResult()));
 
@@ -312,31 +301,28 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
     isBalanced = response.isBalanced();
     List<ServerLocation> locatorResponse = response.getLocators();
 
-    List<HostAddress> newLocatorAddresses = new ArrayList<HostAddress>(locatorResponse.size());
-    List<HostAddress> newOnlineLocators = new ArrayList<>(locatorResponse.size());
+    List<InetSocketAddress> newLocators = new ArrayList<InetSocketAddress>(locatorResponse.size());
+    List<InetSocketAddress> newOnlineLocators =
+        new ArrayList<InetSocketAddress>(locatorResponse.size());
 
-    Set<HostAddress> badLocators = new HashSet<>(initialLocators);
+    Set<InetSocketAddress> badLocators = new HashSet<InetSocketAddress>(initialLocators);
     for (Iterator<ServerLocation> itr = locatorResponse.iterator(); itr.hasNext();) {
       ServerLocation locator = itr.next();
       InetSocketAddress address = new InetSocketAddress(locator.getHostName(), locator.getPort());
-      HostAddress la = new HostAddress(address, locator.getHostName());
-      newLocatorAddresses.add(la);
-      newOnlineLocators.add(la);
-      badLocators.remove(la);
+      newLocators.add(address);
+      newOnlineLocators.add(address);
+      badLocators.remove(address);
     }
 
-    addbadLocators(newLocatorAddresses, badLocators);
-
-    LocatorList newLocatorList = new LocatorList(newLocatorAddresses);
+    addbadLocators(newLocators, badLocators);
 
     if (logger.isInfoEnabled()) {
-      List<InetSocketAddress> newLocators = newLocatorList.getLocators();
       LocatorList oldLocators = (LocatorList) locators.get();
       ArrayList<InetSocketAddress> removedLocators =
           new ArrayList<InetSocketAddress>(oldLocators.getLocators());
       removedLocators.removeAll(newLocators);
 
-      ArrayList<InetSocketAddress> addedLocators = new ArrayList<>(newLocators);
+      ArrayList<InetSocketAddress> addedLocators = new ArrayList<InetSocketAddress>(newLocators);
       addedLocators.removeAll(oldLocators.getLocators());
       if (!addedLocators.isEmpty()) {
         locatorCallback.locatorsDiscovered(Collections.unmodifiableList(addedLocators));
@@ -351,33 +337,34 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
             removedLocators));
       }
     }
-
-
+    LocatorList newLocatorList = new LocatorList(newLocators);
 
     locators.set(newLocatorList);
     onlineLocators.set(new LocatorList(newOnlineLocators));
-    pool.getStats().setLocatorCount(newLocatorAddresses.size());
+    pool.getStats().setLocatorCount(newLocators.size());
   }
 
   /**
    * This method will add bad locator only when locator with hostname and port is not already in
    * list.
    */
-  protected void addbadLocators(List<HostAddress> newLocators, Set<HostAddress> badLocators) {
-    for (HostAddress badloc : badLocators) {
+  protected void addbadLocators(List<InetSocketAddress> newLocators,
+      Set<InetSocketAddress> badLocators) {
+    for (InetSocketAddress badLoc : badLocators) {
       boolean addIt = true;
-      for (HostAddress goodloc : newLocators) {
-        boolean isSameHost = badloc.getHostName().equals(goodloc.getHostName());
-        if (isSameHost && badloc.getPort() == goodloc.getPort()) {
-          // ip has been changed so don't add this in current
-          // list
-          addIt = false;
-          break;
-
+      for (InetSocketAddress goodloc : newLocators) {
+        boolean isSameHost = badLoc.getHostName().equals(goodloc.getHostName());
+        if (isSameHost) {
+          boolean isSamePort = badLoc.getPort() == goodloc.getPort();
+          if (isSamePort) {
+            // ip has been changed so don't add this in current list
+            addIt = false;
+            break;
+          }
         }
       }
       if (addIt) {
-        newLocators.add(badloc);
+        newLocators.add(badLoc);
       }
     }
   }
@@ -436,23 +423,15 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * A list of locators, which remembers the last known good locator.
    */
   private static class LocatorList {
-    protected final List<HostAddress> locators;
+    protected final List<InetSocketAddress> locators;
     protected AtomicInteger currentLocatorIndex = new AtomicInteger();
 
-    public LocatorList(List<HostAddress> locators) {
+    public LocatorList(List<InetSocketAddress> locators) {
       Collections.sort(locators, SOCKET_ADDRESS_COMPARATOR);
       this.locators = Collections.unmodifiableList(locators);
     }
 
-    public List<InetSocketAddress> getLocators() {
-      List<InetSocketAddress> locs = new ArrayList<>();
-      for (HostAddress la : locators) {
-        locs.add(la.getSocketInetAddress());
-      }
-      return locs;
-    }
-
-    public List<HostAddress> getLocatorAddresses() {
+    public Collection<InetSocketAddress> getLocators() {
       return locators;
     }
 
@@ -460,7 +439,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       return locators.size();
     }
 
-    public Iterator<HostAddress> iterator() {
+    public Iterator<InetSocketAddress> iterator() {
       return new LocatorIterator();
     }
 
@@ -475,7 +454,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
      * controller.
      * 
      */
-    protected class LocatorIterator implements Iterator<HostAddress> {
+    protected class LocatorIterator implements Iterator<InetSocketAddress> {
       private int startLocator = currentLocatorIndex.get();
       private int locatorNum = 0;
 
@@ -483,12 +462,12 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
         return locatorNum < locators.size();
       }
 
-      public HostAddress next() {
+      public InetSocketAddress next() {
         if (!hasNext()) {
           return null;
         } else {
           int index = (locatorNum + startLocator) % locators.size();
-          HostAddress nextLocator = locators.get(index);
+          InetSocketAddress nextLocator = locators.get(index);
           currentLocatorIndex.set(index);
           locatorNum++;
           return nextLocator;

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
index 332046d..3ded54a 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
@@ -55,7 +55,6 @@ import org.apache.geode.distributed.PoolCancelledException;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.ScheduledThreadPoolExecutorWithKeepAlive;
 import org.apache.geode.internal.admin.ClientStatsManager;
 import org.apache.geode.internal.cache.EventID;
@@ -112,7 +111,6 @@ public class PoolImpl implements InternalPool {
   private final int subscriptionMessageTrackingTimeout;
   private final int subscriptionAckInterval;
   private final String serverGroup;
-  private final List<HostAddress> locatorAddresses;
   private final List<InetSocketAddress> locators;
   private final List<InetSocketAddress> servers;
   private final boolean startDisabled;
@@ -153,9 +151,8 @@ public class PoolImpl implements InternalPool {
   public static final int PRIMARY_QUEUE_TIMED_OUT = -1;
   private AtomicInteger primaryQueueSize = new AtomicInteger(PRIMARY_QUEUE_NOT_AVAILABLE);
 
-  public static PoolImpl create(PoolManagerImpl pm, String name, Pool attributes,
-      List<HostAddress> locatorAddresses) {
-    PoolImpl pool = new PoolImpl(pm, name, attributes, locatorAddresses);
+  public static PoolImpl create(PoolManagerImpl pm, String name, Pool attributes) {
+    PoolImpl pool = new PoolImpl(pm, name, attributes);
     pool.finishCreate(pm);
     return pool;
   }
@@ -181,8 +178,7 @@ public class PoolImpl implements InternalPool {
     }
   }
 
-  protected PoolImpl(PoolManagerImpl pm, String name, Pool attributes,
-      List<HostAddress> locAddresses) {
+  protected PoolImpl(PoolManagerImpl pm, String name, Pool attributes) {
     this.pm = pm;
     this.name = name;
     this.socketConnectTimeout = attributes.getSocketConnectTimeout();
@@ -204,7 +200,6 @@ public class PoolImpl implements InternalPool {
     this.subscriptionAckInterval = attributes.getSubscriptionAckInterval();
     this.serverGroup = attributes.getServerGroup();
     this.multiuserSecureModeEnabled = attributes.getMultiuserAuthentication();
-    this.locatorAddresses = locAddresses;
     this.locators = attributes.getLocators();
     this.servers = attributes.getServers();
     this.startDisabled =
@@ -648,8 +643,8 @@ public class PoolImpl implements InternalPool {
     if (locators.isEmpty()) {
       return new ExplicitConnectionSourceImpl(getServers());
     } else {
-      AutoConnectionSourceImpl source = new AutoConnectionSourceImpl(locators, locatorAddresses,
-          getServerGroup(), socketConnectTimeout);
+      AutoConnectionSourceImpl source =
+          new AutoConnectionSourceImpl(locators, getServerGroup(), socketConnectTimeout);
       if (locatorDiscoveryCallback != null) {
         source.setLocatorDiscoveryCallback(locatorDiscoveryCallback);
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
index 795f6a5..01c6157 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
@@ -24,13 +24,11 @@ import org.apache.geode.internal.AbstractConfig;
 import org.apache.geode.internal.ConfigSource;
 import org.apache.geode.internal.admin.remote.DistributionLocatorId;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LogWriterImpl;
 import org.apache.geode.internal.logging.log4j.LogLevel;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.memcached.GemFireMemcachedServer;
-import org.apache.logging.log4j.Logger;
 
 import java.lang.reflect.Method;
 import java.net.InetAddress;
@@ -56,8 +54,6 @@ import java.util.StringTokenizer;
 public abstract class AbstractDistributionConfig extends AbstractConfig
     implements DistributionConfig {
 
-  private static final Logger logger = LogService.getLogger();
-
   protected Object checkAttribute(String attName, Object value) {
     // first check to see if this attribute is modifiable, this also checks if the attribute is a
     // valid one.
@@ -278,7 +274,9 @@ public abstract class AbstractDistributionConfig extends AbstractConfig
         hostAddress = InetAddress.getByName(host);
 
       } catch (UnknownHostException ex) {
-        logger.warn("Unknown locator host: " + host);
+        throw new IllegalArgumentException(
+            LocalizedStrings.AbstractDistributionConfig_UNKNOWN_LOCATOR_HOST_0
+                .toLocalizedString(host));
       }
 
       locatorsb.append(host);

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index c8bac21..1572355 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -841,8 +841,8 @@ public class InternalDistributedSystem extends DistributedSystem
                                                                                      // Appenders
               this.securityLogWriter, // LOG: this is after IDS has created LogWriterLoggers and
                                       // Appenders
-              locId.getHost().getAddress(), locId.getHostnameForClients(),
-              this.originalConfig.toProperties(), false);
+              locId.getHost(), locId.getHostnameForClients(), this.originalConfig.toProperties(),
+              false);
 
       // if locator is started this way, cluster config is not enabled, set the flag correctly
       this.startedLocator.getConfig().setEnableClusterConfiguration(false);
@@ -1591,7 +1591,7 @@ public class InternalDistributedSystem extends DistributedSystem
       if (addr != null && addr.trim().length() > 0) {
         canonical.append(addr);
       } else {
-        canonical.append(locId.getHostName());
+        canonical.append(locId.getHost().getHostAddress());
       }
       canonical.append("[");
       canonical.append(String.valueOf(locId.getPort()));

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
index 108d06c..c6bef57 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
@@ -24,12 +24,11 @@ import java.util.StringTokenizer;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.GemFireConfigException;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.net.SocketCreator;
 
 public class GMSUtil {
 
-  public static List<HostAddress> parseLocators(String locatorsString, String bindAddress) {
+  public static List<InetSocketAddress> parseLocators(String locatorsString, String bindAddress) {
     InetAddress addr = null;
 
     try {
@@ -45,8 +44,9 @@ public class GMSUtil {
   }
 
 
-  public static List<HostAddress> parseLocators(String locatorsString, InetAddress bindAddress) {
-    List<HostAddress> result = new ArrayList<>(2);
+  public static List<InetSocketAddress> parseLocators(String locatorsString,
+      InetAddress bindAddress) {
+    List<InetSocketAddress> result = new ArrayList<>(2);
     String host;
     int port;
     boolean checkLoopback = (bindAddress != null);
@@ -82,8 +82,7 @@ public class GMSUtil {
                     + ").  On Unix this usually means that /etc/hosts is misconfigured.");
           }
         }
-        HostAddress la = new HostAddress(isa, host);
-        result.add(la);
+        result.add(isa);
       } catch (NumberFormatException e) {
         // this shouldn't happen because the config has already been parsed and
         // validated

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
index e625d91..93fa9da 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
@@ -51,7 +51,6 @@ import org.apache.geode.distributed.internal.membership.gms.GMSUtil;
 import org.apache.geode.distributed.internal.membership.gms.NetLocator;
 import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
@@ -71,7 +70,7 @@ public class GMSLocator implements Locator, NetLocator {
   private final boolean networkPartitionDetectionEnabled;
   private final String securityUDPDHAlgo;
   private final String locatorString;
-  private final List<HostAddress> locators;
+  private final List<InetSocketAddress> locators;
   private Services services;
   private final LocatorStats stats;
   private InternalDistributedMember localAddress;
@@ -103,7 +102,7 @@ public class GMSLocator implements Locator, NetLocator {
     this.securityUDPDHAlgo = securityUDPDHAlgo;
     this.locatorString = locatorString;
     if (this.locatorString == null || this.locatorString.length() == 0) {
-      this.locators = new ArrayList<HostAddress>(0);
+      this.locators = new ArrayList<>(0);
     } else {
       this.locators = GMSUtil.parseLocators(locatorString, bindAddress);
     }
@@ -357,8 +356,8 @@ public class GMSLocator implements Locator, NetLocator {
   }
 
   private boolean recoverFromOthers() {
-    for (HostAddress other : this.locators) {
-      if (recover(other.getSocketInetAddress())) {
+    for (InetSocketAddress other : this.locators) {
+      if (recover(other)) {
         logger.info("Peer locator recovered state from " + other);
         return true;
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index c5da171..84d42cf 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -184,7 +184,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
    */
   private NetView lastConflictingView;
 
-  private List<HostAddress> locators;
+  private List<InetSocketAddress> locators;
 
   /**
    * a list of join/leave/crashes
@@ -1064,9 +1064,8 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
     state.locatorsContacted = 0;
 
     do {
-      for (HostAddress laddr : locators) {
+      for (InetSocketAddress addr : locators) {
         try {
-          InetSocketAddress addr = laddr.getSocketInetAddress();
           Object o = tcpClientWrapper.sendCoordinatorFindRequest(addr, request, connectTimeout);
           FindCoordinatorResponse response =
               (o instanceof FindCoordinatorResponse) ? (FindCoordinatorResponse) o : null;
@@ -1102,7 +1101,6 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
             }
           }
         } catch (IOException | ClassNotFoundException problem) {
-          logger.debug("EOFException IOException ", problem);
         }
       }
     } while (!anyResponses && System.currentTimeMillis() < giveUpTime);
@@ -1155,7 +1153,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
         FindCoordinatorRequest request, int connectTimeout)
         throws ClassNotFoundException, IOException {
       TcpClient client = new TcpClient();
-      return client.requestToServer(addr, request, connectTimeout, true);
+      return client.requestToServer(addr.getAddress(), addr.getPort(), request, connectTimeout);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
index b2189f4..e9476b5 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
@@ -158,7 +158,7 @@ public class TcpClient {
     if (addr == null) {
       ipAddr = new InetSocketAddress(port);
     } else {
-      ipAddr = new InetSocketAddress(addr, port); // fix for bug 30810 bruce??
+      ipAddr = new InetSocketAddress(addr.getHostName(), port); // fix for bug 30810
     }
     return requestToServer(ipAddr, request, timeout, replyExpected);
   }
@@ -232,7 +232,6 @@ public class TcpClient {
           logger.debug("received response: {}", response);
           return response;
         } catch (EOFException ex) {
-          logger.debug("requestToServer EOFException ", ex);
           EOFException eof = new EOFException("Locator at " + ipAddr
               + " did not respond. This is normal if the locator was shutdown. If it wasn't check its log for exceptions.");
           eof.initCause(ex);

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
index 23801d9..5ab1bed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
@@ -23,14 +23,12 @@ import org.apache.geode.internal.admin.SSLConfig;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 import java.net.InetAddress;
-import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.validator.routines.InetAddressValidator;
 
 /**
  * Identifies the host, port, and bindAddress a distribution locator is listening on.
@@ -40,7 +38,7 @@ import org.apache.commons.validator.routines.InetAddressValidator;
 public class DistributionLocatorId implements java.io.Serializable {
   private static final long serialVersionUID = 6587390186971937865L;
 
-  private InetAddress host;
+  private final InetAddress host;
   private final int port;
   private final String bindAddress;
   transient private SSLConfig sslConfig;
@@ -49,7 +47,6 @@ public class DistributionLocatorId implements java.io.Serializable {
   private boolean peerLocator = true;
   private boolean serverLocator = true;
   private String hostnameForClients;
-  private String hostname;
 
   /**
    * Constructs a DistributionLocatorId with the given host and port.
@@ -119,7 +116,7 @@ public class DistributionLocatorId implements java.io.Serializable {
       bindIdx = marshalled.lastIndexOf(':');
     }
 
-    hostname = marshalled.substring(0, bindIdx > -1 ? bindIdx : portStartIdx);
+    String hostname = marshalled.substring(0, bindIdx > -1 ? bindIdx : portStartIdx);
 
     if (hostname.indexOf(':') >= 0) {
       bindIdx = marshalled.lastIndexOf('@');
@@ -130,7 +127,9 @@ public class DistributionLocatorId implements java.io.Serializable {
     try {
       this.host = InetAddress.getByName(hostname);
     } catch (UnknownHostException ex) {
-      this.host = null;
+      throw new InternalGemFireException(
+          LocalizedStrings.DistributionLocatorId_FAILED_GETTING_HOST_FROM_NAME_0
+              .toLocalizedString(hostname));
     }
 
     try {
@@ -216,37 +215,9 @@ public class DistributionLocatorId implements java.io.Serializable {
     return this.port;
   }
 
-  /**
-   * Returns the resolved InetSocketAddress of the locator We cache the InetAddress if hostname is
-   * ipString Otherwise we create InetAddress each time.
-   * 
-   **/
-  public InetSocketAddress getHost() throws UnknownHostException {
-    if (hostname != null) {
-      boolean isIpString = InetAddressValidator.getInstance().isValid(hostname);
-      if (isIpString) {
-        if (this.host == null) {
-          this.host = InetAddress.getByName(hostname);
-        }
-        return new InetSocketAddress(this.host, port);
-      }
-    }
-
-    if (this.hostname == null) {
-      if (this.host != null) {
-        return new InetSocketAddress(this.host, port);
-      }
-      throw new UnknownHostException("locator ID has no hostname or resolved inet address");
-    }
-    return new InetSocketAddress(hostname, port);
-  }
-
-  /** returns the host name */
-  public String getHostName() {
-    if (this.hostname == null) {
-      this.hostname = this.host.getHostName();
-    }
-    return this.hostname;
+  /** Returns the host. */
+  public InetAddress getHost() {
+    return this.host;
   }
 
   /** Returns true if this is a multicast address:port */

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
index 4759fe8..1dc2fd1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
@@ -30,7 +30,6 @@ import org.apache.geode.internal.admin.SSLConfig;
 import org.apache.geode.internal.admin.TransportConfig;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
-import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -260,7 +259,7 @@ public class RemoteTransportConfig implements TransportConfig {
     }
     if (this.mcastEnabled) {
       // Fix bug 32849
-      props.setProperty(MCAST_ADDRESS, this.mcastId.getHostName());
+      props.setProperty(MCAST_ADDRESS, String.valueOf(this.mcastId.getHost().getHostAddress()));
       props.setProperty(MCAST_PORT, String.valueOf(this.mcastId.getPort()));
 
     } else {
@@ -275,7 +274,7 @@ public class RemoteTransportConfig implements TransportConfig {
         if (baddr != null && baddr.trim().length() > 0) {
           locators.append(baddr);
         } else {
-          locators.append(locator.getHostName());
+          locators.append(locator.getHost().getCanonicalHostName());
         }
         locators.append("[");
         locators.append(locator.getPort());

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
index 9ecad8e..4f4881f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
@@ -232,7 +232,7 @@ public class ClusterConfigurationLoader {
       if (StringUtils.isNotBlank(ipaddress)) {
         locatorInetAddress = InetAddress.getByName(ipaddress);
       } else {
-        locatorInetAddress = dlId.getHost().getAddress();
+        locatorInetAddress = dlId.getHost();
       }
 
       int port = dlId.getPort();

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
index 65d6e02..d4fdbd0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
@@ -37,7 +37,6 @@ import org.apache.geode.cache.client.internal.LocatorDiscoveryCallback;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.wan.GatewaySender;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
@@ -56,8 +55,6 @@ public class PoolFactoryImpl implements PoolFactory {
    */
   private PoolAttributes attributes = new PoolAttributes();
 
-  private List<HostAddress> loators = new ArrayList<>();
-
   /**
    * The cache that created this factory
    */
@@ -220,24 +217,25 @@ public class PoolFactoryImpl implements PoolFactory {
     return this;
   }
 
-  private InetSocketAddress getInetSocketAddress(String host, int port) {
+  private PoolFactory add(String host, int port, List l) {
     if (port == 0) {
       throw new IllegalArgumentException("port must be greater than 0 but was " + port);
       // the rest of the port validation is done by InetSocketAddress
     }
-    InetSocketAddress sockAddr = null;
     try {
       InetAddress hostAddr = InetAddress.getByName(host);
-      sockAddr = new InetSocketAddress(hostAddr, port);
+      InetSocketAddress sockAddr = new InetSocketAddress(hostAddr, port);
+      l.add(sockAddr);
     } catch (UnknownHostException ignore) {
       // IllegalArgumentException ex = new IllegalArgumentException("Unknown host " + host);
       // ex.initCause(cause);
       // throw ex;
       // Fix for #45348
       logger.warn(LocalizedMessage.create(LocalizedStrings.PoolFactoryImpl_HOSTNAME_UNKNOWN, host));
-      sockAddr = new InetSocketAddress(host, port);
+      InetSocketAddress sockAddr = new InetSocketAddress(host, port);
+      l.add(sockAddr);
     }
-    return sockAddr;
+    return this;
   }
 
   public PoolFactory setSubscriptionAckInterval(int ackInterval) {
@@ -254,10 +252,7 @@ public class PoolFactoryImpl implements PoolFactory {
       throw new IllegalStateException(
           "A server has already been added. You can only add locators or servers; not both.");
     }
-    InetSocketAddress isa = getInetSocketAddress(host, port);
-    this.attributes.locators.add(isa);
-    loators.add(new HostAddress(isa, host));
-    return this;
+    return add(host, port, this.attributes.locators);
   }
 
   public PoolFactory addServer(String host, int port) {
@@ -265,9 +260,7 @@ public class PoolFactoryImpl implements PoolFactory {
       throw new IllegalStateException(
           "A locator has already been added. You can only add locators or servers; not both.");
     }
-    InetSocketAddress isa = getInetSocketAddress(host, port);
-    this.attributes.servers.add(isa);
-    return this;
+    return add(host, port, this.attributes.servers);
   }
 
   public PoolFactory reset() {
@@ -302,10 +295,7 @@ public class PoolFactoryImpl implements PoolFactory {
     setSubscriptionAckInterval(cp.getSubscriptionAckInterval());
     setServerGroup(cp.getServerGroup());
     setMultiuserAuthentication(cp.getMultiuserAuthentication());
-    for (InetSocketAddress l : cp.getLocators()) {
-      addLocator(l.getHostName(), l.getPort());
-    }
-    // this.attributes.locators.addAll(cp.getLocators());
+    this.attributes.locators.addAll(cp.getLocators());
     this.attributes.servers.addAll(cp.getServers());
   }
 
@@ -337,7 +327,7 @@ public class PoolFactoryImpl implements PoolFactory {
         registry.creatingPool();
       }
     }
-    return PoolImpl.create(this.pm, name, this.attributes, this.loators);
+    return PoolImpl.create(this.pm, name, this.attributes);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
index deb3325..789d326 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -160,12 +160,10 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
       final int locatorPort3 = ports[2];
       String locators =
           getLocatorString(host, new int[] {locatorPort0, locatorPort1, locatorPort3});
-      vm0.invoke("Start Locator1 ",
-          () -> startLocator(NetworkUtils.getServerHostName(vm0.getHost()), locatorPort0,
-              locators));
-      vm1.invoke("Start Locator2 ",
-          () -> startLocator(NetworkUtils.getServerHostName(vm1.getHost()), locatorPort1,
-              locators));
+      vm0.invoke("Start Locator", () -> startLocator(NetworkUtils.getServerHostName(vm0.getHost()),
+          locatorPort0, locators));
+      vm1.invoke("Start Locator", () -> startLocator(NetworkUtils.getServerHostName(vm1.getHost()),
+          locatorPort1, locators));
 
       vm2.invoke("StartBridgeClient", () -> startBridgeClient(null,
           NetworkUtils.getServerHostName(vm0.getHost()), locatorPort0));
@@ -526,7 +524,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
         }
 
         List<InetSocketAddress> locators = pool.getOnlineLocators();
-        Assert.assertEquals("found " + locators, expected.length, locators.size());
+        Assert.assertEquals(expected.length, locators.size());
         Arrays.sort(expected, Comparator.comparing(InetSocketAddress::getPort));
         for (int i = 0; i < locators.size(); i++) {
           InetSocketAddress locator = locators.get(i);

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
index b5dc288..9169904 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
@@ -18,18 +18,14 @@ import org.apache.geode.CancelCriterion;
 import org.apache.geode.cache.*;
 import org.apache.geode.cache.client.NoAvailableLocatorsException;
 import org.apache.geode.cache.client.SubscriptionNotEnabledException;
-import org.apache.geode.cache.client.internal.AutoConnectionSourceImpl.UpdateLocatorListTask;
-import org.apache.geode.cache.client.internal.PoolImpl.PoolTask;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionRequest;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionResponse;
-import org.apache.geode.cache.client.internal.locator.LocatorListRequest;
 import org.apache.geode.cache.client.internal.locator.LocatorListResponse;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.PoolStatHelper;
 import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
@@ -63,7 +59,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
@@ -75,7 +70,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import org.awaitility.Awaitility;
-import org.awaitility.Duration;
 
 /**
  *
@@ -119,12 +113,8 @@ public class AutoConnectionSourceImplJUnitTest {
     background = Executors.newSingleThreadScheduledExecutor();
 
     List/* <InetSocketAddress> */ locators = new ArrayList();
-    InetAddress ia = InetAddress.getLocalHost();
-    InetSocketAddress isa = new InetSocketAddress(ia, port);
-    locators.add(isa);
-    List<HostAddress> la = new ArrayList<>();
-    la.add(new HostAddress(isa, ia.getHostName()));
-    source = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
+    locators.add(new InetSocketAddress(InetAddress.getLocalHost(), port));
+    source = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
     source.start(pool);
   }
 
@@ -169,18 +159,12 @@ public class AutoConnectionSourceImplJUnitTest {
     List<InetSocketAddress> locators = new ArrayList();
     InetSocketAddress floc1 = new InetSocketAddress("fakeLocalHost1", port);
     InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
-
     locators.add(floc1);
     locators.add(floc2);
-
-    List<HostAddress> la = new ArrayList<>();
-    la.add(new HostAddress(floc1, floc1.getHostName()));
-    la.add(new HostAddress(floc2, floc2.getHostName()));
-
-    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
+    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
 
     // This method will create a new InetSocketAddress of floc1
-    src.updateLocatorInLocatorList(new HostAddress(floc1, floc1.getHostName()));
+    src.updateLocatorInLocatorList(floc1);
 
     List<InetSocketAddress> cLocList = src.getCurrentLocators();
 
@@ -207,24 +191,18 @@ public class AutoConnectionSourceImplJUnitTest {
     InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
     locators.add(floc1);
     locators.add(floc2);
-    List<HostAddress> la = new ArrayList<>();
-    la.add(new HostAddress(floc1, floc1.getHostName()));
-    la.add(new HostAddress(floc2, floc2.getHostName()));
-    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
+    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
 
 
+    Set<InetSocketAddress> badLocators = new HashSet<>();
     InetSocketAddress b1 = new InetSocketAddress("fakeLocalHost1", port);
     InetSocketAddress b2 = new InetSocketAddress("fakeLocalHost3", port);
+    badLocators.add(b1);
+    badLocators.add(b2);
 
-    Set<HostAddress> bla = new HashSet<>();
-    bla.add(new HostAddress(b1, b1.getHostName()));
-    bla.add(new HostAddress(b2, b2.getHostName()));
-
+    src.addbadLocators(locators, badLocators);
 
-    src.addbadLocators(la, bla);
-
-    System.out.println("new locatores " + la );
-    Assert.assertEquals(3, la.size());
+    Assert.assertEquals(3, locators.size());
   }
 
   @Test
@@ -298,11 +276,6 @@ public class AutoConnectionSourceImplJUnitTest {
     assertEquals(loc1, source.findServer(null));
   }
 
-  /**
-   * This tests that discovery works even after one of two locators was shut down
-   * 
-   * @throws Exception
-   */
   @Test
   public void testDiscoverLocators() throws Exception {
     startFakeLocator();
@@ -337,41 +310,6 @@ public class AutoConnectionSourceImplJUnitTest {
   }
 
   @Test
-  public void testDiscoverLocatorsConnectsToLocatorsAfterTheyStartUp() throws Exception {
-    ArrayList locators = new ArrayList();
-    locators.add(new ServerLocation(InetAddress.getLocalHost().getHostName(), port));
-    handler.nextLocatorListResponse = new LocatorListResponse(locators, false);
-    
-    try {
-      Awaitility.await().pollDelay(new Duration(200, TimeUnit.MILLISECONDS)).atMost(500, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
-
-        @Override
-        public Boolean call() throws Exception {
-          return source.getOnlineLocators().isEmpty();
-        }
-      });
-      startFakeLocator();
-
-      server.join(1000);
-      
-      Awaitility.await().atMost(5000, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
-
-        @Override
-        public Boolean call() throws Exception {
-          return source.getOnlineLocators().size() == 1;
-        }
-      });
-    } finally {
-      try {
-        new TcpClient().stop(InetAddress.getLocalHost(), port);
-      } catch (ConnectException ignore) {
-        // must not be running
-      }
-      server.join(60 * 1000);
-    }
-  }
-
-  @Test
   public void testSysPropLocatorUpdateInterval() throws Exception {
     long updateLocatorInterval = 543;
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "LOCATOR_UPDATE_INTERVAL",
@@ -660,5 +598,5 @@ public class AutoConnectionSourceImplJUnitTest {
     }
 
     public void setServerAffinityLocation(ServerLocation serverLocation) {}
-  }  
+  }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
index 9bd8dd8..9f6c5fb 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
@@ -342,7 +342,7 @@ public class DistributionConfigJUnitTest {
     assertEquals(config.getStartLocator(), address);
   }
 
-  @Test
+  @Test(expected = InternalGemFireException.class)
   public void testInvalidLocatorAddress() {
     String address = "bad.bad[7056]";
     config.modifiable = true;

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
index b5a62ca..9d63050 100755
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
@@ -252,9 +252,9 @@ public class StartupMessageDataJUnitTest {
 
   private String createOneLocatorString() throws Exception {
     DistributionLocatorId locatorId =
-        new DistributionLocatorId(SocketCreator.getLocalHost(), 44556, "111.222.333.444", null);
+        new DistributionLocatorId(SocketCreator.getLocalHost(), 445566, "111.222.333.444", null);
     String locatorString = locatorId.marshal();
-    assertEquals("" + locatorId.getHost().getAddress().getHostAddress() + ":111.222.333.444[44556]",
+    assertEquals("" + locatorId.getHost().getHostAddress() + ":111.222.333.444[445566]",
         locatorString);
     return locatorString;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
index ff61a50..a31fa8d 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
@@ -36,7 +36,6 @@ import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.membership.NetView;
 import org.apache.geode.distributed.internal.membership.gms.GMSMember;
-import org.apache.geode.distributed.internal.membership.gms.GMSUtil;
 import org.apache.geode.distributed.internal.membership.gms.ServiceConfig;
 import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.membership.gms.Services.Stopper;

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
index db234e0..6a6e0c1 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
@@ -155,5 +155,4 @@ org/apache/geode/distributed/internal/tcpserver/LocatorCancelException
 org.apache.geode.internal.security.SecurableCommunicationChannel
 org/apache/geode/internal/security/shiro/GeodeAuthenticationToken
 org/apache/geode/internal/cache/InitialImageOperation$GIITestHook
-org/apache/geode/internal/AvailablePort$Keeper
-org/apache/geode/internal/admin/remote/DistributionLocatorId
+org/apache/geode/internal/AvailablePort$Keeper
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
index dd3fc84..f5a8fcf 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
@@ -131,8 +131,8 @@ public class LocatorDiscovery {
     while (!getDiscoverer().isStopped()) {
       try {
         RemoteLocatorJoinResponse response =
-            (RemoteLocatorJoinResponse) locatorClient.requestToServer(locatorId.getHost(), request,
-                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
+            (RemoteLocatorJoinResponse) locatorClient.requestToServer(locatorId.getHost(),
+                locatorId.getPort(), request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
         if (response != null) {
           LocatorHelper.addExchangedLocators(response.getLocators(), this.locatorListener);
           logger.info(LocalizedMessage.create(
@@ -181,7 +181,8 @@ public class LocatorDiscovery {
       try {
         response =
             (RemoteLocatorJoinResponse) locatorClient.requestToServer(remoteLocator.getHost(),
-                request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
+                remoteLocator.getPort(), request,
+                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
         if (response != null) {
           LocatorHelper.addExchangedLocators(response.getLocators(), this.locatorListener);
           logger.info(LocalizedMessage.create(
@@ -192,7 +193,8 @@ public class LocatorDiscovery {
             Thread.sleep(WAN_LOCATOR_PING_INTERVAL);
             RemoteLocatorPingResponse pingResponse =
                 (RemoteLocatorPingResponse) locatorClient.requestToServer(remoteLocator.getHost(),
-                    pingRequest, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
+                    remoteLocator.getPort(), pingRequest,
+                    WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
             if (pingResponse != null) {
               continue;
             }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
index 5fe1eda..d6d5d7c 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
@@ -104,25 +104,25 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
           }
           for (DistributionLocatorId value : entry.getValue()) {
             try {
-              tcpClient.requestToServer(value.getHost(),
+              tcpClient.requestToServer(value.getHost(), value.getPort(),
                   new LocatorJoinMessage(distributedSystemId, locator, localLocatorId, ""), 1000,
                   false);
             } catch (Exception e) {
               if (logger.isDebugEnabled()) {
                 logger.debug(LocalizedMessage.create(
                     LocalizedStrings.LOCATOR_MEMBERSHIP_LISTENER_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_1_WIHT_2_3,
-                    new Object[] {locator.getHostName(), locator.getPort(), value.getHostName(),
+                    new Object[] {locator.getHost(), locator.getPort(), value.getHost(),
                         value.getPort()}));
               }
             }
             try {
-              tcpClient.requestToServer(locator.getHost(),
+              tcpClient.requestToServer(locator.getHost(), locator.getPort(),
                   new LocatorJoinMessage(entry.getKey(), value, localLocatorId, ""), 1000, false);
             } catch (Exception e) {
               if (logger.isDebugEnabled()) {
                 logger.debug(LocalizedMessage.create(
                     LocalizedStrings.LOCATOR_MEMBERSHIP_LISTENER_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_1_WIHT_2_3,
-                    new Object[] {value.getHostName(), value.getPort(), locator.getHostName(),
+                    new Object[] {value.getHost(), value.getPort(), locator.getHost(),
                         locator.getPort()}));
               }
             }

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
index 00cc760..dbc2cc6 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
@@ -75,8 +75,8 @@ public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender
       DistributionLocatorId locatorID = new DistributionLocatorId(localLocator);
       try {
         RemoteLocatorResponse response =
-            (RemoteLocatorResponse) new TcpClient().requestToServer(locatorID.getHost(), request,
-                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
+            (RemoteLocatorResponse) new TcpClient().requestToServer(locatorID.getHost(),
+                locatorID.getPort(), request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
 
         if (response != null) {
           if (response.getLocators() == null) {

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
index 63f6005..6d75064 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
@@ -603,7 +603,6 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     testRemoteLocators(remoteLocators, true, 1);
   }
 
-  // pool has been created even though locator address is not valid
   @Test
   public void testInvalidHostRemoteLocators() {
     IgnoredException ie = IgnoredException
@@ -611,8 +610,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     try {
       Set<String> remoteLocators = new HashSet();
       addUnknownHost(remoteLocators);
-      // now we don't validata address upfront
-      testRemoteLocators(remoteLocators, true, 1);
+      testRemoteLocators(remoteLocators, false, 0);
     } finally {
       ie.remove();
     }
@@ -623,8 +621,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     Set<String> remoteLocators = new HashSet();
     remoteLocators.add("localhost[12345]");
     addUnknownHost(remoteLocators);
-    // now we add the locator to pool, because we don't validate locator address
-    testRemoteLocators(remoteLocators, true, 2);
+    testRemoteLocators(remoteLocators, true, 1);
   }
 
   private void addUnknownHost(Set<String> remoteLocators) {

http://git-wip-us.apache.org/repos/asf/geode/blob/d303e7c9/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index 47bf79a..183dafc 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -95,4 +95,3 @@ tempus-fugit.version = 1.1
 tomcat6.version = 6.0.37
 tomcat7.version = 7.0.73
 tomcat8.version = 8.5.9
-commons-validator.version = 1.6


Mime
View raw message