me.prettyprint.cassandra.service
Class SliceCounterIterator<K,N>

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

public class SliceCounterIterator<K,N>
extends Object
implements Iterator<HCounterColumn<N>>

Iterates over the SliceCounterQuery, refreshing the query 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 SliceCounterIterator.SliceCounterFinish<N>
          When iterating over a SliceCounter, it may be desirable to move the finish point for each query.
 
Constructor Summary
SliceCounterIterator(SliceCounterQuery<K,N> query, N start, N finish, boolean reversed)
          Constructor
SliceCounterIterator(SliceCounterQuery<K,N> query, N start, N finish, boolean reversed, int count)
          Constructor
SliceCounterIterator(SliceCounterQuery<K,N> query, N start, SliceCounterIterator.SliceCounterFinish<N> finish, boolean reversed)
          Constructor
SliceCounterIterator(SliceCounterQuery<K,N> query, N start, SliceCounterIterator.SliceCounterFinish<N> finish, boolean reversed, int count)
          Constructor
 
Method Summary
 boolean hasNext()
           
 HCounterColumn<N> next()
           
 void remove()
           
 SliceCounterIterator setFilter(SliceFilter<HCounterColumn<N>> 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

SliceCounterIterator

public SliceCounterIterator(SliceCounterQuery<K,N> 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

SliceCounterIterator

public SliceCounterIterator(SliceCounterQuery<K,N> 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

SliceCounterIterator

public SliceCounterIterator(SliceCounterQuery<K,N> query,
                            N start,
                            SliceCounterIterator.SliceCounterFinish<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

SliceCounterIterator

public SliceCounterIterator(SliceCounterQuery<K,N> query,
                            N start,
                            SliceCounterIterator.SliceCounterFinish<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 SliceCounterIterator setFilter(SliceFilter<HCounterColumn<N>> 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<HCounterColumn<N>>

next

public HCounterColumn<N> next()
Specified by:
next in interface Iterator<HCounterColumn<N>>

remove

public void remove()
Specified by:
remove in interface Iterator<HCounterColumn<N>>


Copyright © 2013. All Rights Reserved.