use of org.apache.gobblin.config.store.api.VersionDoesNotExistException in project incubator-gobblin by apache.
the class QueryBasedSource method getTableSpecificPropsFromConfigStore.
private static Map<SourceEntity, State> getTableSpecificPropsFromConfigStore(Collection<SourceEntity> tables, State state) {
ConfigClient client = ConfigClientCache.getClient(VersionStabilityPolicy.STRONG_LOCAL_STABILITY);
String configStoreUri = state.getProp(ConfigurationKeys.CONFIG_MANAGEMENT_STORE_URI);
Preconditions.checkNotNull(configStoreUri);
Map<SourceEntity, State> result = Maps.newHashMap();
for (SourceEntity table : tables) {
try {
result.put(table, ConfigUtils.configToState(client.getConfig(PathUtils.combinePaths(configStoreUri, QUERY_BASED_SOURCE, table.getDatasetName()).toUri())));
} catch (VersionDoesNotExistException | ConfigStoreFactoryDoesNotExistsException | ConfigStoreCreationException e) {
throw new RuntimeException("Unable to get table config for " + table, e);
}
}
return result;
}
Aggregations