me.prettyprint.cassandra.service.template
Class SuperCfResultWrapper<K,SN,N>

java.lang.Object
  extended by me.prettyprint.cassandra.service.template.AbstractResultWrapper<K,N>
      extended by me.prettyprint.cassandra.service.template.SuperCfResultWrapper<K,SN,N>
Type Parameters:
N - the super column's sub column name type
All Implemented Interfaces:
Iterator<ColumnFamilyResult<K,N>>, ColumnFamilyResult<K,N>, SuperCfResult<K,SN,N>, ResultStatus
Direct Known Subclasses:
MappedSuperCfResultWrapper

public class SuperCfResultWrapper<K,SN,N>
extends AbstractResultWrapper<K,N>
implements SuperCfResult<K,SN,N>

Provides access to the current row of data during super column queries.

Author:
zznate

Field Summary
 
Fields inherited from class me.prettyprint.cassandra.service.template.AbstractResultWrapper
columnNameSerializer, keySerializer, resultStatus
 
Constructor Summary
SuperCfResultWrapper(Serializer<K> keySerializer, Serializer<SN> sNameSerializer, Serializer<N> subSerializer, ExecutionResult<Map<ByteBuffer,List<org.apache.cassandra.thrift.ColumnOrSuperColumn>>> executionResult)
           
 
Method Summary
 void applySuperColumn(SN sColumnName)
           
 SN getActiveSuperColumn()
           
 Boolean getBoolean(SN sColumnName, N columnName)
           
 byte[] getByteArray(SN sColumnName, N columnName)
           
 ByteBuffer getByteBuffer(SN sColumnName, N columnName)
           
 HColumn<N,ByteBuffer> getColumn(N columnName)
           
 Collection<N> getColumnNames()
           
 ByteBuffer getColumnValue(N columnName)
           
 Date getDate(SN sColumnName, N columnName)
           
 Integer getInteger(SN sColumnName, N columnName)
           
 K getKey()
           
 Long getLong(SN sColumnName, N columnName)
           
 String getString(SN sColumnName, N columnName)
           
 HSuperColumn<SN,N,ByteBuffer> getSuperColumn(SN sColumnName)
          Retrieved named superColumn as an HSuperColumn with sub columns.
 List<SN> getSuperColumns()
           
 UUID getUUID(SN sColumnName, N columnName)
           
 boolean hasNext()
           
 boolean hasResults()
           
 SuperCfResult<K,SN,N> next()
           
 void remove()
           
 
Methods inherited from class me.prettyprint.cassandra.service.template.AbstractResultWrapper
getBoolean, getByteArray, getDate, getExecutionTimeMicro, getExecutionTimeNano, getHostUsed, getInteger, getLong, getString, getUUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface me.prettyprint.cassandra.service.template.ColumnFamilyResult
getBoolean, getByteArray, getDate, getInteger, getLong, getString, getUUID
 
Methods inherited from interface me.prettyprint.hector.api.ResultStatus
getExecutionTimeMicro, getExecutionTimeNano, getHostUsed
 

Constructor Detail

SuperCfResultWrapper

public SuperCfResultWrapper(Serializer<K> keySerializer,
                            Serializer<SN> sNameSerializer,
                            Serializer<N> subSerializer,
                            ExecutionResult<Map<ByteBuffer,List<org.apache.cassandra.thrift.ColumnOrSuperColumn>>> executionResult)
Method Detail

next

public SuperCfResult<K,SN,N> next()
Specified by:
next in interface Iterator<ColumnFamilyResult<K,N>>
Specified by:
next in interface SuperCfResult<K,SN,N>

getSuperColumns

public List<SN> getSuperColumns()
Specified by:
getSuperColumns in interface SuperCfResult<K,SN,N>

getColumnValue

public ByteBuffer getColumnValue(N columnName)
Specified by:
getColumnValue in class AbstractResultWrapper<K,N>

getKey

public K getKey()
Specified by:
getKey in interface ColumnFamilyResult<K,N>
Specified by:
getKey in interface SuperCfResult<K,SN,N>

getColumn

public HColumn<N,ByteBuffer> getColumn(N columnName)
Specified by:
getColumn in interface ColumnFamilyResult<K,N>

getColumnNames

public Collection<N> getColumnNames()
Specified by:
getColumnNames in interface ColumnFamilyResult<K,N>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<ColumnFamilyResult<K,N>>

remove

public void remove()
Specified by:
remove in interface Iterator<ColumnFamilyResult<K,N>>

getBoolean

public Boolean getBoolean(SN sColumnName,
                          N columnName)
Specified by:
getBoolean in interface SuperCfResult<K,SN,N>

getByteArray

public byte[] getByteArray(SN sColumnName,
                           N columnName)
Specified by:
getByteArray in interface SuperCfResult<K,SN,N>

getDate

public Date getDate(SN sColumnName,
                    N columnName)
Specified by:
getDate in interface SuperCfResult<K,SN,N>

getInteger

public Integer getInteger(SN sColumnName,
                          N columnName)
Specified by:
getInteger in interface SuperCfResult<K,SN,N>

getLong

public Long getLong(SN sColumnName,
                    N columnName)
Specified by:
getLong in interface SuperCfResult<K,SN,N>

getString

public String getString(SN sColumnName,
                        N columnName)
Specified by:
getString in interface SuperCfResult<K,SN,N>

getUUID

public UUID getUUID(SN sColumnName,
                    N columnName)
Specified by:
getUUID in interface SuperCfResult<K,SN,N>

getByteBuffer

public ByteBuffer getByteBuffer(SN sColumnName,
                                N columnName)
Specified by:
getByteBuffer in interface SuperCfResult<K,SN,N>

getActiveSuperColumn

public SN getActiveSuperColumn()
Specified by:
getActiveSuperColumn in interface SuperCfResult<K,SN,N>

getSuperColumn

public HSuperColumn<SN,N,ByteBuffer> getSuperColumn(SN sColumnName)
Description copied from interface: SuperCfResult
Retrieved named superColumn as an HSuperColumn with sub columns. Underlying column value is a ByteBuffer. Note: Correct derialization and treatment is up to the caller.

Specified by:
getSuperColumn in interface SuperCfResult<K,SN,N>
Returns:

applySuperColumn

public void applySuperColumn(SN sColumnName)
Specified by:
applySuperColumn in interface SuperCfResult<K,SN,N>

hasResults

public boolean hasResults()
Specified by:
hasResults in interface ColumnFamilyResult<K,N>


Copyright © 2011. All Rights Reserved.