org.apache.cassandra.db.compaction

## Class AbstractCompactedRow

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

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
  Direct Known Subclasses:
    LazilyCompactedRow, PrecompactedRow

      public abstract class AbstractCompactedRow
      extends java.lang.Object
      implements java.io.Closeable

  a CompactedRow is an object that takes a bunch of rows (keys + columnfamilies) and can write a compacted version of those rows to an output stream. It does NOT necessarily require creating a merged CF object in memory.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `DecoratedKey` | `key`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractCompactedRow(DecoratedKey key)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ColumnStats` | `columnStats()`
    `abstract DeletionInfo` | `deletionInfo()`
    `abstract ColumnIndex` | `index()`
    `abstract boolean` | `isEmpty()`
    `abstract void` | `update(java.security.MessageDigest digest)` update @param digest with the data bytes of the row (not including row key or row size).
    `abstract long` | `write(java.io.DataOutput out)` 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`

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Field Detail

    - #### key

          public final DecoratedKey key

  - ### Constructor Detail

    - #### AbstractCompactedRow

          public AbstractCompactedRow(DecoratedKey key)

  - ### Method Detail

    - #### write

          public abstract long write(java.io.DataOutput out)
                              throws java.io.IOException

      write the row (size + column index + filter + column data, but NOT row key) to @param out. It is an error to call this if isEmpty is false. (Because the key is appended first, so we'd have an incomplete row written.) write() may change internal state; it is NOT valid to call write() or update() a second time.
      Throws:
        `java.io.IOException`

    - #### update

          public abstract void update(java.security.MessageDigest digest)

      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.

    - #### isEmpty

          public abstract boolean isEmpty()

      Returns:
        true if there are no columns in the row AND there are no row-level tombstones to be preserved

    - #### columnStats

          public abstract ColumnStats columnStats()

      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.

    - #### deletionInfo

          public abstract DeletionInfo deletionInfo()

      Returns:
        the compacted row deletion infos.

    - #### index

          public abstract ColumnIndex index()

      Returns:
        the column index for this row.

Copyright © 2014 The Apache Software Foundation