com.netflix.astyanax.thrift
Class ThriftConverter

java.lang.Object
  extended by com.netflix.astyanax.thrift.ThriftConverter

public class ThriftConverter
extends java.lang.Object


Constructor Summary
ThriftConverter()
           
 
Method Summary
static
<K> org.apache.cassandra.thrift.ColumnParent
getColumnParent(com.netflix.astyanax.model.ColumnFamily<?,?> columnFamily, com.netflix.astyanax.model.ColumnPath<?> path)
          Construct a Hector ColumnParent based on the information in the query and the type of column family being queried.
static
<K> org.apache.cassandra.thrift.ColumnPath
getColumnPath(com.netflix.astyanax.model.ColumnFamily<?,?> columnFamily, com.netflix.astyanax.model.ColumnPath<?> path)
          Construct a Thrift ColumnPath based on the information in the query and the type of column family being queried.
static
<C> org.apache.cassandra.thrift.SlicePredicate
getPredicate(com.netflix.astyanax.model.ColumnSlice<C> columns, com.netflix.astyanax.Serializer<C> colSer)
          Return a Hector SlicePredicate based on the provided column slice
static com.netflix.astyanax.connectionpool.exceptions.ConnectionException ToConnectionPoolException(java.lang.Throwable e)
          Convert from Thrift exceptions to an internal ConnectionPoolException
static org.apache.cassandra.thrift.ConsistencyLevel ToThriftConsistencyLevel(com.netflix.astyanax.model.ConsistencyLevel cl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThriftConverter

public ThriftConverter()
Method Detail

getColumnParent

public static <K> org.apache.cassandra.thrift.ColumnParent getColumnParent(com.netflix.astyanax.model.ColumnFamily<?,?> columnFamily,
                                                                           com.netflix.astyanax.model.ColumnPath<?> path)
                                                                throws com.netflix.astyanax.connectionpool.exceptions.BadRequestException
Construct a Hector ColumnParent based on the information in the query and the type of column family being queried.

Type Parameters:
K -
Parameters:
columnFamily -
path -
Returns:
Throws:
com.netflix.astyanax.connectionpool.exceptions.BadRequestException

getColumnPath

public static <K> org.apache.cassandra.thrift.ColumnPath getColumnPath(com.netflix.astyanax.model.ColumnFamily<?,?> columnFamily,
                                                                       com.netflix.astyanax.model.ColumnPath<?> path)
                                                            throws com.netflix.astyanax.connectionpool.exceptions.BadRequestException
Construct a Thrift ColumnPath based on the information in the query and the type of column family being queried.

Type Parameters:
K -
Parameters:
columnFamily -
path -
Returns:
Throws:
org.apache.cassandra.thrift.NotFoundException
org.apache.cassandra.thrift.InvalidRequestException
org.apache.thrift.TException
com.netflix.astyanax.connectionpool.exceptions.BadRequestException

getPredicate

public static <C> org.apache.cassandra.thrift.SlicePredicate getPredicate(com.netflix.astyanax.model.ColumnSlice<C> columns,
                                                                          com.netflix.astyanax.Serializer<C> colSer)
Return a Hector SlicePredicate based on the provided column slice

Type Parameters:
C -
Parameters:
columns -
colSer -
Returns:

ToConnectionPoolException

public static com.netflix.astyanax.connectionpool.exceptions.ConnectionException ToConnectionPoolException(java.lang.Throwable e)
Convert from Thrift exceptions to an internal ConnectionPoolException

Parameters:
e -
Returns:

ToThriftConsistencyLevel

public static org.apache.cassandra.thrift.ConsistencyLevel ToThriftConsistencyLevel(com.netflix.astyanax.model.ConsistencyLevel cl)