Skip to content

Commit

Permalink
Make IncomingTcpConnection responsible for version handling.
Browse files Browse the repository at this point in the history
Patch by Marcus Erikkson, reviewed by Peter Schuller and brandonwilliams
for CASSANDRA-3166

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.8@1169823 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
driftx committed Sep 12, 2011
1 parent 6a4c1c7 commit 8cd4264
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/java/org/apache/cassandra/gms/Gossiper.java
Expand Up @@ -194,11 +194,13 @@ public void unregister(IEndpointStateChangeSubscriber subscriber)

public void setVersion(InetAddress address, int version)
{
logger.debug("Setting version {} for {}", version, address);
versions.put(address, version);
}

public void resetVersion(InetAddress endpoint)
{
logger.debug("Reseting version for {}", endpoint);
versions.remove(endpoint);
}

Expand Down
2 changes: 2 additions & 0 deletions src/java/org/apache/cassandra/net/IncomingTcpConnection.java
Expand Up @@ -158,6 +158,8 @@ public void run()

private void close()
{
// reset version here, since we set when starting an incoming socket
Gossiper.instance.resetVersion(socket.getInetAddress());
try
{
socket.close();
Expand Down
3 changes: 0 additions & 3 deletions src/java/org/apache/cassandra/net/OutboundTcpConnection.java
Expand Up @@ -139,9 +139,6 @@ private void disconnect()
output = null;
socket = null;
}

// when we see the node again, try to connect at the most recent protocol we know about
Gossiper.instance.resetVersion(endpoint);
}

private ByteBuffer take()
Expand Down

0 comments on commit 8cd4264

Please sign in to comment.