use of com.yahoo.elide.datastores.aggregation.core.Slf4jQueryLogger in project elide by yahoo.
the class AggregationDataStoreTestHarness method getDataStore.
@Override
public DataStore getDataStore() {
AggregationDataStore.AggregationDataStoreBuilder aggregationDataStoreBuilder = AggregationDataStore.builder();
ClassScanner scanner = DefaultClassScanner.getInstance();
MetaDataStore metaDataStore;
if (validator != null) {
metaDataStore = new MetaDataStore(scanner, validator.getElideTableConfig().getTables(), validator.getElideNamespaceConfig().getNamespaceconfigs(), true);
aggregationDataStoreBuilder.dynamicCompiledClasses(metaDataStore.getDynamicTypes());
} else {
metaDataStore = new MetaDataStore(scanner, true);
}
AggregationDataStore aggregationDataStore = aggregationDataStoreBuilder.queryEngine(new SQLQueryEngine(metaDataStore, (name) -> connectionDetailsMap.getOrDefault(name, defaultConnectionDetails), new HashSet<>(Arrays.asList(new AggregateBeforeJoinOptimizer(metaDataStore))), new DefaultQueryPlanMerger(metaDataStore), new DefaultQueryValidator(metaDataStore.getMetadataDictionary()))).queryLogger(new Slf4jQueryLogger()).build();
Consumer<EntityManager> txCancel = em -> em.unwrap(Session.class).cancelQuery();
DataStore jpaStore = new JpaDataStore(() -> entityManagerFactory.createEntityManager(), em -> new NonJtaTransaction(em, txCancel));
return new MultiplexManager(jpaStore, metaDataStore, aggregationDataStore);
}
use of com.yahoo.elide.datastores.aggregation.core.Slf4jQueryLogger in project elide by yahoo.
the class ElideStandaloneSettings method getAggregationDataStore.
/**
* Gets the AggregationDataStore for elide.
* @param queryEngine query engine object.
* @return AggregationDataStore object initialized.
*/
default AggregationDataStore getAggregationDataStore(QueryEngine queryEngine) {
AggregationDataStore.AggregationDataStoreBuilder aggregationDataStoreBuilder = AggregationDataStore.builder().queryEngine(queryEngine).queryLogger(new Slf4jQueryLogger());
if (getAnalyticProperties().enableDynamicModelConfig()) {
aggregationDataStoreBuilder.dynamicCompiledClasses(queryEngine.getMetaDataStore().getDynamicTypes());
}
aggregationDataStoreBuilder.cache(getQueryCache());
return aggregationDataStoreBuilder.build();
}
Aggregations