me.prettyprint.cassandra.service
Class ColumnSliceIterator<K,N,V>

java.lang.Object
  extended by me.prettyprint.cassandra.service.ColumnSliceIterator<K,N,V>
All Implemented Interfaces:
Iterator<HColumn<N,V>>

public class ColumnSliceIterator<K,N,V>
extends Object
implements Iterator<HColumn<N,V>>

Iterates over the column slice, refreshing until all qualifing columns are retrieved. If column deletion can occur synchronously with calls to hasNext(), the column name object type must override Object.equals().

Author:
thrykol

Nested Class Summary
static interface ColumnSliceIterator.ColumnSliceFinish<N>
          When iterating over a ColumnSlice, it may be desirable to move the finish point for each query.
 
Constructor Summary
ColumnSliceIterator(SliceQuery<K,N,V> query, N start, ColumnSliceIterator.ColumnSliceFinish<N> finish, boolean reversed)
          Constructor
ColumnSliceIterator(SliceQuery<K,N,V> query, N start, ColumnSliceIterator.ColumnSliceFinish<N> finish, boolean reversed, int count)
          Constructor
ColumnSliceIterator(SliceQuery<K,N,V> query, N start, N finish, boolean reversed)
          Constructor
ColumnSliceIterator(SliceQuery<K,N,V> query, N start, N finish, boolean reversed, int count)
          Constructor
 
Method Summary
 boolean hasNext()
           
 HColumn<N,V> next()
           
 void remove()
           
 ColumnSliceIterator setFilter(SliceFilter<HColumn<N,V>> filter)
          Set a filter to determine which columns will be returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnSliceIterator

public ColumnSliceIterator(SliceQuery<K,N,V> query,
                           N start,
                           N finish,
                           boolean reversed)
Constructor

Parameters:
query - Base SliceQuery to execute
start - Starting point of the range
finish - Finish point of the range.
reversed - Whether or not the columns should be reversed

ColumnSliceIterator

public ColumnSliceIterator(SliceQuery<K,N,V> query,
                           N start,
                           N finish,
                           boolean reversed,
                           int count)
Constructor

Parameters:
query - Base SliceQuery to execute
start - Starting point of the range
finish - Finish point of the range.
reversed - Whether or not the columns should be reversed
count - the amount of columns to retrieve per batch

ColumnSliceIterator

public ColumnSliceIterator(SliceQuery<K,N,V> query,
                           N start,
                           ColumnSliceIterator.ColumnSliceFinish<N> finish,
                           boolean reversed)
Constructor

Parameters:
query - Base SliceQuery to execute
start - Starting point of the range
finish - Finish point of the range. Allows for a dynamically determined point
reversed - Whether or not the columns should be reversed

ColumnSliceIterator

public ColumnSliceIterator(SliceQuery<K,N,V> query,
                           N start,
                           ColumnSliceIterator.ColumnSliceFinish<N> finish,
                           boolean reversed,
                           int count)
Constructor

Parameters:
query - Base SliceQuery to execute
start - Starting point of the range
finish - Finish point of the range. Allows for a dynamically determined point
reversed - Whether or not the columns should be reversed
count - the amount of columns to retrieve per batch
Method Detail

setFilter

public ColumnSliceIterator setFilter(SliceFilter<HColumn<N,V>> filter)
Set a filter to determine which columns will be returned.

Parameters:
filter - Filter to determine which columns will be returned
Returns:
<this>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<HColumn<N,V>>

next

public HColumn<N,V> next()
Specified by:
next in interface Iterator<HColumn<N,V>>

remove

public void remove()
Specified by:
remove in interface Iterator<HColumn<N,V>>


Copyright © 2013. All Rights Reserved.