Merge branch 'cassandra-2.1' into trunk

Conflicts:
        src/java/org/apache/cassandra/gms/VersionedValue.java


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

Branch: refs/heads/trunk
Commit: 68f9e9040bcbd7460c7289014712cd2fff037593
Parents: b7151fb 4f2c372
Author: Brandon Williams <brandonwilli...@apache.org>
Authored: Wed Apr 15 09:34:48 2015 -0500
Committer: Brandon Williams <brandonwilli...@apache.org>
Committed: Wed Apr 15 09:34:48 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../gms/GossipShutdownVerbHandler.java          |  2 +-
 src/java/org/apache/cassandra/gms/Gossiper.java | 86 ++++++++++++++++++--
 .../apache/cassandra/gms/HeartBeatState.java    |  5 ++
 .../apache/cassandra/gms/VersionedValue.java    |  6 ++
 .../cassandra/service/StorageService.java       | 13 ++-
 6 files changed, 101 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/68f9e904/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/68f9e904/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/Gossiper.java
index 34f54a1,cfcc9fd..d79b973
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@@ -977,21 -1007,19 +1015,24 @@@ public class Gossiper implements IFailu
          }
          for (IEndpointStateChangeSubscriber subscriber : subscribers)
              subscriber.onJoin(ep, epState);
+         // check this at the end so nodes will learn about the endpoint
+         if (isShutdown(ep))
+             markAsShutdown(ep);
      }
  
 +    public boolean isAlive(InetAddress endpoint)
 +    {
 +        EndpointState epState = getEndpointStateForEndpoint(endpoint);
 +        if (epState == null)
 +            return false;
 +        return epState.isAlive() && !isDeadState(epState);
 +    }
 +
      public boolean isDeadState(EndpointState epState)
      {
 -        if (epState.getApplicationState(ApplicationState.STATUS) == null)
 +        String state = epState.getStatus();
 +        if (state.isEmpty())
              return false;
 -        String value = 
epState.getApplicationState(ApplicationState.STATUS).value;
 -        String[] pieces = value.split(VersionedValue.DELIMITER_STR, -1);
 -        assert (pieces.length > 0);
 -        String state = pieces[0];
          for (String deadstate : DEAD_STATES)
          {
              if (state.equals(deadstate))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/68f9e904/src/java/org/apache/cassandra/gms/VersionedValue.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/VersionedValue.java
index 203f3a7,1d33642..a142f41
--- a/src/java/org/apache/cassandra/gms/VersionedValue.java
+++ b/src/java/org/apache/cassandra/gms/VersionedValue.java
@@@ -211,12 -208,12 +212,17 @@@ public class VersionedValue implements 
          {
              return new VersionedValue(VersionedValue.HIBERNATE + 
VersionedValue.DELIMITER + value);
          }
 +
 +        public VersionedValue rpcReady(boolean value)
 +        {
 +            return new VersionedValue(String.valueOf(value));
 +        }
  
+         public VersionedValue shutdown(boolean value)
+         {
+             return new VersionedValue(VersionedValue.SHUTDOWN + 
VersionedValue.DELIMITER + value);
+         }
+ 
          public VersionedValue datacenter(String dcId)
          {
              return new VersionedValue(dcId);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/68f9e904/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------

Reply via email to