/** * Binds all the resource dictionaries. * * @param binder The binder to bind the dictionaries to. */ private void bindDictionaries(AbstractBinder binder) { // Bind the configuration dictionaries binder.bind(loader.getDimensionDictionary()).to(DimensionDictionary.class); binder.bind(loader.getMetricDictionary()).to(MetricDictionary.class); binder.bind(loader.getLogicalTableDictionary()).to(LogicalTableDictionary.class); binder.bind(loader.getPhysicalTableDictionary()).to(PhysicalTableDictionary.class); binder.bind(loader.getDictionaries()).to(ResourceDictionaries.class); }
/** * Extension point for building custom Configuration Loaders. * * @param dimensionLoader A dimension loader * @param metricLoader A metric loader * @param tableLoader A table loader * * @return A configurationLoader instance */ protected ConfigurationLoader buildConfigurationLoader( DimensionLoader dimensionLoader, MetricLoader metricLoader, TableLoader tableLoader ) { return new ConfigurationLoader(dimensionLoader, metricLoader, tableLoader); }
loader.load(); bindDictionaries(this); bind(buildHavingGenerator(loader)).to(HavingGenerator.class); setupHealthChecks(healthCheckRegistry, loader.getDimensionDictionary()); setupGauges(); loader.getPhysicalTableDictionary(), dataSourceMetadataService ); DataSourceMetadataLoadTask dataSourceMetadataLoader = buildDataSourceMetadataLoader( metadataDruidWebService, loader.getPhysicalTableDictionary(), dataSourceMetadataService, getMappers().getMapper() setupLookUpMetadataLoader( healthCheckRegistry, buildLookupMetaDataLoader(metadataDruidWebService, loader.getDimensionDictionary()) ); bind(buildPreResponseStore(loader.getDictionaries())).to(PreResponseStore.class); DimensionValueLoadTask dimensionLoader = buildDruidDimensionsLoader( druidWebService, loader.getPhysicalTableDictionary(), loader.getDimensionDictionary() );
/** * Get the query signing service for the test. * * @return the query signing service */ public QuerySigningService<?> getQuerySigningService() { return buildQuerySigningService( getConfigurationLoader().getPhysicalTableDictionary(), getDataSourceMetadataService() ); }
DimensionDictionary dictionary = configurationLoader.getDimensionDictionary(); Set<Dimension> dimensions = dictionary.findAll(); List<Throwable> caughtExceptions = Collections.emptyList();
/** * Constructor. * <p> * Uses the globally scoped set of metrics to resolve having clauses. * * @param loader Configuration loader that connects resource dictionaries with the loader. */ public DefaultHavingApiGenerator(ConfigurationLoader loader) { this(loader.getMetricDictionary()); }
Map<String, RequestMapper> requestMappers = getRequestMappers(loader.getDictionaries()); binder.bind(requestMappers.getOrDefault( DimensionsApiRequest.REQUEST_MAPPER_NAMESPACE, new DimensionApiRequestMapper(loader.getDictionaries()) )).named(DimensionsApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class); new NoOpRequestMapper(loader.getDictionaries()) )).named(MetricsApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class); new NoOpRequestMapper(loader.getDictionaries()) )).named(SlicesApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class); new NoOpRequestMapper(loader.getDictionaries()) )).named(TablesApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class); new NoOpRequestMapper(loader.getDictionaries()) )).named(DataApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class); new NoOpRequestMapper(loader.getDictionaries()) )).named(JobsApiRequest.REQUEST_MAPPER_NAMESPACE).to(RequestMapper.class);
/** * Get the query signing service for the test. * * @return the query signing service */ public QuerySigningService<?> getQuerySigningService() { return buildQuerySigningService( getConfigurationLoader().getPhysicalTableDictionary(), getDataSourceMetadataService() ); }
DimensionDictionary dictionary = configurationLoader.getDimensionDictionary(); Set<Dimension> dimensions = dictionary.findAll(); List<Throwable> caughtExceptions = Collections.emptyList();
/** * Creates an object that generates map of Api Having from having string. * Constructs a {@link DefaultHavingApiGenerator} by default. * @param loader Configuration loader that connects resource dictionaries with the loader. * * @return An object to generate having maps from having string. */ protected HavingGenerator buildHavingGenerator(ConfigurationLoader loader) { return new PerRequestDictionaryHavingGenerator(new DefaultHavingApiGenerator(loader.getMetricDictionary())); }
@Override protected VolatileIntervalsService getVolatileIntervalsService() { PhysicalTableDictionary physicalTableDictionary = getConfigurationLoader().getPhysicalTableDictionary(); Map<PhysicalTable, VolatileIntervalsFunction> hourlyMonthlyVolatileIntervals = new LinkedHashMap<>(); if (physicalTableDictionary.containsKey(HOURLY.asName())) { hourlyMonthlyVolatileIntervals.put( getConfigurationLoader().getPhysicalTableDictionary().get(HOURLY.asName()), () -> new SimplifiedIntervalList( Collections.singleton( new Interval(new DateTime(2016, 8, 15, 0, 0), new DateTime(2016, 8, 16, 0, 0)) ) ) ); } if (physicalTableDictionary.containsKey(MONTHLY.asName())) { hourlyMonthlyVolatileIntervals.put( getConfigurationLoader().getPhysicalTableDictionary().get(MONTHLY.asName()), () -> new SimplifiedIntervalList( Collections.singleton( new Interval(new DateTime(2016, 8, 1, 0, 0), new DateTime(2016, 9, 1, 0, 0)) ) ) ); } return new DefaultingVolatileIntervalsService( NoVolatileIntervalsFunction.INSTANCE, hourlyMonthlyVolatileIntervals ); }
@Override protected VolatileIntervalsService getVolatileIntervalsService() { PhysicalTableDictionary physicalTableDictionary = getConfigurationLoader().getPhysicalTableDictionary(); Map<PhysicalTable, VolatileIntervalsFunction> hourlyMonthlyVolatileIntervals = new LinkedHashMap<>(); if (physicalTableDictionary.containsKey(HOURLY.asName())) { hourlyMonthlyVolatileIntervals.put( getConfigurationLoader().getPhysicalTableDictionary().get(HOURLY.asName()), () -> new SimplifiedIntervalList( Collections.singleton( new Interval(new DateTime(2016, 8, 15, 0, 0), new DateTime(2016, 8, 16, 0, 0)) ) ) ); } if (physicalTableDictionary.containsKey(MONTHLY.asName())) { hourlyMonthlyVolatileIntervals.put( getConfigurationLoader().getPhysicalTableDictionary().get(MONTHLY.asName()), () -> new SimplifiedIntervalList( Collections.singleton( new Interval(new DateTime(2016, 8, 1, 0, 0), new DateTime(2016, 9, 1, 0, 0)) ) ) ); } return new DefaultingVolatileIntervalsService( NoVolatileIntervalsFunction.INSTANCE, hourlyMonthlyVolatileIntervals ); }