/** * Sets aggressive timeouts for all test routers. */ public void setAggressiveTimeouts(RuntimeLayout runtimeLayout) { // Setting aggressive timeouts List<Integer> serverPorts = new ArrayList<>(); serverPorts.add(SERVERS.PORT_0); serverPorts.add(SERVERS.PORT_1); serverPorts.add(SERVERS.PORT_2); serverPorts.add(SERVERS.PORT_3); serverPorts.add(SERVERS.PORT_4); List<String> routerEndpoints = new ArrayList<>(); routerEndpoints.add(SERVERS.ENDPOINT_0); routerEndpoints.add(SERVERS.ENDPOINT_1); routerEndpoints.add(SERVERS.ENDPOINT_2); routerEndpoints.add(SERVERS.ENDPOINT_3); routerEndpoints.add(SERVERS.ENDPOINT_4); serverPorts.forEach(serverPort -> { routerEndpoints.forEach(routerEndpoint -> { runtimeLayout.getRuntime().getRouter(routerEndpoint).setTimeoutConnect(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtimeLayout.getRuntime().getRouter(routerEndpoint).setTimeoutResponse(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtimeLayout.getRuntime().getRouter(routerEndpoint).setTimeoutRetry(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); }); }); }
/** * Sets aggressive timeouts for all the router endpoints on all the runtimes. * <p> * * @param layout Layout to get all server endpoints. * @param corfuRuntimes All runtimes whose routers' timeouts are to be set. */ public void setAggressiveTimeouts(Layout layout, CorfuRuntime... corfuRuntimes) { layout.getAllServers().forEach(routerEndpoint -> { for (CorfuRuntime runtime : corfuRuntimes) { runtime.getRouter(routerEndpoint).setTimeoutConnect(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtime.getRouter(routerEndpoint).setTimeoutResponse(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtime.getRouter(routerEndpoint).setTimeoutRetry(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); } }); }
/** * Sets aggressive timeouts for all the router endpoints on all the runtimes. * <p> * * @param layout Layout to get all server endpoints. * @param corfuRuntimes All runtimes whose routers' timeouts are to be set. */ public void setAggressiveTimeouts(Layout layout, CorfuRuntime... corfuRuntimes) { layout.getAllServers().forEach(routerEndpoint -> { for (CorfuRuntime runtime : corfuRuntimes) { runtime.getRouter(routerEndpoint).setTimeoutConnect(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtime.getRouter(routerEndpoint).setTimeoutResponse(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); runtime.getRouter(routerEndpoint).setTimeoutRetry(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); } }); }
corfuRuntime.getRouter(serverEndpoint).setTimeoutConnect(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); corfuRuntime.getRouter(serverEndpoint).setTimeoutResponse(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); corfuRuntime.getRouter(serverEndpoint).setTimeoutRetry(PARAMETERS.TIMEOUT_VERY_SHORT.toMillis()); });