## org.apache.cassandra.db.compaction
Class ParallelCompactionIterable

    java.lang.Object
      org.apache.cassandra.db.compaction.CompactionInfo.Holder
          org.apache.cassandra.db.compaction.AbstractCompactionIterable
              org.apache.cassandra.db.compaction.ParallelCompactionIterable

All Implemented Interfaces:
  java.lang.Iterable<AbstractCompactedRow>

    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, scanners, totalBytes, type`

Constructor Summary
`ParallelCompactionIterable(OperationType type, java.util.List<ICompactionScanner> scanners, CompactionController controller)`
`ParallelCompactionIterable(OperationType type, java.util.List<ICompactionScanner> scanners, CompactionController controller, int maxInMemorySize)`

Method Summary
`CloseableIterator<AbstractCompactedRow>` `iterator()`

Methods inherited from class org.apache.cassandra.db.compaction.AbstractCompactionIterable
`getCompactionInfo`

Methods inherited from class org.apache.cassandra.db.compaction.CompactionInfo.Holder
`isStopRequested, stop`

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.util.List<ICompactionScanner> scanners,
                                      CompactionController controller)
                               throws java.io.IOException

Throws:
  `java.io.IOException`

### ParallelCompactionIterable

    public ParallelCompactionIterable(OperationType type,
                                      java.util.List<ICompactionScanner> 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 © 2013 The Apache Software Foundation