zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject svn commit: r1678530 - in /zookeeper/branches/branch-3.5: ./ src/java/main/org/apache/zookeeper/ src/java/main/org/apache/zookeeper/client/ src/java/main/org/apache/zookeeper/common/ src/java/main/org/apache/zookeeper/server/quorum/ src/java/main/org/a...
Date Sat, 09 May 2015 22:30:22 GMT
Author: michim
Date: Sat May  9 22:30:21 2015
New Revision: 1678530

URL: http://svn.apache.org/r1678530
Log:
ZOOKEEPER-2171 avoid reverse lookups in QuorumCnxManager (rgs via michim)

Removed:
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/common/HostNameUtils.java
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/common/HostNameUtilsTest.java
Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ClientCnxn.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/client/StaticHostProvider.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/LocalPeerBean.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/RemotePeerBean.java
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
    zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/QuorumPeerInstance.java
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/CnxManagerTest.java
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ReconfigTest.java
    zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Sat May  9 22:30:21 2015
@@ -89,6 +89,8 @@ BUGFIXES:
 
   ZOOKEEPER-2062 RemoveWatchesTest takes forever to run (Chris Nauroth via rakeshr)
 
+  ZOOKEEPER-2171 avoid reverse lookups in QuorumCnxManager (rgs via michim)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ClientCnxn.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ClientCnxn.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ClientCnxn.java (original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ClientCnxn.java Sat May
 9 22:30:21 2015
@@ -1062,14 +1062,14 @@ public class ClientCnxn {
             }
 
             setName(getName().replaceAll("\\(.*\\)",
-                    "(" + addr.getHostName() + ":" + addr.getPort() + ")"));
+                    "(" + addr.getHostString() + ":" + addr.getPort() + ")"));
             if (ZooKeeperSaslClient.isEnabled()) {
                 try {
                     String principalUserName = System.getProperty(
                             ZK_SASL_CLIENT_USERNAME, "zookeeper");
                     zooKeeperSaslClient =
                         new ZooKeeperSaslClient(
-                                principalUserName+"/"+addr.getHostName());
+                                principalUserName+"/"+addr.getHostString());
                 } catch (LoginException e) {
                     // An authentication error occurred when the SASL client tried to initialize:
                     // for Kerberos this means that the client failed to authenticate with
the KDC.
@@ -1257,7 +1257,7 @@ public class ClientCnxn {
             Socket sock = null;
             BufferedReader br = null;
             try {
-                sock = new Socket(addr.getHostName(), addr.getPort());
+                sock = new Socket(addr.getHostString(), addr.getPort());
                 sock.setSoLinger(false, -1);
                 sock.setSoTimeout(1000);
                 sock.setTcpNoDelay(true);
@@ -1296,7 +1296,7 @@ public class ClientCnxn {
                 // connection attempt
                 rwServerAddress = addr;
                 throw new RWServerFoundException("Majority server found at "
-                        + addr.getHostName() + ":" + addr.getPort());
+                        + addr.getHostString() + ":" + addr.getPort());
             }
         }
 

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/client/StaticHostProvider.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/client/StaticHostProvider.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/client/StaticHostProvider.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/client/StaticHostProvider.java
Sat May  9 22:30:21 2015
@@ -27,7 +27,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Random;
 
-import org.apache.zookeeper.common.HostNameUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -111,14 +110,11 @@ public final class StaticHostProvider im
         for (InetSocketAddress address : serverAddresses) {
             try {
                 InetAddress ia = address.getAddress();
-                String addr = (ia != null) ? ia.getHostAddress() :
-                                             address.getHostName();
+                String addr = (ia != null) ? ia.getHostAddress() : address.getHostString();
                 InetAddress resolvedAddresses[] = InetAddress.getAllByName(addr);
                 for (InetAddress resolvedAddress : resolvedAddresses) {
-                    tmpList.add(new InetSocketAddress(InetAddress.getByAddress(
-                                    HostNameUtils.getHostString(address),
-                                    resolvedAddress.getAddress()),
-                                    address.getPort()));
+                    InetAddress taddr = InetAddress.getByAddress(address.getHostString(),
resolvedAddress.getAddress());
+                    tmpList.add(new InetSocketAddress(taddr, address.getPort()));
                 }
             } catch (UnknownHostException ex) {
                 LOG.warn("No IP address found for server: {}", address, ex);
@@ -188,7 +184,7 @@ public final class StaticHostProvider im
                     && ((addr.getAddress() != null
                             && myServer.getAddress() != null && addr
                             .getAddress().equals(myServer.getAddress())) || addr
-                            .getHostName().equals(myServer.getHostName()))) {
+                            .getHostString().equals(myServer.getHostString()))) {
                 myServerInNewConfig = true;
                 break;
             }

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/LocalPeerBean.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/LocalPeerBean.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/LocalPeerBean.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/LocalPeerBean.java
Sat May  9 22:30:21 2015
@@ -18,7 +18,6 @@
 
 package org.apache.zookeeper.server.quorum;
 
-import org.apache.zookeeper.common.HostNameUtils;
 
 /**
  * Implementation of the local peer MBean interface.
@@ -79,13 +78,13 @@ public class LocalPeerBean extends Serve
     }
 
     public String getElectionAddress() {
-        return HostNameUtils.getHostString(peer.getElectionAddress()) + ":"
-                + peer.getElectionAddress().getPort();
+        return peer.getElectionAddress().getHostString() + ":" +
+            peer.getElectionAddress().getPort();
     }
 
     public String getClientAddress() {
-        return HostNameUtils.getHostString(peer.getClientAddress()) + ":"
-                + peer.getClientAddress().getPort();
+        return peer.getClientAddress().getHostString() + ":" +
+            peer.getClientAddress().getPort();
     }
 
     public String getLearnerType(){

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java
Sat May  9 22:30:21 2015
@@ -181,7 +181,7 @@ public class QuorumCnxManager {
             // represents protocol version (in other words - message type)
             dout.writeLong(0xffff0000);              
             dout.writeLong(self.getId());
-            String addr = self.getElectionAddress().getHostName() + ":" + self.getElectionAddress().getPort();
+            String addr = self.getElectionAddress().getHostString() + ":" + self.getElectionAddress().getPort();
             byte[] addr_bytes = addr.getBytes();
             dout.writeInt(addr_bytes.length);
             dout.write(addr_bytes);

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
Sat May  9 22:30:21 2015
@@ -45,7 +45,6 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.zookeeper.common.AtomicFileWritingIdiom;
 import org.apache.zookeeper.common.AtomicFileWritingIdiom.WriterStatement;
-import org.apache.zookeeper.common.HostNameUtils;
 import org.apache.zookeeper.common.Time;
 import org.apache.zookeeper.jmx.MBeanRegistry;
 import org.apache.zookeeper.jmx.ZKMBeanInfo;
@@ -160,7 +159,7 @@ public class QuorumPeer extends ZooKeepe
                 LOG.warn("Election address has not been initialized");
                 return;
             }
-            String host = HostNameUtils.getHostString(this.addr);
+            String host = this.addr.getHostString();
             InetAddress address = null;
             try {
                 address = InetAddress.getByName(host);
@@ -254,7 +253,7 @@ public class QuorumPeer extends ZooKeepe
             StringWriter sw = new StringWriter();            
             //addr should never be null, but just to make sure
             if (addr !=null) { 
-                sw.append(HostNameUtils.getHostString(addr));
+                sw.append(addr.getHostString());
                 sw.append(":");
                 sw.append(String.valueOf(addr.getPort()));
             }
@@ -266,7 +265,7 @@ public class QuorumPeer extends ZooKeepe
             else if (type == LearnerType.PARTICIPANT) sw.append(":participant");        
   
             if (clientAddr!=null){
                 sw.append(";");
-                sw.append(HostNameUtils.getHostString(clientAddr));
+                sw.append(clientAddr.getHostString());
                 sw.append(":");
                 sw.append(String.valueOf(clientAddr.getPort()));
             }

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/RemotePeerBean.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/RemotePeerBean.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/RemotePeerBean.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/RemotePeerBean.java
Sat May  9 22:30:21 2015
@@ -18,7 +18,6 @@
 
 package org.apache.zookeeper.server.quorum;
 
-import org.apache.zookeeper.common.HostNameUtils;
 import org.apache.zookeeper.jmx.ZKMBeanInfo;
 
 /**
@@ -44,17 +43,15 @@ public class RemotePeerBean implements R
     }
 
     public String getQuorumAddress() {
-        return peer.addr.getHostName()+":"+peer.addr.getPort();
+        return peer.addr.getHostString()+":"+peer.addr.getPort();
     }
 
     public String getElectionAddress() {
-        return HostNameUtils.getHostString(peer.electionAddr) + ":"
-                + peer.electionAddr.getPort();
+        return peer.electionAddr.getHostString() + ":" + peer.electionAddr.getPort();
     }
 
     public String getClientAddress() {
-        return HostNameUtils.getHostString(peer.clientAddr) + ":"
-                + peer.clientAddr.getPort();
+        return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort();
     }
 
     public String getLearnerType() {

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/util/ConfigUtils.java
Sat May  9 22:30:21 2015
@@ -53,7 +53,7 @@ public class ConfigUtils {
              }
              if (!first) sb.append(",");
              else first = false;
-             sb.append(qs.clientAddr.getHostName() + ":" + qs.clientAddr.getPort());
+             sb.append(qs.clientAddr.getHostString() + ":" + qs.clientAddr.getPort());
         }
         return version + " " + sb.toString();
     }

Modified: zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/QuorumPeerInstance.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/QuorumPeerInstance.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/QuorumPeerInstance.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/systest/org/apache/zookeeper/test/system/QuorumPeerInstance.java
Sat May  9 22:30:21 2015
@@ -126,8 +126,8 @@ class QuorumPeerInstance implements Inst
             } catch(IOException e) {
                 e.printStackTrace();
             }
-            String report = clientAddr.getHostName() + ':' + clientAddr.getPort() +
-            ',' + quorumLeaderAddr.getHostName() + ':' + quorumLeaderAddr.getPort() + ':'
+ quorumLeaderElectionAddr.getPort();
+            String report = clientAddr.getHostString() + ':' + clientAddr.getPort() +
+            ',' + quorumLeaderAddr.getHostString() + ':' + quorumLeaderAddr.getPort() + ':'
+ quorumLeaderElectionAddr.getPort();
             try {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Reporting " + report);

Modified: zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/CnxManagerTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/CnxManagerTest.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/CnxManagerTest.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/CnxManagerTest.java
Sat May  9 22:30:21 2015
@@ -244,7 +244,7 @@ public class CnxManagerTest extends ZKTe
         DataOutputStream dout = new DataOutputStream(sc.socket().getOutputStream());
         dout.writeLong(0xffff0000);
         dout.writeLong(new Long(2));
-        String addr = otherAddr.getHostName()+ ":" + otherAddr.getPort();
+        String addr = otherAddr.getHostString()+ ":" + otherAddr.getPort();
         byte[] addr_bytes = addr.getBytes();
         dout.writeInt(addr_bytes.length);
         dout.write(addr_bytes);

Modified: zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java
Sat May  9 22:30:21 2015
@@ -46,8 +46,8 @@ public class ConnectStringParserTest ext
         String servers = "10.10.10.1,10.10.10.2";
         ConnectStringParser parser = new ConnectStringParser(servers);
 
-        Assert.assertEquals("10.10.10.1", parser.getServerAddresses().get(0).getHostName());
-        Assert.assertEquals("10.10.10.2", parser.getServerAddresses().get(1).getHostName());
+        Assert.assertEquals("10.10.10.1", parser.getServerAddresses().get(0).getHostString());
+        Assert.assertEquals("10.10.10.2", parser.getServerAddresses().get(1).getHostString());
     }
 
     @Test
@@ -55,8 +55,8 @@ public class ConnectStringParserTest ext
         String servers = "10.10.10.1:112,10.10.10.2:110";
         ConnectStringParser parser = new ConnectStringParser(servers);
 
-        Assert.assertEquals("10.10.10.1", parser.getServerAddresses().get(0).getHostName());
-        Assert.assertEquals("10.10.10.2", parser.getServerAddresses().get(1).getHostName());
+        Assert.assertEquals("10.10.10.1", parser.getServerAddresses().get(0).getHostString());
+        Assert.assertEquals("10.10.10.2", parser.getServerAddresses().get(1).getHostString());
 
         Assert.assertEquals(112, parser.getServerAddresses().get(0).getPort());
         Assert.assertEquals(110, parser.getServerAddresses().get(1).getPort());

Modified: zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ReconfigTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ReconfigTest.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ReconfigTest.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/ReconfigTest.java
Sat May  9 22:30:21 2015
@@ -34,7 +34,6 @@ import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.AsyncCallback.DataCallback;
-import org.apache.zookeeper.common.HostNameUtils;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.jmx.CommonNames;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
@@ -640,7 +639,7 @@ public class ReconfigTest extends ZKTest
     	}
     	String server = "server.0=localhost:" + ports[0] + ":" + ports[1] + ";" + ports[2];
     	QuorumServer qs = new QuorumServer(0, server);
-    	Assert.assertEquals(qs.clientAddr.getHostName(), "0.0.0.0");
+    	Assert.assertEquals(qs.clientAddr.getHostString(), "0.0.0.0");
     	Assert.assertEquals(qs.clientAddr.getPort(), ports[2]);
     }
     
@@ -890,12 +889,10 @@ public class ReconfigTest extends ZKTest
         Assert.assertEquals("Mismatches LearnerType!", qp.getLearnerType()
                 .name(), JMXEnv.ensureBeanAttribute(beanName, "LearnerType"));
         Assert.assertEquals("Mismatches ClientAddress!",
-                HostNameUtils.getHostString(qp.getClientAddress()) + ":"
-                        + qp.getClientAddress().getPort(),
+                qp.getClientAddress().getHostString() + ":" + qp.getClientAddress().getPort(),
                 JMXEnv.ensureBeanAttribute(beanName, "ClientAddress"));
         Assert.assertEquals("Mismatches LearnerType!",
-                HostNameUtils.getHostString(qp.getElectionAddress()) + ":"
-                        + qp.getElectionAddress().getPort(),
+                qp.getElectionAddress().getHostString() + ":" + qp.getElectionAddress().getPort(),
                 JMXEnv.ensureBeanAttribute(beanName, "ElectionAddress"));
         Assert.assertEquals("Mismatches PartOfEnsemble!", isPartOfEnsemble,
                 JMXEnv.ensureBeanAttribute(beanName, "PartOfEnsemble"));
@@ -930,19 +927,13 @@ public class ReconfigTest extends ZKTest
         Assert.assertEquals("Mismatches LearnerType!", qs.type.name(),
                 JMXEnv.ensureBeanAttribute(beanName, "LearnerType"));
         Assert.assertEquals("Mismatches ClientAddress!",
-                getNumericalAddrPort(
-                        HostNameUtils.getHostString(qs.clientAddr) + ":"
-                        + qs.clientAddr.getPort() ),
+                getNumericalAddrPort(qs.clientAddr.getHostString() + ":" + qs.clientAddr.getPort()),
                 getAddrPortFromBean(beanName, "ClientAddress") );
         Assert.assertEquals("Mismatches ElectionAddress!",
-                getNumericalAddrPort(
-                        HostNameUtils.getHostString(qs.electionAddr) + ":"
-                        + qs.electionAddr.getPort() ),
+                getNumericalAddrPort(qs.electionAddr.getHostString() + ":" + qs.electionAddr.getPort()),
                 getAddrPortFromBean(beanName, "ElectionAddress") );
         Assert.assertEquals("Mismatches QuorumAddress!",
-                getNumericalAddrPort(
-                        qs.addr.getHostName() + ":"
-                        + qs.addr.getPort() ),
+                getNumericalAddrPort(qs.addr.getHostString() + ":" + qs.addr.getPort()),
                 getAddrPortFromBean(beanName, "QuorumAddress") );
     }
 }

Modified: zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java?rev=1678530&r1=1678529&r2=1678530&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java
(original)
+++ zookeeper/branches/branch-3.5/src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java
Sat May  9 22:30:21 2015
@@ -497,7 +497,7 @@ public class StaticHostProviderTest exte
             assertTrue(!next.isUnresolved());
             assertTrue(!next.toString().startsWith("/"));
             // Do NOT trigger the reverse name service lookup.
-            String hostname = next.getHostName();
+            String hostname = next.getHostString();
             // In this case, the hostname equals literal IP address.
             hostname.equals(next.getAddress().getHostAddress());
         }



Mime
View raw message