[
https://issues.apache.org/jira/browse/HDFS-16597?focusedWorklogId=775547&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-775547
]
ASF GitHub Bot logged work on HDFS-16597:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/May/22 18:06
Start Date: 27/May/22 18:06
Worklog Time Spent: 10m
Work Description: goiri commented on code in PR #4362:
URL: https://github.com/apache/hadoop/pull/4362#discussion_r883871623
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:
##########
@@ -2061,12 +2060,7 @@ public DatanodeInfo[] load(DatanodeReportType type)
throws Exception {
public ListenableFuture<DatanodeInfo[]> reload(
final DatanodeReportType type, DatanodeInfo[] oldValue)
throws Exception {
- return executorService.submit(new Callable<DatanodeInfo[]>() {
- @Override
- public DatanodeInfo[] call() throws Exception {
- return load(type);
- }
- });
+ return executorService.submit(() -> load(type));
Review Comment:
One of the reasons to not use this syntax was to keep some backwards
compatibility with branch-2.
I guess that's long gone so let's go ahead.
Issue Time Tracking
-------------------
Worklog Id: (was: 775547)
Time Spent: 40m (was: 0.5h)
> RBF: Improve RouterRpcServer#reload With Lambda
> -----------------------------------------------
>
> Key: HDFS-16597
> URL: https://issues.apache.org/jira/browse/HDFS-16597
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: rbf
> Affects Versions: 3.4.0
> Reporter: fanshilun
> Assignee: fanshilun
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When reading the code, I found that RouterRpcServer#reload uses the following
> method to submit threads
> RouterRpcServer#reload
> {code:java}
> public ListenableFuture<DatanodeInfo[]> reload(
> final DatanodeReportType type, DatanodeInfo[] oldValue)
> throws Exception {
> return executorService.submit(new Callable<DatanodeInfo[]>() {
> @Override
> public DatanodeInfo[] call() throws Exception {
> return load(type);
> }
> });
> } {code}
> This place is better to use lambda way
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]