/** * Transforms dependent table names to metrics. * * @param tableNames The names of the tables to be mapped * @param physicalTableDictionary The physical table dictionary to resolve the names * * @return set of PhysicalTables from the ResourceDictionaries */ private static Set<ConfigPhysicalTable> mapNamestoTables( Collection<String> tableNames, PhysicalTableDictionary physicalTableDictionary ) { Set<String> missingTableNames = tableNames.stream() .filter(it -> ! physicalTableDictionary.containsKey(it)) .collect(Collectors.toSet()); if (!missingTableNames.isEmpty()) { String message = String.format(MISSING_DEPENDANT_TABLE_FORMAT, missingTableNames); throw new IllegalArgumentException(message); } return tableNames.stream() .map(it -> physicalTableDictionary.get(it)) .collect(Collectors.toSet()); }
if (physicalTableDictionary.containsKey(currentTableName)) { return physicalTableDictionary.get(currentTableName); .forEach( tableName -> { if (!physicalTableDictionary.containsKey(tableName)) { physicalTableDictionary.put( tableName.asName(),
@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 ); }