-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17766. [ARR] Avoid initializing unused threadPool in RouterAsyncRpcClient. #7561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
e2967c0
c6db077
ebc8277
87f268c
bb8991b
b5c60c9
1e8c60b
74c17bc
3f0eaa4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,8 +199,13 @@ | |
| } else { | ||
| workQueue = new LinkedBlockingQueue<>(); | ||
| } | ||
| this.executorService = new ThreadPoolExecutor(numThreads, numThreads, | ||
| 0L, TimeUnit.MILLISECONDS, workQueue, threadFactory); | ||
|
|
||
|
Check failure on line 202 in hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java
|
||
| if (router.isAsync()) { | ||
| this.executorService = null; | ||
| } else { | ||
| this.executorService = new ThreadPoolExecutor(numThreads, numThreads, | ||
| 0L, TimeUnit.MILLISECONDS, workQueue, threadFactory); | ||
| } | ||
|
||
|
|
||
| this.rpcMonitor = monitor; | ||
|
|
||
|
|
@@ -364,9 +369,11 @@ | |
| */ | ||
| public String getAsyncCallerPoolJson() { | ||
| final Map<String, Integer> info = new LinkedHashMap<>(); | ||
| info.put("active", executorService.getActiveCount()); | ||
| info.put("total", executorService.getPoolSize()); | ||
| info.put("max", executorService.getMaximumPoolSize()); | ||
| if (executorService != null) { | ||
| info.put("active", executorService.getActiveCount()); | ||
| info.put("total", executorService.getPoolSize()); | ||
| info.put("max", executorService.getMaximumPoolSize()); | ||
| } | ||
| return JSON.toString(info); | ||
| } | ||
|
|
||
|
|
@@ -2027,7 +2034,6 @@ | |
| return isUnavailableException(ioe); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * The {@link ExecutionStatus} class is a utility class used to track the status of | ||
| * execution operations performed by the {@link RouterRpcClient}. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hfutatzhanghb Can this method be deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KeeProMise Nice advise, have deleted it.