Author: jbellis Date: Thu Oct 27 18:25:43 2011 New Revision: 1189921 URL: http://svn.apache.org/viewvc?rev=1189921&view=rev Log: add debug logging to IntervalTree creation; see CASSANDRA-3407
Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java?rev=1189921&r1=1189920&r2=1189921&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/Interval.java Thu Oct 27 18:25:43 2011 @@ -25,11 +25,10 @@ import com.google.common.collect.Orderin public class Interval<T> { - public Comparable min; - public Comparable max; + public final Comparable min; + public final Comparable max; public final T Data; - public Interval(Comparable min, Comparable max) { this.min = min; @@ -62,22 +61,24 @@ public class Interval<T> } - public static Ordering<Interval> minOrdering = new Ordering<Interval>() + public static final Ordering<Interval> minOrdering = new Ordering<Interval>() { - @Override public int compare(Interval interval, Interval interval1) { return interval.min.compareTo(interval1.min); } }; - public static Ordering<Interval> maxOrdering = new Ordering<Interval>() + public static final Ordering<Interval> maxOrdering = new Ordering<Interval>() { - @Override public int compare(Interval interval, Interval interval1) { return interval.max.compareTo(interval1.max); } }; + public String toString() + { + return String.format("Interval(%s, %s)", min, max); + } } Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java?rev=1189921&r1=1189920&r2=1189921&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java Thu Oct 27 18:25:43 2011 @@ -24,10 +24,14 @@ package org.apache.cassandra.utils.Inter import java.util.ArrayList; import java.util.Collections; import java.util.List; -import com.google.common.collect.ImmutableList; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class IntervalNode { + private static final Logger logger = LoggerFactory.getLogger(IntervalNode.class); + Comparable v_pt; Comparable v_min; Comparable v_max; @@ -38,6 +42,8 @@ public class IntervalNode public IntervalNode(List<Interval> toBisect) { + logger.debug("Creating IntervalNode from {}", toBisect); + if (toBisect.size() > 0) { findMinMedianMax(toBisect);