Commit 54189df 1 parent 99ea15b commit 54189df Copy full SHA for 54189df
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 @@ -94,15 +94,7 @@ public class HttpRemoteTaskFactory
94
94
private final MetadataManager metadataManager ;
95
95
private final QueryManager queryManager ;
96
96
private final DecayCounter taskUpdateRequestSize ;
97
- private final EventLoopGroup eventLoopGroup = new DefaultEventLoopGroup (Runtime .getRuntime ().availableProcessors (),
98
- new ThreadFactoryBuilder ().setNameFormat ("task-event-loop-%s" ).setDaemon (true ).build ())
99
- {
100
- @ Override
101
- protected EventLoop newChild (Executor executor , Object ... args )
102
- {
103
- return new SafeEventLoop (this , executor );
104
- }
105
- };
97
+ private final EventLoopGroup eventLoopGroup ;
106
98
107
99
@ Inject
108
100
public HttpRemoteTaskFactory (
@@ -180,6 +172,15 @@ else if (binaryTransportEnabled) {
180
172
this .queryManager = queryManager ;
181
173
182
174
this .taskUpdateRequestSize = new DecayCounter (ExponentialDecay .oneMinute ());
175
+ this .eventLoopGroup = new DefaultEventLoopGroup (config .getRemoteTaskMaxCallbackThreads (),
176
+ new ThreadFactoryBuilder ().setNameFormat ("task-event-loop-%s" ).setDaemon (true ).build ())
177
+ {
178
+ @ Override
179
+ protected EventLoop newChild (Executor executor , Object ... args )
180
+ {
181
+ return new SafeEventLoop (this , executor );
182
+ }
183
+ };
183
184
}
184
185
185
186
@ 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