cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1136679 - in /cassandra/trunk: build.xml src/java/org/apache/cassandra/db/compaction/CompactionManager.java src/java/org/apache/cassandra/db/compaction/CompactionTask.java src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
Date Thu, 16 Jun 2011 21:03:16 GMT
Author: jbellis
Date: Thu Jun 16 21:03:15 2011
New Revision: 1136679

URL: http://svn.apache.org/viewvc?rev=1136679&view=rev
Log:
r/m last references to commons-collections
patch by stuhood; reviewed by jbellis for CASSANDRA-2784

Modified:
    cassandra/trunk/build.xml
    cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java

Modified: cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/build.xml?rev=1136679&r1=1136678&r2=1136679&view=diff
==============================================================================
--- cassandra/trunk/build.xml (original)
+++ cassandra/trunk/build.xml Thu Jun 16 21:03:15 2011
@@ -350,7 +350,6 @@ url=${svn.entry.url}?pathrev=${svn.entry
           <dependency groupId="com.google.guava" artifactId="guava" version="r08"/>
           <dependency groupId="commons-cli" artifactId="commons-cli" version="1.1"/>
           <dependency groupId="commons-codec" artifactId="commons-codec" version="1.2"/>
-          <dependency groupId="commons-collections" artifactId="commons-collections" version="3.2.1"/>
           <dependency groupId="commons-lang" artifactId="commons-lang" version="2.4"/>
           <dependency groupId="com.googlecode.concurrentlinkedhashmap" artifactId="concurrentlinkedhashmap-lru"
version="1.2"/>
           <dependency groupId="org.antlr" artifactId="antlr" version="3.2"/>
@@ -461,7 +460,6 @@ url=${svn.entry.url}?pathrev=${svn.entry
         <dependency groupId="com.google.guava" artifactId="guava"/>
         <dependency groupId="commons-cli" artifactId="commons-cli"/>
         <dependency groupId="commons-codec" artifactId="commons-codec"/>
-        <dependency groupId="commons-collections" artifactId="commons-collections"/>
         <dependency groupId="commons-lang" artifactId="commons-lang"/>
         <dependency groupId="com.googlecode.concurrentlinkedhashmap" artifactId="concurrentlinkedhashmap-lru"/>
         <dependency groupId="org.antlr" artifactId="antlr"/>

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java?rev=1136679&r1=1136678&r2=1136679&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionManager.java Thu
Jun 16 21:03:15 2011
@@ -30,8 +30,8 @@ import java.util.concurrent.locks.Reentr
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import org.apache.commons.collections.PredicateUtils;
-import org.apache.commons.collections.iterators.FilterIterator;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterators;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -773,7 +773,7 @@ public class CompactionManager implement
         executor.beginCompaction(ci);
         try
         {
-            Iterator<AbstractCompactedRow> nni = new FilterIterator(ci, PredicateUtils.notNullPredicate());
+            Iterator<AbstractCompactedRow> nni = Iterators.filter(ci, Predicates.notNull());
 
             // validate the CF as we iterate over it
             validator.prepare(cfs);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionTask.java?rev=1136679&r1=1136678&r2=1136679&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionTask.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionTask.java Thu Jun
16 21:03:15 2011
@@ -28,10 +28,10 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterators;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.commons.collections.PredicateUtils;
-import org.apache.commons.collections.iterators.FilterIterator;
 import org.apache.commons.lang.StringUtils;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
@@ -126,7 +126,7 @@ public class CompactionTask extends Abst
 
         SSTableWriter writer;
         CompactionIterator ci = new CompactionIterator(type, sstables, controller); // retain
a handle so we can call close()
-        Iterator<AbstractCompactedRow> nni = new FilterIterator(ci, PredicateUtils.notNullPredicate());
+        Iterator<AbstractCompactedRow> nni = Iterators.filter(ci, Predicates.notNull());
         Map<DecoratedKey, Long> cachedKeys = new HashMap<DecoratedKey, Long>();
 
         if (collector != null)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java?rev=1136679&r1=1136678&r2=1136679&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java Thu Jun
16 21:03:15 2011
@@ -27,8 +27,8 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.collections.IteratorUtils;
-import org.apache.commons.collections.iterators.ReverseListIterator;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,7 +80,7 @@ public class SliceQueryFilter implements
         if (reversed)
         {
             List<IColumn> columnsAsList = new ArrayList<IColumn>(superColumn.getSubColumns());
-            subcolumns = new ReverseListIterator(columnsAsList);
+            subcolumns = Lists.reverse(columnsAsList).iterator();
         }
         else
         {
@@ -94,7 +94,7 @@ public class SliceQueryFilter implements
             IColumn column = subcolumns.next();
             if (comparator.compare(column.name(), start) >= 0)
             {
-                subcolumns = IteratorUtils.chainedIterator(IteratorUtils.singletonIterator(column),
subcolumns);
+                subcolumns = Iterators.concat(Iterators.singletonIterator(column), subcolumns);
                 break;
             }
         }



Mime
View raw message