private void createIndexUsingThrift ( TableInfo tableInfo , CfDef cfDef ) throws Exception { for ( IndexInfo indexInfo : tableInfo . getColumnsToBeIndexed ( ) ) { for ( ColumnDef columnDef : cfDef . getColumn_metadata ( ) ) { if ( new String ( columnDef . getName ( ) , Constants . ENCODING ) . equals ( indexInfo . getColumnName ( ) ) ) { columnDef . setIndex_type ( CassandraIndexHelper . getIndexType ( indexInfo . getIndexType ( ) ) ) ; // columnDef.setIndex_name(indexInfo.getIndexName()); } } } cassandra_client . system_update_column_family ( cfDef ) ; }
Creates the index using thrift .