org.apache.cassandra.db.compaction
Class ParallelCompactionIterable
java.lang.Object
org.apache.cassandra.db.compaction.AbstractCompactionIterable
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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