Skip to content

Commit

Permalink
[native pos] Drop unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
arhimondr committed Jan 10, 2024
1 parent 75a6e4f commit 700df7a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.facebook.airlift.log.Logger;
import com.facebook.presto.Session;
import com.facebook.presto.client.ServerInfo;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.spark.execution.property.WorkerProperty;
import io.airlift.units.Duration;

Expand Down Expand Up @@ -46,7 +45,6 @@ public DetachedNativeExecutionProcess(
ScheduledExecutorService errorRetryScheduledExecutor,
JsonCodec<ServerInfo> serverInfoCodec,
Duration maxErrorDuration,
TaskManagerConfig taskManagerConfig,
WorkerProperty<?, ?, ?, ?> workerProperty) throws IOException
{
super(session,
Expand All @@ -55,7 +53,6 @@ public DetachedNativeExecutionProcess(
errorRetryScheduledExecutor,
serverInfoCodec,
maxErrorDuration,
taskManagerConfig,
workerProperty);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.facebook.airlift.json.JsonCodec;
import com.facebook.presto.Session;
import com.facebook.presto.client.ServerInfo;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.spark.execution.property.WorkerProperty;
import com.facebook.presto.spark.execution.task.ForNativeExecutionTask;
import com.facebook.presto.spi.PrestoException;
Expand All @@ -40,7 +39,6 @@ public class DetachedNativeExecutionProcessFactory
private final HttpClient httpClient;
private final ScheduledExecutorService errorRetryScheduledExecutor;
private final JsonCodec<ServerInfo> serverInfoCodec;
private final TaskManagerConfig taskManagerConfig;
private final WorkerProperty<?, ?, ?, ?> workerProperty;

@Inject
Expand All @@ -49,14 +47,12 @@ public DetachedNativeExecutionProcessFactory(
ExecutorService coreExecutor,
ScheduledExecutorService errorRetryScheduledExecutor,
JsonCodec<ServerInfo> serverInfoCodec,
TaskManagerConfig taskManagerConfig,
WorkerProperty<?, ?, ?, ?> workerProperty)
{
super(httpClient, coreExecutor, errorRetryScheduledExecutor, serverInfoCodec, taskManagerConfig, workerProperty);
super(httpClient, coreExecutor, errorRetryScheduledExecutor, serverInfoCodec, workerProperty);
this.httpClient = requireNonNull(httpClient, "httpClient is null");
this.errorRetryScheduledExecutor = requireNonNull(errorRetryScheduledExecutor, "errorRetryScheduledExecutor is null");
this.serverInfoCodec = requireNonNull(serverInfoCodec, "serverInfoCodec is null");
this.taskManagerConfig = requireNonNull(taskManagerConfig, "taskManagerConfig is null");
this.workerProperty = requireNonNull(workerProperty, "workerProperty is null");
}

Expand All @@ -82,7 +78,6 @@ public NativeExecutionProcess createNativeExecutionProcess(
errorRetryScheduledExecutor,
serverInfoCodec,
maxErrorDuration,
taskManagerConfig,
workerProperty);
}
catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.facebook.presto.Session;
import com.facebook.presto.SystemSessionProperties;
import com.facebook.presto.client.ServerInfo;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.server.RequestErrorTracker;
import com.facebook.presto.server.smile.BaseResponse;
import com.facebook.presto.spark.classloader_interface.PrestoSparkFatalException;
Expand Down Expand Up @@ -77,7 +76,6 @@ public class NativeExecutionProcess
private final PrestoSparkHttpServerClient serverClient;
private final URI location;
private final int port;
private final TaskManagerConfig taskManagerConfig;
private final ScheduledExecutorService errorRetryScheduledExecutor;
private final RequestErrorTracker errorTracker;
private final HttpClient httpClient;
Expand All @@ -92,7 +90,6 @@ public NativeExecutionProcess(
ScheduledExecutorService errorRetryScheduledExecutor,
JsonCodec<ServerInfo> serverInfoCodec,
Duration maxErrorDuration,
TaskManagerConfig taskManagerConfig,
WorkerProperty<?, ?, ?, ?> workerProperty)
throws IOException
{
Expand All @@ -104,7 +101,6 @@ public NativeExecutionProcess(
this.httpClient,
location,
serverInfoCodec);
this.taskManagerConfig = requireNonNull(taskManagerConfig, "taskManagerConfig is null");
this.errorRetryScheduledExecutor = requireNonNull(errorRetryScheduledExecutor, "errorRetryScheduledExecutor is null");
this.errorTracker = new RequestErrorTracker(
"NativeExecution",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.facebook.airlift.json.JsonCodec;
import com.facebook.presto.Session;
import com.facebook.presto.client.ServerInfo;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.spark.execution.property.WorkerProperty;
import com.facebook.presto.spark.execution.task.ForNativeExecutionTask;
import com.facebook.presto.spi.PrestoException;
Expand Down Expand Up @@ -45,7 +44,6 @@ public class NativeExecutionProcessFactory
private final ExecutorService coreExecutor;
private final ScheduledExecutorService errorRetryScheduledExecutor;
private final JsonCodec<ServerInfo> serverInfoCodec;
private final TaskManagerConfig taskManagerConfig;
private final WorkerProperty<?, ?, ?, ?> workerProperty;

private static NativeExecutionProcess process;
Expand All @@ -56,15 +54,13 @@ public NativeExecutionProcessFactory(
ExecutorService coreExecutor,
ScheduledExecutorService errorRetryScheduledExecutor,
JsonCodec<ServerInfo> serverInfoCodec,
TaskManagerConfig taskManagerConfig,
WorkerProperty<?, ?, ?, ?> workerProperty)

{
this.httpClient = requireNonNull(httpClient, "httpClient is null");
this.coreExecutor = requireNonNull(coreExecutor, "coreExecutor is null");
this.errorRetryScheduledExecutor = requireNonNull(errorRetryScheduledExecutor, "errorRetryScheduledExecutor is null");
this.serverInfoCodec = requireNonNull(serverInfoCodec, "serverInfoCodec is null");
this.taskManagerConfig = requireNonNull(taskManagerConfig, "taskManagerConfig is null");
this.workerProperty = requireNonNull(workerProperty, "workerProperty is null");
}

Expand All @@ -91,7 +87,6 @@ public NativeExecutionProcess createNativeExecutionProcess(
errorRetryScheduledExecutor,
serverInfoCodec,
maxErrorDuration,
taskManagerConfig,
workerProperty);
}
catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.facebook.presto.Session;
import com.facebook.presto.client.ServerInfo;
import com.facebook.presto.execution.TaskId;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.spark.classloader_interface.PrestoSparkFatalException;
import com.facebook.presto.spark.execution.http.TestPrestoSparkHttpClient;
import com.facebook.presto.spark.execution.nativeprocess.NativeExecutionProcess;
Expand Down Expand Up @@ -106,7 +105,6 @@ private NativeExecutionProcessFactory createNativeExecutionProcessFactory()
newSingleThreadExecutor(),
errorScheduler,
SERVER_INFO_JSON_CODEC,
new TaskManagerConfig(),
workerProperty);
return factory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ public void testGetServerInfoWithRetry()
Duration maxTimeout = new Duration(1, TimeUnit.MINUTES);
NativeExecutionProcess process = createNativeExecutionProcess(
maxTimeout,
new TestingResponseManager(taskId.toString(), new FailureRetryResponseManager(5)),
new TaskManagerConfig());
new TestingResponseManager(taskId.toString(), new FailureRetryResponseManager(5)));

SettableFuture<ServerInfo> future = process.getServerInfoWithRetry();
try {
Expand All @@ -303,8 +302,7 @@ public void testGetServerInfoWithRetryTimeout()
Duration maxTimeout = new Duration(0, TimeUnit.MILLISECONDS);
NativeExecutionProcess process = createNativeExecutionProcess(
maxTimeout,
new TestingResponseManager(taskId.toString(), new FailureRetryResponseManager(5)),
new TaskManagerConfig());
new TestingResponseManager(taskId.toString(), new FailureRetryResponseManager(5)));

SettableFuture<ServerInfo> future = process.getServerInfoWithRetry();
Exception exception = expectThrows(ExecutionException.class, future::get);
Expand Down Expand Up @@ -772,8 +770,7 @@ public void testNativeExecutionTask()

private NativeExecutionProcess createNativeExecutionProcess(
Duration maxErrorDuration,
TestingResponseManager responseManager,
TaskManagerConfig config)
TestingResponseManager responseManager)
{
ScheduledExecutorService errorScheduler = newScheduledThreadPool(4);
PrestoSparkWorkerProperty workerProperty = new PrestoSparkWorkerProperty(
Expand All @@ -786,7 +783,6 @@ private NativeExecutionProcess createNativeExecutionProcess(
newSingleThreadExecutor(),
errorScheduler,
SERVER_INFO_JSON_CODEC,
config,
workerProperty);
return factory.createNativeExecutionProcess(
testSessionBuilder().build(),
Expand Down

0 comments on commit 700df7a

Please sign in to comment.