geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject geode git commit: GEODE-2368 Need to fix log message in DirectChannel
Date Mon, 30 Jan 2017 22:05:36 GMT
Repository: geode
Updated Branches:
  refs/heads/develop b529568dc -> 8c1184839


GEODE-2368 Need to fix log message in DirectChannel

Prior to the membership rewrite for v1.0 we used a different identifier
for the DirectChannel using the class "Stub".  In the rewrite we replaced
this with the InternalDistributedMember ID, but that isn't formed until
after the DirectChannel has been booted up and the MembershipManager has
finished joining the distributed system.

This change set modifies DirectChannel to use the SocketAddress of the
server socket it's created, which is equivalent to the old "Stub" identifier.


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

Branch: refs/heads/develop
Commit: 8c1184839e5222edac5d773a6f66a2d4bcc374f2
Parents: b529568
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Mon Jan 30 14:03:57 2017 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Mon Jan 30 14:05:25 2017 -0800

----------------------------------------------------------------------
 .../distributed/internal/direct/DirectChannel.java    |  5 ++---
 .../apache/geode/internal/i18n/LocalizedStrings.java  |  2 +-
 .../org/apache/geode/internal/tcp/TCPConduit.java     | 14 ++++++++++++++
 .../geode/test/dunit/standalone/ProcessManager.java   |  4 ++--
 4 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/8c118483/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
index cc88e95..a7e1408 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
@@ -134,9 +134,8 @@ public class DirectChannel {
       disconnectCompleted = false;
       this.groupOrderedSenderSem = new ReentrantSemaphore(MAX_GROUP_SENDERS);
       this.groupUnorderedSenderSem = new ReentrantSemaphore(MAX_GROUP_SENDERS);
-      logger.info(
-          LocalizedMessage.create(LocalizedStrings.DirectChannel_GEMFIRE_P2P_LISTENER_STARTED_ON__0,
-              conduit.getLocalAddr()));
+      logger.info(LocalizedMessage.create(
+          LocalizedStrings.DirectChannel_GEMFIRE_P2P_LISTENER_STARTED_ON__0, conduit.getAddress()));
 
     } catch (ConnectionException ce) {
       logger.fatal(LocalizedMessage.create(

http://git-wip-us.apache.org/repos/asf/geode/blob/8c118483/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
index 1c214e4..d855e29 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
@@ -764,7 +764,7 @@ public class LocalizedStrings {
           "{0} seconds have elapsed while waiting for reply from {1} on {2} whose current
membership list is: [{3}]");
 
   public static final StringId DirectChannel_GEMFIRE_P2P_LISTENER_STARTED_ON__0 =
-      new StringId(1432, "GemFire P2P Listener started on  {0}");
+      new StringId(1432, "GemFire P2P Listener started on {0}");
 
   public static final StringId DirectChannel_UNABLE_TO_INITIALIZE_DIRECT_CHANNEL_BECAUSE__0
=
       new StringId(1434, "Unable to initialize direct channel because:  {0}");

http://git-wip-us.apache.org/repos/asf/geode/blob/8c118483/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java
index 1398070..5ffa601 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java
@@ -20,6 +20,7 @@ import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.net.SocketException;
 import java.nio.channels.ClosedByInterruptException;
 import java.nio.channels.ClosedChannelException;
@@ -923,6 +924,19 @@ public class TCPConduit implements Runnable {
   }
 
   /**
+   * returns the socket address used for accepting connections
+   */
+  public SocketAddress getAddress() {
+    if (socket == null) {
+      return null;
+    }
+    if (address != null) {
+      return new InetSocketAddress(address, socket.getLocalPort());
+    }
+    return socket.getLocalSocketAddress();
+  }
+
+  /**
    * Return a connection to the given member. This method must continue to attempt to create
a
    * connection to the given member as long as that member is in the membership view and
the system
    * is not shutting down.

http://git-wip-us.apache.org/repos/asf/geode/blob/8c118483/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
index dce4353..b109e16 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/ProcessManager.java
@@ -65,9 +65,9 @@ public class ProcessManager {
 
   public synchronized void launchVM(String version, int vmNum, boolean bouncedVM)
       throws IOException {
-    if (processes.containsKey(version)) {
+    if (processes.containsKey(vmNum)) {
       throw new IllegalStateException(
-          "For version " + version + ", VM " + vmNum + " is already running.");
+          "VM " + vmNum + " is already running.");
     }
 
     String[] cmd = buildJavaCommand(vmNum, namingPort, version);


Mime
View raw message