HDFS-16597. RBF: Improve RouterRpcServer#reload With Lambda (#4362). Contributed by fanshilun.

Reviewed-by: Inigo Goiri <inigoiri@apache.org>
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
slfan1989 2022-05-27 21:18:34 -07:00 committed by GitHub
parent dc9b21feac
commit 995f7b0956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -49,7 +49,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
@ -2061,12 +2060,7 @@ public class RouterRpcServer extends AbstractService implements ClientProtocol,
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));
}
}
}

View File

@ -68,7 +68,7 @@ public class TestRouterRPCClientRetries {
private static ClientProtocol routerProtocol;
@Rule
public final Timeout testTimeout = new Timeout(100000);
public final Timeout testTimeout = new Timeout(100000L, TimeUnit.MILLISECONDS);
@Before
public void setUp() throws Exception {