Search in sources :

Example 1 with MDCCleanerTaskDecorator

use of com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator in project cloudbreak by hortonworks.

the class AppConfig method intermediateBuilderExecutor.

@Bean
public AsyncTaskExecutor intermediateBuilderExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(intermediateCorePoolSize);
    executor.setQueueCapacity(intermediateQueueCapacity);
    executor.setThreadNamePrefix("intermediateBuilderExecutor-");
    executor.setTaskDecorator(new MDCCleanerTaskDecorator());
    executor.initialize();
    return executor;
}
Also used : MDCCleanerTaskDecorator(com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) GenericFilterBean(org.springframework.web.filter.GenericFilterBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with MDCCleanerTaskDecorator

use of com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator in project cloudbreak by hortonworks.

the class AppConfig method resourceBuilderExecutor.

@Bean
public AsyncTaskExecutor resourceBuilderExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(corePoolSize);
    executor.setQueueCapacity(queueCapacity);
    executor.setThreadNamePrefix("resourceBuilderExecutor-");
    executor.setTaskDecorator(new MDCCleanerTaskDecorator());
    executor.initialize();
    return executor;
}
Also used : MDCCleanerTaskDecorator(com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) GenericFilterBean(org.springframework.web.filter.GenericFilterBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with MDCCleanerTaskDecorator

use of com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator in project cloudbreak by hortonworks.

the class AppConfig method containerBootstrapBuilderExecutor.

@Bean
public AsyncTaskExecutor containerBootstrapBuilderExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(containerCorePoolSize);
    executor.setQueueCapacity(containerteQueueCapacity);
    executor.setThreadNamePrefix("containerBootstrapBuilderExecutor-");
    executor.setTaskDecorator(new MDCCleanerTaskDecorator());
    executor.initialize();
    return executor;
}
Also used : MDCCleanerTaskDecorator(com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) GenericFilterBean(org.springframework.web.filter.GenericFilterBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with MDCCleanerTaskDecorator

use of com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator in project cloudbreak by hortonworks.

the class AsyncConfig method getAsyncExecutor.

@Override
public Executor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(CORE_POOL_SIZE);
    executor.setMaxPoolSize(MAX_POOL_SIZE);
    executor.setQueueCapacity(QUEUE_CAPACITY);
    executor.setThreadNamePrefix("asyncExecutor-");
    executor.setTaskDecorator(new MDCCleanerTaskDecorator());
    executor.initialize();
    return executor;
}
Also used : MDCCleanerTaskDecorator(com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)

Aggregations

MDCCleanerTaskDecorator (com.sequenceiq.cloudbreak.concurrent.MDCCleanerTaskDecorator)4 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)4 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)3 Bean (org.springframework.context.annotation.Bean)3 GenericFilterBean (org.springframework.web.filter.GenericFilterBean)3