use of com.thinkbiganalytics.kylo.catalog.spi.DataSetProvider in project kylo by Teradata.
the class DefaultKyloCatalogReader method load.
@Nonnull
@Override
public T load() {
Preconditions.checkNotNull(options.getFormat(), "Format must be defined");
// Find data set provider
final Option<DataSetProvider<T>> provider = client.getDataSetProvider(options.getFormat());
if (!provider.isDefined()) {
throw new KyloCatalogException("Format is not supported: " + options.getFormat());
}
// Load data set
try {
return resourceLoader.runWithThreadContext(new Callable<T>() {
@Override
public T call() {
return provider.get().read(client, options);
}
});
} catch (final Exception e) {
throw new KyloCatalogException("Unable to load '" + options.getFormat() + "' source: " + e, e);
}
}
Aggregations