Skip to content

Commit

Permalink
Remove unnecessary ExecutorService wrapper from HttpRemoteTaskFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
erichwang committed Nov 4, 2015
1 parent fd6dc87 commit 1cdc9ca
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -30,7 +30,6 @@
import com.facebook.presto.sql.planner.plan.PlanNodeId;
import com.google.common.collect.Multimap;
import io.airlift.concurrent.BoundedExecutor;
import io.airlift.concurrent.ExecutorServiceAdapter;
import io.airlift.concurrent.ThreadPoolExecutorMBean;
import io.airlift.http.client.HttpClient;
import io.airlift.json.JsonCodec;
Expand All @@ -40,6 +39,7 @@

import javax.inject.Inject;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
Expand All @@ -57,7 +57,7 @@ public class HttpRemoteTaskFactory
private final JsonCodec<TaskUpdateRequest> taskUpdateRequestCodec;
private final Duration minErrorDuration;
private final Duration taskInfoRefreshMaxWait;
private final ExecutorService executor;
private final Executor executor;
private final ThreadPoolExecutorMBean executorMBean;
private final ScheduledExecutorService errorScheduledExecutor;

Expand All @@ -76,7 +76,7 @@ public HttpRemoteTaskFactory(QueryManagerConfig config,
this.minErrorDuration = config.getRemoteTaskMinErrorDuration();
this.taskInfoRefreshMaxWait = taskConfig.getInfoRefreshMaxWait();
ExecutorService coreExecutor = newCachedThreadPool(daemonThreadsNamed("remote-task-callback-%s"));
this.executor = ExecutorServiceAdapter.from(new BoundedExecutor(coreExecutor, config.getRemoteTaskMaxCallbackThreads()));
this.executor = new BoundedExecutor(coreExecutor, config.getRemoteTaskMaxCallbackThreads());
this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) coreExecutor);

this.errorScheduledExecutor = newSingleThreadScheduledExecutor(daemonThreadsNamed("remote-task-error-delay-%s"));
Expand Down

0 comments on commit 1cdc9ca

Please sign in to comment.