/** * 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()); }
public LogicalTableDictionary getLogicalTableDictionary() { return resourceDictionaries.getLogicalDictionary(); } }
public DimensionDictionary getDimensionDictionary() { return dictionaries.getDimensionDictionary(); }
@Override public ConfigPhysicalTable build(ResourceDictionaries dictionaries, DataSourceMetadataService metadataService) { return new SqlPhysicalTable( getName(), getTimeGrain(), buildColumns(dictionaries.getDimensionDictionary()), getLogicalToPhysicalNames(), new EternalAvailability(DataSourceName.of(getName().asName()), metadataService), schemaName, timestampColumn ); }
@Override public ConfigPhysicalTable build(ResourceDictionaries dictionaries, DataSourceMetadataService metadataService) { return new StrictPhysicalTable( getName(), getTimeGrain(), buildColumns(dictionaries.getDimensionDictionary()), getLogicalToPhysicalNames(), metadataService, getExpectedStartDate(), getExpectedEndDate() ); } }
/** * Load the Dimensions, Metrics, and Tables. */ public void load() { dimensionLoader.loadDimensionDictionary(dictionaries.getDimensionDictionary()); // metric loader might dependent on dimension dictionary, so load dimension first metricLoader.loadMetricDictionary(dictionaries.getMetricDictionary(), dictionaries.getDimensionDictionary()); tableLoader.loadTableDictionary(dictionaries); LOG.info("Initialized ConfigurationLoader"); LOG.info(dictionaries.toString()); }
/** * 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); }
@Override public ConfigPhysicalTable build( ResourceDictionaries dictionaries, DataSourceMetadataService metadataService ) { return new PermissivePhysicalTable( getName(), getTimeGrain(), buildColumns(dictionaries.getDimensionDictionary()), getLogicalToPhysicalNames(), metadataService ); } }
/** * Load a logical table into the logicalDictionary. * <p> * Note: This builds the logical table as well. * * @param logicalTableName The logical table name * @param nameGroup The table group information for the logical table * @param validGrains The accepted grains for the logical table * @param dictionaries The resource dictionaries for reading and storing configuration */ public void loadLogicalTableWithGranularities( String logicalTableName, TableGroup nameGroup, Set<? extends Granularity> validGrains, ResourceDictionaries dictionaries ) { loadLogicalTableWithGranularities( logicalTableName, nameGroup, validGrains, dictionaries.getLogicalDictionary(), dictionaries.getMetricDictionary() ); }
/** * Load several logical tables into the logicalDictionary, all with the globally-scoped metric dictionary. * <p> * Note: This builds the logical tables as well. * * @param nameGroupMap A map of logical table name to table group information * @param validGrains The accepted grains for the logical table * @param dictionaries The resource dictionaries for reading and storing configuration */ public void loadLogicalTablesWithGranularities( Map<String, TableGroup> nameGroupMap, Set<? extends Granularity> validGrains, ResourceDictionaries dictionaries ) { loadLogicalTablesWithGranularities( nameGroupMap, validGrains, dictionaries.getLogicalDictionary(), nameGroupMap.keySet().stream() .collect(Collectors.toMap(Function.identity(), i -> dictionaries.getMetricDictionary())) ); }
public MetricDictionary getMetricDictionary() { return dictionaries.getMetricDictionary(); }
/** * Get the query signing service for the test. * * @return the query signing service */ public QuerySigningService<?> getQuerySigningService() { return buildQuerySigningService( getConfigurationLoader().getPhysicalTableDictionary(), getDataSourceMetadataService() ); }
public PhysicalTableDictionary getPhysicalTableDictionary() { return dictionaries.getPhysicalDictionary(); }
/** * 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); }
public LogicalTableDictionary getLogicalTableDictionary() { return dictionaries.getLogicalDictionary(); }
/** * The dictionary of configured dimensions. * * @return A dictionary of dimensions */ default DimensionDictionary getDimensionDictionary() { return getResourceDictionaries().getDimensionDictionary(); }
/** * The dictionary of configured metrics. * * @return A metric dictionary. */ default MetricDictionary getMetricDictionary() { return getResourceDictionaries().getMetricDictionary(); }
/** * Get the query signing service for the test. * * @return the query signing service */ public QuerySigningService<?> getQuerySigningService() { return buildQuerySigningService( getConfigurationLoader().getPhysicalTableDictionary(), getDataSourceMetadataService() ); }
/** * 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())); }
/** * The dictionary of logical tables. * * @return A logical table dictionary */ default LogicalTableDictionary getLogicalTableDictionary() { return getResourceDictionaries().getLogicalDictionary(); } }