org.apache.cassandra.db.compaction

## Class LazilyCompactedRow

- java.lang.Object
- - org.apache.cassandra.db.compaction.AbstractCompactedRow
  - - org.apache.cassandra.db.compaction.LazilyCompactedRow

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class LazilyCompactedRow
      extends AbstractCompactedRow

  LazilyCompactedRow only computes the row bloom filter and column index in memory (at construction time); it does this by reading one column at a time from each of the rows being compacted, and merging them as it does so. So the most we have in memory at a time is the bloom filter, the index, and one column from each pre-compaction row.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `LazilyCompactedRow.Reducer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `closed`
    `protected ColumnStats` | `columnStats`
    `protected CompactionController` | `controller`
    `protected ColumnFamily` | `emptyColumnFamily`
    `protected ColumnIndex.Builder` | `indexBuilder`
    `protected SecondaryIndexManager.Updater` | `indexer`
    `protected DeletionTime` | `maxRowTombstone`
    `protected java.util.Iterator<OnDiskAtom>` | `merger`
    `protected com.google.common.base.Predicate<java.lang.Long>` | `purgeEvaluator`
    `protected LazilyCompactedRow.Reducer` | `reducer`
    `protected java.util.List<? extends OnDiskAtomIterator>` | `rows`

    - ### Fields inherited from class org.apache.cassandra.db.compaction.AbstractCompactedRow

      `key`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LazilyCompactedRow(CompactionController controller, java.util.List<? extends OnDiskAtomIterator> rows)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `ColumnStats` | `columnStats()`
    `void` | `update(java.security.MessageDigest digest)` update @param digest with the data bytes of the row (not including row key or row size).
    `RowIndexEntry` | `write(long currentPosition, SequentialWriter dataFile)` write the row (size + column index + filter + column data, but NOT row key) to @param out.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### rows

          protected final java.util.List<? extends OnDiskAtomIterator> rows

    - #### controller

          protected final CompactionController controller

    - #### purgeEvaluator

          protected com.google.common.base.Predicate<java.lang.Long> purgeEvaluator

    - #### emptyColumnFamily

          protected final ColumnFamily emptyColumnFamily

    - #### columnStats

          protected ColumnStats columnStats

    - #### closed

          protected boolean closed

    - #### indexBuilder

          protected ColumnIndex.Builder indexBuilder

    - #### indexer

          protected final SecondaryIndexManager.Updater indexer

    - #### reducer

          protected final LazilyCompactedRow.Reducer reducer

    - #### merger

          protected final java.util.Iterator<OnDiskAtom> merger

    - #### maxRowTombstone

          protected DeletionTime maxRowTombstone

  - ### Constructor Detail

    - #### LazilyCompactedRow

          public LazilyCompactedRow(CompactionController controller,
                                    java.util.List<? extends OnDiskAtomIterator> rows)

  - ### Method Detail

    - #### write

          public RowIndexEntry write(long currentPosition,
                                     SequentialWriter dataFile)
                              throws java.io.IOException

      Description copied from class: `AbstractCompactedRow`
      write the row (size + column index + filter + column data, but NOT row key) to @param out. write() may change internal state; it is NOT valid to call write() or update() a second time.
      Specified by:
        `write` in class `AbstractCompactedRow`
      Returns:
        index information for the written row, or null if the compaction resulted in only expired tombstones.
      Throws:
        `java.io.IOException`

    - #### update

          public void update(java.security.MessageDigest digest)

      Description copied from class: `AbstractCompactedRow`
      update @param digest with the data bytes of the row (not including row key or row size). May be called even if empty. update() may change internal state; it is NOT valid to call write() or update() a second time.
      Specified by:
        `update` in class `AbstractCompactedRow`

    - #### columnStats

          public ColumnStats columnStats()

      Specified by:
        `columnStats` in class `AbstractCompactedRow`
      Returns:
        aggregate information about the columns in this row. Some fields may contain default values if computing them value would require extra effort we're not willing to make.

    - #### close

          public void close()

Copyright © 2018 The Apache Software Foundation