cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [06/10] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0
Date Mon, 14 Mar 2016 22:03:18 GMT
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.0
Commit: a479fb0dbe9e2e94e7b1c2c410c4436fd9d3c4d3
Parents: 854a243 719caa6
Author: Joshua McKenzie <joshua.mckenzie@gmail.com>
Authored: Mon Mar 14 18:00:19 2016 -0400
Committer: Joshua McKenzie <joshua.mckenzie@gmail.com>
Committed: Mon Mar 14 18:01:14 2016 -0400

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageProxy.java  | 35 ++++++++++----------
 1 file changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a479fb0d/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageProxy.java
index 5cebf27,8e5ba0f..1395470
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@@ -2311,31 -2117,30 +2311,30 @@@ public class StorageProxy implements St
  
      public static boolean shouldHint(InetAddress ep)
      {
-         if (!DatabaseDescriptor.hintedHandoffEnabled())
+         if (DatabaseDescriptor.hintedHandoffEnabled())
          {
-             HintsService.instance.metrics.incrPastWindow(ep);
-             return false;
-         }
- 
-         Set<String> disabledDCs = DatabaseDescriptor.hintedHandoffDisabledDCs();
-         if (!disabledDCs.isEmpty())
-         {
-             final String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(ep);
-             if (disabledDCs.contains(dc))
 -            if (DatabaseDescriptor.shouldHintByDC())
++            Set<String> disabledDCs = DatabaseDescriptor.hintedHandoffDisabledDCs();
++            if (!disabledDCs.isEmpty())
+             {
+                 final String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(ep);
 -                // Disable DC specific hints
 -                if (!DatabaseDescriptor.hintedHandoffEnabled(dc))
++                if (disabledDCs.contains(dc))
+                 {
++                    Tracing.trace("Not hinting {} since its data center {} has been disabled
{}", ep, dc, disabledDCs);
+                     return false;
+                 }
+             }
 -
+             boolean hintWindowExpired = Gossiper.instance.getEndpointDowntime(ep) > DatabaseDescriptor.getMaxHintWindow();
+             if (hintWindowExpired)
              {
-                 Tracing.trace("Not hinting {} since its data center {} has been disabled
{}", ep, dc, disabledDCs);
 -                HintedHandOffManager.instance.metrics.incrPastWindow(ep);
 -                Tracing.trace("Not hinting {} which has been down {}ms", ep, Gossiper.instance.getEndpointDowntime(ep));
 +                HintsService.instance.metrics.incrPastWindow(ep);
-                 return false;
++                Tracing.trace("Not hinting {} which has been down {} ms", ep, Gossiper.instance.getEndpointDowntime(ep));
              }
+             return !hintWindowExpired;
          }
- 
-         boolean hintWindowExpired = Gossiper.instance.getEndpointDowntime(ep) > DatabaseDescriptor.getMaxHintWindow();
-         if (hintWindowExpired)
+         else
          {
-             HintsService.instance.metrics.incrPastWindow(ep);
-             Tracing.trace("Not hinting {} which has been down {} ms", ep, Gossiper.instance.getEndpointDowntime(ep));
+             return false;
          }
-         return !hintWindowExpired;
      }
  
      /**


Mime
View raw message