@Inject public StatementHttpExecutionMBean(@ForStatementResource ExecutorService responseExecutor, @ForStatementResource ScheduledExecutorService timeoutExecutor) { requireNonNull(responseExecutor, "responseExecutor is null"); requireNonNull(timeoutExecutor, "timeoutExecutor is null"); this.responseExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) responseExecutor); this.timeoutExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) timeoutExecutor); }
public TaskManagementExecutor() { taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s")); taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor); }
@Inject public QueryExecutionMBean(@ForQueryExecution ExecutorService executor) { this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); }
@Inject public AsyncHttpExecutionMBean(@ForAsyncHttp ExecutorService responseExecutor, @ForAsyncHttp ScheduledExecutorService timeoutExecutor) { requireNonNull(responseExecutor, "responseExecutor is null"); requireNonNull(timeoutExecutor, "timeoutExecutor is null"); this.responseExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) responseExecutor); this.timeoutExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) timeoutExecutor); }
@Inject public ExchangeExecutionMBean(@ForExchange ScheduledExecutorService executor) { requireNonNull(executor, "executor is null"); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); }
@VisibleForTesting public TaskExecutor( int runnerThreads, int minDrivers, int guaranteedNumberOfDriversPerTask, int maximumNumberOfDriversPerTask, EmbedVersion embedVersion, MultilevelSplitQueue splitQueue, Ticker ticker) { checkArgument(runnerThreads > 0, "runnerThreads must be at least 1"); checkArgument(guaranteedNumberOfDriversPerTask > 0, "guaranteedNumberOfDriversPerTask must be at least 1"); checkArgument(maximumNumberOfDriversPerTask > 0, "maximumNumberOfDriversPerTask must be at least 1"); checkArgument(guaranteedNumberOfDriversPerTask <= maximumNumberOfDriversPerTask, "guaranteedNumberOfDriversPerTask cannot be greater than maximumNumberOfDriversPerTask"); // we manage thread pool size directly, so create an unlimited pool this.executor = newCachedThreadPool(threadsNamed("task-processor-%s")); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); this.runnerThreads = runnerThreads; this.embedVersion = requireNonNull(embedVersion, "embedVersion is null"); this.ticker = requireNonNull(ticker, "ticker is null"); this.minimumNumberOfDrivers = minDrivers; this.guaranteedNumberOfDriversPerTask = guaranteedNumberOfDriversPerTask; this.maximumNumberOfDriversPerTask = maximumNumberOfDriversPerTask; this.waitingSplits = requireNonNull(splitQueue, "splitQueue is null"); this.tasks = new LinkedList<>(); }
this.queryExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) queryExecutor); queryManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) queryManagementExecutor);
this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) pageBufferClientCallbackExecutor);
@Inject public HttpRemoteTaskFactory(QueryManagerConfig config, TaskManagerConfig taskConfig, @ForScheduler HttpClient httpClient, LocationFactory locationFactory, JsonCodec<TaskStatus> taskStatusCodec, JsonCodec<TaskInfo> taskInfoCodec, JsonCodec<TaskUpdateRequest> taskUpdateRequestCodec, RemoteTaskStats stats) { this.httpClient = httpClient; this.locationFactory = locationFactory; this.taskStatusCodec = taskStatusCodec; this.taskInfoCodec = taskInfoCodec; this.taskUpdateRequestCodec = taskUpdateRequestCodec; this.maxErrorDuration = config.getRemoteTaskMaxErrorDuration(); this.taskStatusRefreshMaxWait = taskConfig.getStatusRefreshMaxWait(); this.taskInfoUpdateInterval = taskConfig.getInfoUpdateInterval(); this.coreExecutor = newCachedThreadPool(daemonThreadsNamed("remote-task-callback-%s")); this.executor = new BoundedExecutor(coreExecutor, config.getRemoteTaskMaxCallbackThreads()); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) coreExecutor); this.stats = requireNonNull(stats, "stats is null"); this.updateScheduledExecutor = newSingleThreadScheduledExecutor(daemonThreadsNamed("task-info-update-scheduler-%s")); this.errorScheduledExecutor = newSingleThreadScheduledExecutor(daemonThreadsNamed("remote-task-error-delay-%s")); }
taskNotificationExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskNotificationExecutor);
@Inject public Announcer(DiscoveryAnnouncementClient announcementClient, Set<ServiceAnnouncement> serviceAnnouncements) { requireNonNull(announcementClient, "client is null"); requireNonNull(serviceAnnouncements, "serviceAnnouncements is null"); this.announcementClient = announcementClient; serviceAnnouncements.forEach(this::addServiceAnnouncement); executor = new ScheduledThreadPoolExecutor(5, daemonThreadsNamed("Announcer-%s")); executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); }
public ShardOrganizer(JobFactory jobFactory, int threads) { checkArgument(threads > 0, "threads must be > 0"); this.jobFactory = requireNonNull(jobFactory, "jobFactory is null"); this.executorService = newFixedThreadPool(threads, daemonThreadsNamed("shard-organizer-%s")); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executorService); }
public ShardOrganizer(JobFactory jobFactory, int threads) { checkArgument(threads > 0, "threads must be > 0"); this.jobFactory = requireNonNull(jobFactory, "jobFactory is null"); this.executorService = newFixedThreadPool(threads, daemonThreadsNamed("shard-organizer-%s")); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executorService); }
@Inject public QueryExecutionMBean(@ForQueryExecution ExecutorService executor) { this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); }
public TaskManagementExecutor() { taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s")); taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor); }
@Inject public ExchangeExecutionMBean(@ForExchange ScheduledExecutorService executor) { requireNonNull(executor, "executor is null"); this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor); }
@Inject public AsyncHttpExecutionMBean(@ForAsyncHttp ExecutorService responseExecutor, @ForAsyncHttp ScheduledExecutorService timeoutExecutor) { requireNonNull(responseExecutor, "responseExecutor is null"); requireNonNull(timeoutExecutor, "timeoutExecutor is null"); this.responseExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) responseExecutor); this.timeoutExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) timeoutExecutor); }
@Inject public StatementHttpExecutionMBean(@ForStatementResource ExecutorService responseExecutor, @ForStatementResource ScheduledExecutorService timeoutExecutor) { requireNonNull(responseExecutor, "responseExecutor is null"); requireNonNull(timeoutExecutor, "timeoutExecutor is null"); this.responseExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) responseExecutor); this.timeoutExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) timeoutExecutor); }
@Inject public StatementHttpExecutionMBean(@ForStatementResource ExecutorService responseExecutor, @ForStatementResource ScheduledExecutorService timeoutExecutor) { requireNonNull(responseExecutor, "responseExecutor is null"); requireNonNull(timeoutExecutor, "timeoutExecutor is null"); this.responseExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) responseExecutor); this.timeoutExecutor = new ThreadPoolExecutorMBean((ThreadPoolExecutor) timeoutExecutor); }
public TaskManagementExecutor() { taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s")); taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor); }