You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2014/02/06 22:07:53 UTC

[1/3] git commit: Failure detector correctly converts initial value to nanos Patch by brandonwilliams reviewed by jbellis for CASSANDRA-6658

Updated Branches:
  refs/heads/cassandra-2.0 5f64af63a -> ce9c8c2cd
  refs/heads/trunk d5c5734c8 -> ff2a92c13


Failure detector correctly converts initial value to nanos
Patch by brandonwilliams reviewed by jbellis for CASSANDRA-6658


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

Branch: refs/heads/cassandra-2.0
Commit: ce9c8c2cde6e336e8bb8aa74b5d2c9241a0e606e
Parents: 5f64af6
Author: Brandon Williams <br...@apache.org>
Authored: Thu Feb 6 15:05:29 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Thu Feb 6 15:05:29 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/gms/FailureDetector.java  | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ce9c8c2c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e3c2c2..85c6533 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.6
+ * Failure detector correctly converts initial value to nanos (CASSANDRA-6658)
  * Add nodetool taketoken to relocate vnodes (CASSANDRA-4445)
  * Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
  * Improve nodetool cfhistograms formatting (CASSANDRA-6360)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ce9c8c2c/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index a7eb82f..36776bc 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -23,6 +23,7 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
@@ -45,7 +46,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
 {
     public static final String MBEAN_NAME = "org.apache.cassandra.net:type=FailureDetector";
     private static final int SAMPLE_SIZE = 1000;
-    protected static final int INITIAL_VALUE = getInitialValue();
+    protected static final long INITIAL_VALUE_NANOS = TimeUnit.NANOSECONDS.convert(getInitialValue(), TimeUnit.MILLISECONDS);
 
     public static final IFailureDetector instance = new FailureDetector();
     private static final Logger logger = LoggerFactory.getLogger(FailureDetector.class);
@@ -73,7 +74,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
         }
     }
 
-    private static int getInitialValue()
+    private static long getInitialValue()
     {
         String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
         if (newvalue != null)
@@ -296,29 +297,27 @@ class ArrivalWindow
     // change.
     private final double PHI_FACTOR = 1.0 / Math.log(10.0);
 
-    private static final long MILLI_TO_NANO = 1000000L;
-
     // in the event of a long partition, never record an interval longer than the rpc timeout,
     // since if a host is regularly experiencing connectivity problems lasting this long we'd
     // rather mark it down quickly instead of adapting
     // this value defaults to the same initial value the FD is seeded with
-    private final long MAX_INTERVAL_IN_NANO = getMaxInterval() * MILLI_TO_NANO;
+    private final long MAX_INTERVAL_IN_NANO = getMaxInterval();
 
     ArrivalWindow(int size)
     {
         arrivalIntervals = new BoundedStatsDeque(size);
     }
 
-    private static int getMaxInterval()
+    private static long getMaxInterval()
     {
         String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
         if (newvalue != null)
         {
             logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
-            return Integer.parseInt(newvalue);
+            return TimeUnit.NANOSECONDS.convert(Integer.parseInt(newvalue), TimeUnit.MILLISECONDS);
         }
         else
-            return FailureDetector.INITIAL_VALUE;
+            return FailureDetector.INITIAL_VALUE_NANOS;
     }
 
     synchronized void add(long value)
@@ -337,7 +336,7 @@ class ArrivalWindow
             // We use a very large initial interval since the "right" average depends on the cluster size
             // and it's better to err high (false negatives, which will be corrected by waiting a bit longer)
             // than low (false positives, which cause "flapping").
-            arrivalIntervals.add(FailureDetector.INITIAL_VALUE);
+            arrivalIntervals.add(FailureDetector.INITIAL_VALUE_NANOS);
         }
         tLast = value;
     }


[2/3] git commit: Failure detector correctly converts initial value to nanos Patch by brandonwilliams reviewed by jbellis for CASSANDRA-6658

Posted by br...@apache.org.
Failure detector correctly converts initial value to nanos
Patch by brandonwilliams reviewed by jbellis for CASSANDRA-6658


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

Branch: refs/heads/trunk
Commit: ce9c8c2cde6e336e8bb8aa74b5d2c9241a0e606e
Parents: 5f64af6
Author: Brandon Williams <br...@apache.org>
Authored: Thu Feb 6 15:05:29 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Thu Feb 6 15:05:29 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/gms/FailureDetector.java  | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ce9c8c2c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e3c2c2..85c6533 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.6
+ * Failure detector correctly converts initial value to nanos (CASSANDRA-6658)
  * Add nodetool taketoken to relocate vnodes (CASSANDRA-4445)
  * Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
  * Improve nodetool cfhistograms formatting (CASSANDRA-6360)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ce9c8c2c/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index a7eb82f..36776bc 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -23,6 +23,7 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
@@ -45,7 +46,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
 {
     public static final String MBEAN_NAME = "org.apache.cassandra.net:type=FailureDetector";
     private static final int SAMPLE_SIZE = 1000;
-    protected static final int INITIAL_VALUE = getInitialValue();
+    protected static final long INITIAL_VALUE_NANOS = TimeUnit.NANOSECONDS.convert(getInitialValue(), TimeUnit.MILLISECONDS);
 
     public static final IFailureDetector instance = new FailureDetector();
     private static final Logger logger = LoggerFactory.getLogger(FailureDetector.class);
@@ -73,7 +74,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
         }
     }
 
-    private static int getInitialValue()
+    private static long getInitialValue()
     {
         String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
         if (newvalue != null)
@@ -296,29 +297,27 @@ class ArrivalWindow
     // change.
     private final double PHI_FACTOR = 1.0 / Math.log(10.0);
 
-    private static final long MILLI_TO_NANO = 1000000L;
-
     // in the event of a long partition, never record an interval longer than the rpc timeout,
     // since if a host is regularly experiencing connectivity problems lasting this long we'd
     // rather mark it down quickly instead of adapting
     // this value defaults to the same initial value the FD is seeded with
-    private final long MAX_INTERVAL_IN_NANO = getMaxInterval() * MILLI_TO_NANO;
+    private final long MAX_INTERVAL_IN_NANO = getMaxInterval();
 
     ArrivalWindow(int size)
     {
         arrivalIntervals = new BoundedStatsDeque(size);
     }
 
-    private static int getMaxInterval()
+    private static long getMaxInterval()
     {
         String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
         if (newvalue != null)
         {
             logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
-            return Integer.parseInt(newvalue);
+            return TimeUnit.NANOSECONDS.convert(Integer.parseInt(newvalue), TimeUnit.MILLISECONDS);
         }
         else
-            return FailureDetector.INITIAL_VALUE;
+            return FailureDetector.INITIAL_VALUE_NANOS;
     }
 
     synchronized void add(long value)
@@ -337,7 +336,7 @@ class ArrivalWindow
             // We use a very large initial interval since the "right" average depends on the cluster size
             // and it's better to err high (false negatives, which will be corrected by waiting a bit longer)
             // than low (false positives, which cause "flapping").
-            arrivalIntervals.add(FailureDetector.INITIAL_VALUE);
+            arrivalIntervals.add(FailureDetector.INITIAL_VALUE_NANOS);
         }
         tLast = value;
     }


[3/3] git commit: Merge branch 'cassandra-2.0' into trunk

Posted by br...@apache.org.
Merge branch 'cassandra-2.0' into trunk


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

Branch: refs/heads/trunk
Commit: ff2a92c13c822e3220fe980323590bb4032f32bc
Parents: d5c5734 ce9c8c2
Author: Brandon Williams <br...@apache.org>
Authored: Thu Feb 6 15:05:54 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Thu Feb 6 15:05:54 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/gms/FailureDetector.java  | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ff2a92c1/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 86e576c,85c6533..098d8ad
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,36 -1,8 +1,37 @@@
 +2.1
 + * add listsnapshots command to nodetool (CASSANDRA-5742)
 + * Introduce AtomicBTreeColumns (CASSANDRA-6271)
 + * Multithreaded commitlog (CASSANDRA-3578)
 + * allocate fixed index summary memory pool and resample cold index summaries 
 +   to use less memory (CASSANDRA-5519)
 + * Removed multithreaded compaction (CASSANDRA-6142)
 + * Parallelize fetching rows for low-cardinality indexes (CASSANDRA-1337)
 + * change logging from log4j to logback (CASSANDRA-5883)
 + * switch to LZ4 compression for internode communication (CASSANDRA-5887)
 + * Stop using Thrift-generated Index* classes internally (CASSANDRA-5971)
 + * Remove 1.2 network compatibility code (CASSANDRA-5960)
 + * Remove leveled json manifest migration code (CASSANDRA-5996)
 + * Remove CFDefinition (CASSANDRA-6253)
 + * Use AtomicIntegerFieldUpdater in RefCountedMemory (CASSANDRA-6278)
 + * User-defined types for CQL3 (CASSANDRA-5590)
 + * Use of o.a.c.metrics in nodetool (CASSANDRA-5871, 6406)
 + * Batch read from OTC's queue and cleanup (CASSANDRA-1632)
 + * Secondary index support for collections (CASSANDRA-4511, 6383)
 + * SSTable metadata(Stats.db) format change (CASSANDRA-6356)
 + * Push composites support in the storage engine
 +   (CASSANDRA-5417, CASSANDRA-6520)
 + * Add snapshot space used to cfstats (CASSANDRA-6231)
 + * Add cardinality estimator for key count estimation (CASSANDRA-5906)
 + * CF id is changed to be non-deterministic. Data dir/key cache are created
 +   uniquely for CF id (CASSANDRA-5202)
 + * New counters implementation (CASSANDRA-6504)
 + * Replace UnsortedColumns usage with ArrayBackedSortedColumns (CASSANDRA-6630)
 + * Add option to use row cache with a given amount of rows (CASSANDRA-5357)
 +
  2.0.6
+  * Failure detector correctly converts initial value to nanos (CASSANDRA-6658)
   * Add nodetool taketoken to relocate vnodes (CASSANDRA-4445)
   * Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
 - * Improve nodetool cfhistograms formatting (CASSANDRA-6360)
   * Expose bulk loading progress over JMX (CASSANDRA-4757)
   * Correctly handle null with IF conditions and TTL (CASSANDRA-6623)
   * Account for range/row tombstones in tombstone drop

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ff2a92c1/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------