Search in sources :

Example 1 with SparkUtilityService

use of com.thinkbiganalytics.spark.service.SparkUtilityService in project kylo by Teradata.

the class KyloShellConfig 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 SparkUtilityService sparkUtilityService) {
    Validate.notNull(fileSystem);
    Validate.notNull(transformService);
    Validate.notNull(sparkLocatorService);
    Validate.notNull(sparkUtilityService);
    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);
            bind(sparkUtilityService).to(SparkUtilityService.class);
        }
    });
    return config;
}
Also used : AbstractBinder(org.glassfish.hk2.utilities.binding.AbstractBinder) FileSystem(org.apache.hadoop.fs.FileSystem) SparkUtilityService(com.thinkbiganalytics.spark.service.SparkUtilityService) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) TransformService(com.thinkbiganalytics.spark.service.TransformService) SparkLocatorService(com.thinkbiganalytics.spark.service.SparkLocatorService) Bean(org.springframework.context.annotation.Bean)

Aggregations

SparkLocatorService (com.thinkbiganalytics.spark.service.SparkLocatorService)1 SparkUtilityService (com.thinkbiganalytics.spark.service.SparkUtilityService)1 TransformService (com.thinkbiganalytics.spark.service.TransformService)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 AbstractBinder (org.glassfish.hk2.utilities.binding.AbstractBinder)1 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)1 Bean (org.springframework.context.annotation.Bean)1