aweisberg commented on code in PR #3299: URL: https://github.com/apache/cassandra/pull/3299#discussion_r1972005710
########## src/java/org/apache/cassandra/db/lifecycle/SSTableIntervalTree.java: ########## @@ -40,21 +39,49 @@ public class SSTableIntervalTree extends IntervalTree<PartitionPosition, SSTable super(intervals); } + private SSTableIntervalTree(Interval<PartitionPosition, SSTableReader>[] minOrder, Interval<PartitionPosition, SSTableReader>[] maxOrder) + { + super(minOrder, maxOrder); + } + + @Override + protected SSTableIntervalTree create(Interval<PartitionPosition, SSTableReader>[] minOrder, Interval<PartitionPosition, SSTableReader>[] maxOrder) + { + return new SSTableIntervalTree(minOrder, maxOrder); + } + public static SSTableIntervalTree empty() { return EMPTY; } - public static SSTableIntervalTree build(Iterable<SSTableReader> sstables) + public static SSTableIntervalTree buildSSTableIntervalTree(Collection<SSTableReader> sstables) { + if (sstables.isEmpty()) + return EMPTY; return new SSTableIntervalTree(buildIntervals(sstables)); } - public static List<Interval<PartitionPosition, SSTableReader>> buildIntervals(Iterable<SSTableReader> sstables) + public static List<Interval<PartitionPosition, SSTableReader>> buildIntervals(Collection<SSTableReader> sstables) { - List<Interval<PartitionPosition, SSTableReader>> intervals = new ArrayList<>(Iterables.size(sstables)); + if (sstables == null || sstables.isEmpty()) + return Collections.emptyList(); + return Arrays.asList(buildIntervalsArray(sstables)); + } + + public static Interval<PartitionPosition, SSTableReader>[] buildIntervalsArray(Collection<SSTableReader> sstables) + { + if (sstables == null || !sstables.isEmpty()) Review Comment: Yes everything was failing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org