cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1151693 - /cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java
Date Thu, 28 Jul 2011 00:54:35 GMT
Author: jbellis
Date: Thu Jul 28 00:54:34 2011
New Revision: 1151693

URL: http://svn.apache.org/viewvc?rev=1151693&view=rev
Log:
avoid introducing AbstractIterator when we already have a hasNext/next source

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java?rev=1151693&r1=1151692&r2=1151693&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/compaction/CompactionIterator.java Thu
Jul 28 00:54:34 2011
@@ -24,25 +24,21 @@ package org.apache.cassandra.db.compacti
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.List;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.AbstractIterator;
-
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.columniterator.IColumnIterator;
 import org.apache.cassandra.io.sstable.SSTableIdentityIterator;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.sstable.SSTableScanner;
 import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.CloseableIterator;
 import org.apache.cassandra.utils.MergeIterator;
 
-public class CompactionIterator extends AbstractIterator<AbstractCompactedRow>
+public class CompactionIterator
 implements CloseableIterator<AbstractCompactedRow>, CompactionInfo.Holder
 {
     private static Logger logger = LoggerFactory.getLogger(CompactionIterator.class);
@@ -99,13 +95,21 @@ implements CloseableIterator<AbstractCom
     }
 
 
-    public AbstractCompactedRow computeNext()
+    public boolean hasNext()
+    {
+        return source.hasNext();
+    }
+
+    public AbstractCompactedRow next()
     {
-        if (!source.hasNext())
-            return endOfData();
         return source.next();
     }
 
+    public void remove()
+    {
+        throw new UnsupportedOperationException();
+    }
+
     private void throttle()
     {
         if (DatabaseDescriptor.getCompactionThroughputMbPerSec() < 1 || StorageService.instance.isBootstrapMode())



Mime
View raw message