org.apache.cassandra.db.compaction
Class ParallelCompactionIterable

java.lang.Object
  extended by org.apache.cassandra.db.compaction.AbstractCompactionIterable
      extended by org.apache.cassandra.db.compaction.ParallelCompactionIterable
All Implemented Interfaces:
java.lang.Iterable<AbstractCompactedRow>, CompactionInfo.Holder

public class ParallelCompactionIterable
extends AbstractCompactionIterable

A class to run compaction taking advantage of multiple-core processes: One Deserializer thread per input sstable performs read + deserialize (a row at a time). The resulting ColumnFamilies are added to a queue, which is fed to the merge Reducer. The merge Reducer creates MergeTasks on a thread-per-core Executor, and returns AsyncPrecompactedRow objects. The main complication is in handling larger-than-memory rows. When one is encountered, no further deserialization is done until that row is merged and written -- creating a pipeline stall, as it were. Thus, this is intended to be useful with mostly-in-memory row sizes, but preserves correctness in the face of occasional exceptions.


Field Summary
 
Fields inherited from class org.apache.cassandra.db.compaction.AbstractCompactionIterable
bytesRead, controller, throttle, totalBytes, type
 
Constructor Summary
  ParallelCompactionIterable(OperationType type, java.lang.Iterable<SSTableReader> sstables, CompactionController controller)
           
  ParallelCompactionIterable(OperationType type, java.lang.Iterable<SSTableReader> sstables, CompactionController controller, int maxInMemorySize)
           
protected ParallelCompactionIterable(OperationType type, java.util.List<SSTableScanner> scanners, CompactionController controller, int maxInMemorySize)
           
 
Method Summary
 CloseableIterator<AbstractCompactedRow> iterator()
           
 
Methods inherited from class org.apache.cassandra.db.compaction.AbstractCompactionIterable
getCompactionInfo, getScanners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelCompactionIterable

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

ParallelCompactionIterable

public ParallelCompactionIterable(OperationType type,
                                  java.lang.Iterable<SSTableReader> sstables,
                                  CompactionController controller,
                                  int maxInMemorySize)
                           throws java.io.IOException
Throws:
java.io.IOException

ParallelCompactionIterable

protected ParallelCompactionIterable(OperationType type,
                                     java.util.List<SSTableScanner> scanners,
                                     CompactionController controller,
                                     int maxInMemorySize)
Method Detail

iterator

public CloseableIterator<AbstractCompactedRow> iterator()
Specified by:
iterator in interface java.lang.Iterable<AbstractCompactedRow>
Specified by:
iterator in class AbstractCompactionIterable


Copyright © 2011 The Apache Software Foundation