List of usage examples for org.apache.cassandra.cql3.statements SelectStatement columnFamily
public String columnFamily()
From source file:com.stratio.cassandra.lucene.IndexQueryHandler.java
License:Apache License
private ResultMessage process(SelectStatement select, QueryState state, QueryOptions options, RowFilter.CustomExpression expression) throws ReflectiveOperationException { // Validate expression ColumnFamilyStore cfs = Keyspace.open(select.keyspace()).getColumnFamilyStore(select.columnFamily()); Index index = (Index) cfs.indexManager.getIndex(expression.getTargetIndex()); Search search = index.validate(expression); // Check paging int limit = select.getLimit(options); int page = getPageSize(select, options); if (search.isTopK()) { if (limit == Integer.MAX_VALUE) { // Avoid unlimited throw new InvalidRequestException( "Top-k searches don't support paging, so a cautious LIMIT clause should be provided " + "to prevent excessive memory consumption."); } else if (page < limit) { String json = UTF8Type.instance.compose(expression.getValue()); logger.warn("Disabling paging of {} rows per page for top-k search requesting {} rows: {}", page, limit, json);//from ww w .j av a 2 s .c o m return executeWithoutPaging(select, state, options); } } // Process return execute(select, state, options); }