geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [79/98] [abbrv] incubator-geode git commit: Revert "GEODE-2000 Now ClientMembershipListener returns host on which"
Date Fri, 28 Oct 2016 21:41:33 GMT
Revert "GEODE-2000 Now ClientMembershipListener returns host on which"

This reverts commit 8a080323070dbbc1d7037612d0d8e1188dcf1507.

This change caused some CI failures that folks suppressed.  The fix needs
to be revisited.


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

Branch: refs/heads/feature/GEM-983
Commit: be2a40488b44ebeccdac0d8b6c8a3810df00f9da
Parents: 60f8a80
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Oct 25 14:08:10 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Oct 25 14:51:58 2016 -0700

----------------------------------------------------------------------
 .../membership/InternalDistributedMember.java   |  6 +----
 .../internal/cache/tier/sockets/HandShake.java  |  9 +++----
 .../AutoConnectionSourceImplJUnitTest.java      | 27 --------------------
 3 files changed, 4 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
index ac8379b..82dd055 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
@@ -1171,11 +1171,7 @@ public class InternalDistributedMember implements DistributedMember,
Externaliza
   }
 
   public String getHost() {
-    return this.hostName;
-  }
-
-  public void setHost(String h) {
-    this.hostName = h;
+    return this.netMbr.getInetAddress().getCanonicalHostName();
   }
 
   public int getProcessId() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
index 5e13be0..95e531d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
@@ -1253,7 +1253,7 @@ public class HandShake implements ClientHandShake {
       int qSize = dis.readInt();
 
       // Read the server member
-      member = readServerMember(dis, location);
+      member = readServerMember(dis);
       serverQStatus = new ServerQueueStatus(epType, qSize, member);
 
       // Read the message (if any)
@@ -1368,8 +1368,7 @@ public class HandShake implements ClientHandShake {
     return sqs;
   }
 
-  public static DistributedMember readServerMember(DataInputStream p_dis,
-      ServerLocation serverLocation) throws IOException {
+  protected DistributedMember readServerMember(DataInputStream p_dis) throws IOException
{
 
     byte[] memberBytes = DataSerializer.readByteArray(p_dis);
     ByteArrayInputStream bais = new ByteArrayInputStream(memberBytes);
@@ -1379,9 +1378,7 @@ public class HandShake implements ClientHandShake {
       dis = new VersionedDataInputStream(dis, v);
     }
     try {
-      InternalDistributedMember ids = (InternalDistributedMember) DataSerializer.readObject(dis);
-      ids.setHost(serverLocation.getHostName());
-      return ids;
+      return (DistributedMember) DataSerializer.readObject(dis);
     } catch (EOFException e) {
       throw e;
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/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 63fc8d5..913edf2 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
@@ -15,7 +15,6 @@
 package org.apache.geode.cache.client.internal;
 
 import org.apache.geode.CancelCriterion;
-import org.apache.geode.DataSerializer;
 import org.apache.geode.cache.*;
 import org.apache.geode.cache.client.NoAvailableLocatorsException;
 import org.apache.geode.cache.client.SubscriptionNotEnabledException;
@@ -23,29 +22,22 @@ 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.LocatorListResponse;
 import org.apache.geode.cache.query.QueryService;
-import org.apache.geode.distributed.DistributedMember;
 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.SharedConfiguration;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.HeapDataOutputStream;
-import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.PoolStats;
-import org.apache.geode.internal.cache.tier.sockets.HandShake;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
 import java.io.IOException;
 import java.net.ConnectException;
 import java.net.InetAddress;
@@ -146,25 +138,6 @@ public class AutoConnectionSourceImplJUnitTest {
   }
 
   @Test
-  public void testClientMembershipListenerHostAtClient() throws IOException {
-    String fakeHost = "fake.com";
-    InternalDistributedMember member = new InternalDistributedMember("localhost", 54638);
-    ServerLocation sl = new ServerLocation(fakeHost, 420);
-
-    HeapDataOutputStream dos = new HeapDataOutputStream(Version.CURRENT);
-    HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT);
-    DataSerializer.writeObject(member, hdos);
-    DataSerializer.writeByteArray(hdos.toByteArray(), dos);
-    hdos.close();
-
-    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(dos.toByteArray()));
-
-    DistributedMember ret = (DistributedMember) HandShake.readServerMember(dis, sl);
-
-    assertEquals(fakeHost, ret.getHost());
-  }
-
-  @Test
   public void testNoServers() throws Exception {
     startFakeLocator();
     handler.nextConnectionResponse = new ClientConnectionResponse(null);


Mime
View raw message