Search in sources :

Example 1 with AbstractUnfilteredRowIterator

use of org.apache.cassandra.db.rows.AbstractUnfilteredRowIterator in project cassandra by apache.

the class AbstractReadResponseTest method iter.

public UnfilteredPartitionIterator iter(DecoratedKey key, Unfiltered... unfiltereds) {
    SortedSet<Unfiltered> s = new TreeSet<>(cfm.comparator);
    Collections.addAll(s, unfiltereds);
    final Iterator<Unfiltered> iterator = s.iterator();
    UnfilteredRowIterator rowIter = new AbstractUnfilteredRowIterator(cfm, key, DeletionTime.LIVE, cfm.regularAndStaticColumns(), Rows.EMPTY_STATIC_ROW, false, EncodingStats.NO_STATS) {

        protected Unfiltered computeNext() {
            return iterator.hasNext() ? iterator.next() : endOfData();
        }
    };
    return new SingletonUnfilteredPartitionIterator(rowIter);
}
Also used : AbstractUnfilteredRowIterator(org.apache.cassandra.db.rows.AbstractUnfilteredRowIterator) UnfilteredRowIterator(org.apache.cassandra.db.rows.UnfilteredRowIterator) TreeSet(java.util.TreeSet) AbstractUnfilteredRowIterator(org.apache.cassandra.db.rows.AbstractUnfilteredRowIterator) SingletonUnfilteredPartitionIterator(org.apache.cassandra.db.partitions.SingletonUnfilteredPartitionIterator) Unfiltered(org.apache.cassandra.db.rows.Unfiltered)

Aggregations

TreeSet (java.util.TreeSet)1 SingletonUnfilteredPartitionIterator (org.apache.cassandra.db.partitions.SingletonUnfilteredPartitionIterator)1 AbstractUnfilteredRowIterator (org.apache.cassandra.db.rows.AbstractUnfilteredRowIterator)1 Unfiltered (org.apache.cassandra.db.rows.Unfiltered)1 UnfilteredRowIterator (org.apache.cassandra.db.rows.UnfilteredRowIterator)1