org.scale7.cassandra.pelops
Class PageOfIterator<E>

java.lang.Object
  extended by org.scale7.cassandra.pelops.PageOfIterator<E>
All Implemented Interfaces:
Iterator<E>
Direct Known Subclasses:
ColumnIterator, SuperColumnIterator

public abstract class PageOfIterator<E>
extends Object
implements Iterator<E>


Field Summary
protected  int batchSize
           
protected  org.apache.cassandra.thrift.ConsistencyLevel cLevel
           
protected  String columnFamily
           
protected  boolean reversed
           
protected  Bytes rowKey
           
protected  Selector selector
           
protected  Bytes startBeyondName
           
 
Constructor Summary
PageOfIterator(Selector selector, String columnFamily, Bytes rowKey, Bytes startBeyondName, boolean reversed, int batchSize, org.apache.cassandra.thrift.ConsistencyLevel cLevel)
           
 
Method Summary
protected abstract  List<E> fetchNextBatch()
           
 boolean hasNext()
          Returns true if the iteration has more super columns.
 E next()
          Returns the next super column in the iteration.
protected abstract  Bytes nextStartBeyondName(List<E> batch)
           
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selector

protected final Selector selector

columnFamily

protected final String columnFamily

rowKey

protected final Bytes rowKey

reversed

protected final boolean reversed

batchSize

protected final int batchSize

cLevel

protected final org.apache.cassandra.thrift.ConsistencyLevel cLevel

startBeyondName

protected Bytes startBeyondName
Constructor Detail

PageOfIterator

public PageOfIterator(Selector selector,
                      String columnFamily,
                      Bytes rowKey,
                      Bytes startBeyondName,
                      boolean reversed,
                      int batchSize,
                      org.apache.cassandra.thrift.ConsistencyLevel cLevel)
Method Detail

fetchNextBatch

protected abstract List<E> fetchNextBatch()

nextStartBeyondName

protected abstract Bytes nextStartBeyondName(List<E> batch)

hasNext

public boolean hasNext()
Returns true if the iteration has more super columns. (In other words, returns true if next would return a super column rather than throwing an exception.)

Specified by:
hasNext in interface Iterator<E>

next

public E next()
Returns the next super column in the iteration.

Specified by:
next in interface Iterator<E>
Returns:
the next super column
Throws:
NoSuchElementException - iteration has no more super columns.

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<E>


Copyright © 2011. All Rights Reserved.