org.apache.cassandra.db.columniterator

## Class SSTableSliceIterator

- java.lang.Object
- - org.apache.cassandra.db.columniterator.SSTableSliceIterator

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<OnDiskAtom>, OnDiskAtomIterator, CloseableIterator<OnDiskAtom>

      public class SSTableSliceIterator
      extends java.lang.Object
      implements OnDiskAtomIterator

  A Cell Iterator over SSTable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSTableSliceIterator(SSTableReader sstable, DecoratedKey key, ColumnSlice[] slices, boolean reversed)`
    `SSTableSliceIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, ColumnSlice[] slices, boolean reversed, RowIndexEntry indexEntry)` An iterator for a slice within an SSTable

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` clean up any open resources
    `ColumnFamily` | `getColumnFamily()`
    `DecoratedKey` | `getKey()`
    `boolean` | `hasNext()`
    `OnDiskAtom` | `next()`
    `void` | `remove()`

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

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

- - ### Constructor Detail

    - #### SSTableSliceIterator

          public SSTableSliceIterator(SSTableReader sstable,
                              DecoratedKey key,
                              ColumnSlice[] slices,
                              boolean reversed)

    - #### SSTableSliceIterator

          public SSTableSliceIterator(SSTableReader sstable,
                              FileDataInput file,
                              DecoratedKey key,
                              ColumnSlice[] slices,
                              boolean reversed,
                              RowIndexEntry indexEntry)

      An iterator for a slice within an SSTable
      Parameters:
        `sstable` - Keyspace for the CFS we are reading from
        `file` - Optional parameter that input is read from. If null is passed, this class creates an appropriate one automatically. If this class creates, it will close the underlying file when #close() is called. If a caller passes a non-null argument, this class will NOT close the underlying file when the iterator is closed (i.e. the caller is responsible for closing the file) In all cases the caller should explicitly #close() this iterator.
        `key` - The key the requested slice resides under
        `slices` - the column slices
        `reversed` - Results are returned in reverse order iff reversed is true.
        `indexEntry` - position of the row

  - ### Method Detail

    - #### getKey

          public DecoratedKey getKey()

      Specified by:
        `getKey` in interface `OnDiskAtomIterator`
      Returns:
        the current row key

    - #### getColumnFamily

          public ColumnFamily getColumnFamily()

      Specified by:
        `getColumnFamily` in interface `OnDiskAtomIterator`
      Returns:
        A ColumnFamily holding metadata for the row being iterated. Do not modify this CF. Whether it is empty or not is implementation-dependent.

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `java.util.Iterator<OnDiskAtom>`

    - #### next

          public OnDiskAtom next()

      Specified by:
        `next` in interface `java.util.Iterator<OnDiskAtom>`

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `java.util.Iterator<OnDiskAtom>`

    - #### close

          public void close()
                     throws java.io.IOException

      Description copied from interface: `OnDiskAtomIterator`
      clean up any open resources
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `OnDiskAtomIterator`
      Throws:
        `java.io.IOException`

Copyright © 2014 The Apache Software Foundation