org.apache.cassandra.db.compaction
Class CompactionIterator

java.lang.Object
  extended by com.google.common.collect.UnmodifiableIterator<T>
      extended by com.google.common.collect.AbstractIterator<T2>
          extended by org.apache.cassandra.utils.ReducingIterator<SSTableIdentityIterator,AbstractCompactedRow>
              extended by org.apache.cassandra.db.compaction.CompactionIterator
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<AbstractCompactedRow>, java.util.Iterator<AbstractCompactedRow>, CompactionInfo.Holder

public class CompactionIterator
extends ReducingIterator<SSTableIdentityIterator,AbstractCompactedRow>
implements java.io.Closeable, CompactionInfo.Holder


Field Summary
protected  CompactionController controller
           
static int FILE_BUFFER_SIZE
           
protected  java.util.List<SSTableIdentityIterator> rows
           
protected  CompactionType type
           
 
Fields inherited from class org.apache.cassandra.utils.ReducingIterator
last, source
 
Constructor Summary
  CompactionIterator(CompactionType type, java.lang.Iterable<SSTableReader> sstables, CompactionController controller)
           
protected CompactionIterator(CompactionType type, java.util.Iterator iter, CompactionController controller)
           
 
Method Summary
 void close()
           
protected static org.apache.commons.collections.iterators.CollatingIterator getCollatingIterator(java.lang.Iterable<SSTableReader> sstables)
           
 CompactionInfo getCompactionInfo()
           
protected  AbstractCompactedRow getReduced()
          return the last object computed by reduce
protected  java.lang.Iterable<SSTableScanner> getScanners()
           
protected  boolean isEqual(SSTableIdentityIterator o1, SSTableIdentityIterator o2)
          override this if the keys you want to base the reduce on are not the same as the object itself (but can be generated from it)
 void reduce(SSTableIdentityIterator current)
          combine this object with the previous ones.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.cassandra.utils.ReducingIterator
computeNext, iterator, onKeyChange
 
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
 
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Field Detail

FILE_BUFFER_SIZE

public static final int FILE_BUFFER_SIZE
See Also:
Constant Field Values

rows

protected final java.util.List<SSTableIdentityIterator> rows

type

protected final CompactionType type

controller

protected final CompactionController controller
Constructor Detail

CompactionIterator

public CompactionIterator(CompactionType type,
                          java.lang.Iterable<SSTableReader> sstables,
                          CompactionController controller)
                   throws java.io.IOException
Throws:
java.io.IOException

CompactionIterator

protected CompactionIterator(CompactionType type,
                             java.util.Iterator iter,
                             CompactionController controller)
Method Detail

getCollatingIterator

protected static org.apache.commons.collections.iterators.CollatingIterator getCollatingIterator(java.lang.Iterable<SSTableReader> sstables)
                                                                                          throws java.io.IOException
Throws:
java.io.IOException

getCompactionInfo

public CompactionInfo getCompactionInfo()
Specified by:
getCompactionInfo in interface CompactionInfo.Holder

isEqual

protected boolean isEqual(SSTableIdentityIterator o1,
                          SSTableIdentityIterator o2)
Description copied from class: ReducingIterator
override this if the keys you want to base the reduce on are not the same as the object itself (but can be generated from it)

Overrides:
isEqual in class ReducingIterator<SSTableIdentityIterator,AbstractCompactedRow>

reduce

public void reduce(SSTableIdentityIterator current)
Description copied from class: ReducingIterator
combine this object with the previous ones. intermediate state is up to your implementation.

Specified by:
reduce in class ReducingIterator<SSTableIdentityIterator,AbstractCompactedRow>

getReduced

protected AbstractCompactedRow getReduced()
Description copied from class: ReducingIterator
return the last object computed by reduce

Specified by:
getReduced in class ReducingIterator<SSTableIdentityIterator,AbstractCompactedRow>

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

getScanners

protected java.lang.Iterable<SSTableScanner> getScanners()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 The Apache Software Foundation