/** * Generate table configurations given a list of table specs * @param config the job configuration * @param tableSpecs the list of tableSpecs * @return configuration for the tables */ static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) { Map<String, String> tableConfigs = new HashMap<>(); tableSpecs.forEach(tableSpec -> { // Add table provider factory config tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()), tableSpec.getTableProviderFactoryClassName()); // Generate additional configuration TableProviderFactory tableProviderFactory = Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class); TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec); tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs)); }); LOG.info("TableConfigGenerator has generated configs {}", tableConfigs); return tableConfigs; }
/** * Generate table configurations given a list of table specs * @param config the job configuration * @param tableSpecs the list of tableSpecs * @return configuration for the tables */ static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) { Map<String, String> tableConfigs = new HashMap<>(); tableSpecs.forEach(tableSpec -> { // Add table provider factory config tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()), tableSpec.getTableProviderFactoryClassName()); // Generate additional configuration TableProviderFactory tableProviderFactory = Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class); TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec); tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs)); }); LOG.info("TableConfigGenerator has generated configs {}", tableConfigs); return tableConfigs; }
/** * Generate table configurations given a list of table specs * @param config the job configuration * @param tableSpecs the list of tableSpecs * @return configuration for the tables */ static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) { Map<String, String> tableConfigs = new HashMap<>(); tableSpecs.forEach(tableSpec -> { // Add table provider factory config tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()), tableSpec.getTableProviderFactoryClassName()); // Generate additional configuration TableProviderFactory tableProviderFactory = Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class); TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec); tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs)); }); LOG.info("TableConfigGenerator has generated configs {}", tableConfigs); return tableConfigs; }
/** * Generate table configurations given a list of table specs * @param config the job configuration * @param tableSpecs the list of tableSpecs * @return configuration for the tables */ static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) { Map<String, String> tableConfigs = new HashMap<>(); tableSpecs.forEach(tableSpec -> { // Add table provider factory config tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()), tableSpec.getTableProviderFactoryClassName()); // Generate additional configuration TableProviderFactory tableProviderFactory = Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class); TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec); tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs)); }); LOG.info("TableConfigGenerator has generated configs {}", tableConfigs); return tableConfigs; }