cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Clean up MessagingService.allNodesAtLeast21 and related digest logic
Date Wed, 13 May 2015 20:31:21 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 9118af1bf -> ea1d16142


Clean up MessagingService.allNodesAtLeast21 and related digest logic

patch by Aleksey Yeschenko; reviewed by Brandon Williams for
CASSANDRA-9368


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

Branch: refs/heads/trunk
Commit: ea1d1614211b01d86d440dce8fe1a60a0bc3c7c1
Parents: 9118af1
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed May 13 01:41:07 2015 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed May 13 23:29:53 2015 +0300

----------------------------------------------------------------------
 .../org/apache/cassandra/db/ColumnFamily.java   |  4 +--
 .../apache/cassandra/net/MessagingService.java  | 31 +-------------------
 2 files changed, 3 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ea1d1614/src/java/org/apache/cassandra/db/ColumnFamily.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamily.java b/src/java/org/apache/cassandra/db/ColumnFamily.java
index 9caf20b..006ced7 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamily.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamily.java
@@ -395,8 +395,8 @@ public abstract class ColumnFamily implements Iterable<Cell>, IRowCacheEntry
     {
         for (Cell cell : this)
             cell.updateDigest(digest);
-        if (MessagingService.instance().areAllNodesAtLeast21())
-            deletionInfo().updateDigest(digest);
+
+        deletionInfo().updateDigest(digest);
     }
 
     public static ColumnFamily diff(ColumnFamily cf1, ColumnFamily cf2)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ea1d1614/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index bde004d..a7346f3 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -92,8 +92,6 @@ public final class MessagingService implements MessagingServiceMBean
      */
     public static final int PROTOCOL_MAGIC = 0xCA552DFA;
 
-    private boolean allNodesAtLeast21 = true;
-
     /* All verb handler identifiers */
     public enum Verb
     {
@@ -791,47 +789,20 @@ public final class MessagingService implements MessagingServiceMBean
         return packed >>> (start + 1) - count & ~(-1 << count);
     }
 
-    public boolean areAllNodesAtLeast21()
-    {
-        return allNodesAtLeast21;
-    }
-
     /**
      * @return the last version associated with address, or @param version if this is the
first such version
      */
     public int setVersion(InetAddress endpoint, int version)
     {
         logger.debug("Setting version {} for {}", version, endpoint);
-        if (version < VERSION_21)
-            allNodesAtLeast21 = false;
         Integer v = versions.put(endpoint, version);
-
-        // if the version was increased to 2.0 or later, see if all nodes are >= 2.0 now
-        if (v != null && v < VERSION_21 && version >= VERSION_21)
-            refreshAllNodesAtLeast21();
-
         return v == null ? version : v;
     }
 
     public void resetVersion(InetAddress endpoint)
     {
         logger.debug("Resetting version for {}", endpoint);
-        Integer removed = versions.remove(endpoint);
-        if (removed != null && removed <= VERSION_21)
-            refreshAllNodesAtLeast21();
-    }
-
-    private void refreshAllNodesAtLeast21()
-    {
-        for (Integer version: versions.values())
-        {
-            if (version < VERSION_21)
-            {
-                allNodesAtLeast21 = false;
-                return;
-            }
-        }
-        allNodesAtLeast21 = true;
+        versions.remove(endpoint);
     }
 
     public int getVersion(InetAddress endpoint)


Mime
View raw message