Class UnfilteredRowIterators


  • public abstract class UnfilteredRowIterators
    extends java.lang.Object
    Static methods to work with atom iterators.
    • Method Detail

      • filter

        public static RowIterator filter​(UnfilteredRowIterator iter,
                                         int nowInSec)
        Returns a iterator that only returns rows with only live content. This is mainly used in the CQL layer when we know we don't care about deletion infos (and since an UnfilteredRowIterator cannot shadow it's own data, we know everyting returned isn't shadowed by a tombstone).
      • digest

        public static void digest​(UnfilteredRowIterator iterator,
                                  Digest digest,
                                  int version)
        Digests the partition represented by the provided iterator.
        Parameters:
        iterator - the iterator to digest.
        digest - the Digest to use.
        version - the messaging protocol to use when producing the digest.
      • withOnlyQueriedData

        public static UnfilteredRowIterator withOnlyQueriedData​(UnfilteredRowIterator iterator,
                                                                ColumnFilter filter)
        Filter the provided iterator to exclude cells that have been fetched but are not queried by the user (see ColumnFilter for detailes).
        Parameters:
        iterator - the iterator to filter.
        filter - the ColumnFilter to use when deciding which columns are the one queried by the user. This should be the filter that was used when querying iterator.
        Returns:
        the filtered iterator..
      • concat

        public static UnfilteredRowIterator concat​(UnfilteredRowIterator iter1,
                                                   UnfilteredRowIterator iter2)
        Returns an iterator that concatenate two atom iterators. This method assumes that both iterator are from the same partition and that the atom from iter2 come after the ones of iter1 (that is, that concatenating the iterator make sense).
      • withValidation

        public static UnfilteredRowIterator withValidation​(UnfilteredRowIterator iterator,
                                                           java.lang.String filename)
        Validate that the data of the provided iterator is valid, that is that the values it contains are valid for the type they represent, and more generally that the infos stored are sensible. This is mainly used by scrubber to detect problems in sstables.
        Parameters:
        iterator - the partition to check.
        filename - the name of the file the data is comming from.
        Returns:
        an iterator that returns the same data than iterator but that checks said data and throws a CorruptedSSTableException if it detects invalid data.
      • loggingIterator

        public static UnfilteredRowIterator loggingIterator​(UnfilteredRowIterator iterator,
                                                            java.lang.String id,
                                                            boolean fullDetails)
        Wraps the provided iterator so it logs the returned atoms for debugging purposes.

        Note that this is only meant for debugging as this can log a very large amount of logging at INFO.