Commit 03b8cd9 1 parent 6f16d8c commit 03b8cd9 Copy full SHA for 03b8cd9
File tree 3 files changed +12
-11
lines changed
main/java/com/facebook/presto
test/java/com/facebook/presto/execution
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public class QueryManagerConfig
70
70
private int queryManagerExecutorPoolSize = 5 ;
71
71
72
72
private Duration remoteTaskMaxErrorDuration = new Duration (5 , TimeUnit .MINUTES );
73
- private int remoteTaskMaxCallbackThreads = 1000 ;
73
+ private int remoteTaskMaxCallbackThreads = Runtime . getRuntime (). availableProcessors () ;
74
74
75
75
private String queryExecutionPolicy = "all-at-once" ;
76
76
private Duration queryMaxRunTime = new Duration (100 , TimeUnit .DAYS );
Original file line number Diff line number Diff line change @@ -95,15 +95,7 @@ public class HttpRemoteTaskFactory
95
95
private final QueryManager queryManager ;
96
96
private final DecayCounter taskUpdateRequestSize ;
97
97
private final boolean taskUpdateSizeTrackingEnabled ;
98
- private final EventLoopGroup eventLoopGroup = new DefaultEventLoopGroup (Runtime .getRuntime ().availableProcessors (),
99
- new ThreadFactoryBuilder ().setNameFormat ("task-event-loop-%s" ).setDaemon (true ).build ())
100
- {
101
- @ Override
102
- protected EventLoop newChild (Executor executor , Object ... args )
103
- {
104
- return new SafeEventLoop (this , executor );
105
- }
106
- };
98
+ private final EventLoopGroup eventLoopGroup ;
107
99
108
100
@ Inject
109
101
public HttpRemoteTaskFactory (
@@ -182,6 +174,15 @@ else if (binaryTransportEnabled) {
182
174
183
175
this .taskUpdateRequestSize = new DecayCounter (ExponentialDecay .oneMinute ());
184
176
this .taskUpdateSizeTrackingEnabled = taskConfig .isTaskUpdateSizeTrackingEnabled ();
177
+ this .eventLoopGroup = new DefaultEventLoopGroup (config .getRemoteTaskMaxCallbackThreads (),
178
+ new ThreadFactoryBuilder ().setNameFormat ("task-event-loop-%s" ).setDaemon (true ).build ())
179
+ {
180
+ @ Override
181
+ protected EventLoop newChild (Executor executor , Object ... args )
182
+ {
183
+ return new SafeEventLoop (this , executor );
184
+ }
185
+ };
185
186
}
186
187
187
188
@ Managed
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public void testDefaults()
59
59
.setQueryManagerExecutorPoolSize (5 )
60
60
.setRemoteTaskMinErrorDuration (new Duration (5 , TimeUnit .MINUTES ))
61
61
.setRemoteTaskMaxErrorDuration (new Duration (5 , TimeUnit .MINUTES ))
62
- .setRemoteTaskMaxCallbackThreads (1000 )
62
+ .setRemoteTaskMaxCallbackThreads (Runtime . getRuntime (). availableProcessors () )
63
63
.setQueryExecutionPolicy ("all-at-once" )
64
64
.setQueryMaxRunTime (new Duration (100 , TimeUnit .DAYS ))
65
65
.setQueryMaxExecutionTime (new Duration (100 , TimeUnit .DAYS ))
You can’t perform that action at this time.
0 commit comments