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:
parent
dc9b21feac
commit
995f7b0956
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue