use of org.locationtech.geowave.core.store.query.BaseQuery in project geowave by locationtech.
the class ExpressionQueryIT method assertBestIndex.
private QueryConstraints assertBestIndex(final InternalDataAdapter<?> adapter, final Index bestIndex, final BaseQuery<?, ?> query, final PersistentAdapterStore adapterStore, final InternalAdapterStore internalAdapterStore, final AdapterIndexMappingStore aimStore, final IndexStore indexStore, final DataStatisticsStore statsStore) {
assertTrue(query.getQueryConstraints() instanceof OptimalExpressionQuery);
final OptimalExpressionQuery queryConstraints = (OptimalExpressionQuery) query.getQueryConstraints();
@SuppressWarnings("rawtypes") List<Pair<Index, List<InternalDataAdapter<?>>>> optimalIndices = queryConstraints.determineBestIndices(query instanceof Query ? new BaseQueryOptions((Query) query, adapterStore, internalAdapterStore) : new BaseQueryOptions((AggregationQuery) query, adapterStore, internalAdapterStore), new InternalDataAdapter<?>[] { adapter }, aimStore, indexStore, statsStore);
assertEquals(1, optimalIndices.size());
final Pair<Index, List<InternalDataAdapter<?>>> indexAdapterPair = optimalIndices.get(0);
assertEquals(bestIndex, indexAdapterPair.getKey());
assertEquals(1, indexAdapterPair.getValue().size());
assertEquals(adapter, indexAdapterPair.getValue().get(0));
final QueryConstraints retVal = queryConstraints.createQueryConstraints(adapter, bestIndex, aimStore.getMapping(adapter.getAdapterId(), bestIndex.getName()));
return retVal;
}
Aggregations