org.apache.cassandra.thrift

## Class ThriftConversion

- java.lang.Object
- - org.apache.cassandra.thrift.ThriftConversion

    public class ThriftConversion
    extends java.lang.Object

Static utility methods to convert internal structure to and from thrift ones.

### Constructor Summary

Constructors
Constructor and Description
`ThriftConversion()`

### Method Summary

All Methods Static Methods Concrete Methods
`static CFMetaData` `fromThrift(CfDef cf_def)`
`static ConsistencyLevel` `fromThrift(ConsistencyLevel cl)`
`static KSMetaData` `fromThrift(KsDef ksd, CFMetaData... cfDefs)`
`static ColumnDefinition` `fromThrift(java.lang.String ksName, java.lang.String cfName, AbstractType<?> thriftComparator, AbstractType<?> thriftSubcomparator, ColumnDef thriftColumnDef)`
`static CFMetaData` `fromThriftCqlRow(CqlRow cf, CqlResult columnsRes)` Create CFMetaData from thrift `CqlRow` that contains columns from schema_columnfamilies.
`static CFMetaData` `fromThriftForUpdate(CfDef cf_def, CFMetaData toUpdate)`
`static java.util.List<IndexExpression>` `indexExpressionsFromThrift(java.util.List<IndexExpression> exprs)`
`static java.lang.RuntimeException` `rethrow(RequestExecutionException e)`
`static AuthenticationException` `toThrift(AuthenticationException e)`
`static CfDef` `toThrift(CFMetaData cfm)`
`static ColumnDef` `toThrift(ColumnDefinition column)`
`static ConsistencyLevel` `toThrift(ConsistencyLevel cl)`
`static KsDef` `toThrift(KSMetaData ksm)`
`static TimedOutException` `toThrift(RequestFailureException e)`
`static TimedOutException` `toThrift(RequestTimeoutException e)`
`static InvalidRequestException` `toThrift(RequestValidationException e)`
`static UnavailableException` `toThrift(UnavailableException e)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ThriftConversion

    public ThriftConversion()

### Method Detail

#### fromThrift

    public static ConsistencyLevel fromThrift(ConsistencyLevel cl)

#### toThrift

    public static ConsistencyLevel toThrift(ConsistencyLevel cl)

#### rethrow

    public static java.lang.RuntimeException rethrow(RequestExecutionException e)
                                              throws UnavailableException,
                                                     TimedOutException

Throws:
  `UnavailableException`
  `TimedOutException`

#### toThrift

    public static InvalidRequestException toThrift(RequestValidationException e)

#### toThrift

    public static UnavailableException toThrift(UnavailableException e)

#### toThrift

    public static AuthenticationException toThrift(AuthenticationException e)

#### toThrift

    public static TimedOutException toThrift(RequestTimeoutException e)

#### toThrift

    public static TimedOutException toThrift(RequestFailureException e)

#### indexExpressionsFromThrift

    public static java.util.List<IndexExpression> indexExpressionsFromThrift(java.util.List<IndexExpression> exprs)

#### fromThrift

    public static KSMetaData fromThrift(KsDef ksd,
                                        CFMetaData... cfDefs)
                                 throws ConfigurationException

Throws:
  `ConfigurationException`

#### toThrift

    public static KsDef toThrift(KSMetaData ksm)

#### fromThrift

    public static CFMetaData fromThrift(CfDef cf_def)
                                 throws InvalidRequestException,
                                        ConfigurationException

Throws:
  `InvalidRequestException`
  `ConfigurationException`

#### fromThriftForUpdate

    public static CFMetaData fromThriftForUpdate(CfDef cf_def,
                                                 CFMetaData toUpdate)
                                          throws InvalidRequestException,
                                                 ConfigurationException

Throws:
  `InvalidRequestException`
  `ConfigurationException`

#### fromThriftCqlRow

    public static CFMetaData fromThriftCqlRow(CqlRow cf,
                                              CqlResult columnsRes)

Create CFMetaData from thrift `CqlRow` that contains columns from schema_columnfamilies.

Parameters:
  `columnsRes` - CqlRow containing columns from schema_columnfamilies.
Returns:
  CFMetaData derived from CqlRow

#### toThrift

    public static CfDef toThrift(CFMetaData cfm)

#### fromThrift

    public static ColumnDefinition fromThrift(java.lang.String ksName,
                                              java.lang.String cfName,
                                              AbstractType<?> thriftComparator,
                                              AbstractType<?> thriftSubcomparator,
                                              ColumnDef thriftColumnDef)
                                       throws SyntaxException,
                                              ConfigurationException

Throws:
  `SyntaxException`
  `ConfigurationException`

#### toThrift

    public static ColumnDef toThrift(ColumnDefinition column)