use of com.thinkbiganalytics.spark.service.SparkLocatorService in project kylo by Teradata.
the class SparkShellApp method jerseyConfig.
/**
* Gets the resource configuration for setting up Jersey.
*
* @return the Jersey configuration
*/
@Bean
public ResourceConfig jerseyConfig(final TransformService transformService, final FileSystem fileSystem, final SparkLocatorService sparkLocatorService) {
final ResourceConfig config = new ResourceConfig(ApiListingResource.class, SwaggerSerializers.class);
config.packages("com.thinkbiganalytics.spark.rest");
config.register(new AbstractBinder() {
@Override
protected void configure() {
bind(fileSystem).to(FileSystem.class);
bind(transformService).to(TransformService.class);
bind(sparkLocatorService).to(SparkLocatorService.class);
}
});
return config;
}
use of com.thinkbiganalytics.spark.service.SparkLocatorService in project kylo by Teradata.
the class SparkShellApp method sparkLocatorService.
/**
* Creates a Spark locator service.
*/
@Bean
public SparkLocatorService sparkLocatorService(final SparkContext sc, @Value("${spark.shell.datasources.exclude}") final String excludedDataSources, @Value("${spark.shell.datasources.include}") final String includedDataSources) {
final SparkLocatorService service = new SparkLocatorService();
if (excludedDataSources != null && !excludedDataSources.isEmpty()) {
final List<String> dataSources = Arrays.asList(excludedDataSources.split(","));
service.excludeDataSources(dataSources);
}
if (includedDataSources != null && !includedDataSources.isEmpty()) {
final List<String> dataSources = Arrays.asList(includedDataSources.split(","));
service.includeDataSources(dataSources);
}
return service;
}
Aggregations