Source:
public void updateExecutorEntry(final Set<String> addedWorkers, final Set<String> deletedWorkers, final Set<String> addedServers, final Set<String> deletedServers) { final int numPrevWorkers = workerExecutors.size(); final int numPrevServers = serverExecutors.size(); for (final String addedWorker : addedWorkers) { final RunningTasklet tasklet; final AllocatedExecutor executor; try { executor = etMaster.getExecutor(addedWorker); tasklet = executor.getRunningTasklet(jobId + "-" + WorkerTasklet.TASKLET_ID_PREFIX); if (tasklet == null) { throw new RuntimeException(String.format("Task is not running on the executor %s", addedWorker)); } } catch (ExecutorNotExistException e) { throw new RuntimeException(e); } workerExecutors.put(executor.getId(), executor); executorIdToTasklet.put(addedWorker, tasklet); } for (final String addedServer : addedServers) { final AllocatedExecutor executor; try { executor = etMaster.getExecutor(addedServer); } catch (ExecutorNotExistException e) { throw new RuntimeException(e); } serverExecutors.put(executor.getId(), executor); } workerExecutors.keySet().removeAll(deletedWorkers); serverExecutors.keySet().removeAll(deletedServers); executorIdToTasklet.keySet().removeAll(deletedWorkers); final int numAfterWorkers = workerExecutors.size(); final int numAfterServers = serverExecutors.size(); if (numPrevWorkers != numAfterWorkers || numPrevServers != numAfterServers) { final String msgToClient = String.format("(S: %d, W: %d) -> (S: %d, W: %d)", numPrevServers, numPrevWorkers, numAfterServers, numAfterWorkers); jobMessageObserver.sendMessageToClient(msgToClient.getBytes(StandardCharsets.UTF_8)); } }

Target:
public void updateExecutorEntry(final Set<String> addedWorkers, final Set<String> deletedWorkers, final Set<String> addedServers, final Set<String> deletedServers) { final int numPrevWorkers = workerExecutors.size(); final int numPrevServers = serverExecutors.size(); for (final String addedWorker : addedWorkers) { final RunningTasklet tasklet; final AllocatedExecutor executor; try { executor = etMaster.getExecutor(addedWorker); tasklet = executor.getRunningTasklet(jobId + "-" + WorkerTasklet.TASKLET_ID); if (tasklet == null) { throw new RuntimeException(String.format("Task is not running on the executor %s", addedWorker)); } } catch (ExecutorNotExistException e) { throw new RuntimeException(e); } workerExecutors.put(executor.getId(), executor); executorIdToTasklet.put(addedWorker, tasklet); } for (final String addedServer : addedServers) { final AllocatedExecutor executor; try { executor = etMaster.getExecutor(addedServer); } catch (ExecutorNotExistException e) { throw new RuntimeException(e); } serverExecutors.put(executor.getId(), executor); } workerExecutors.keySet().removeAll(deletedWorkers); serverExecutors.keySet().removeAll(deletedServers); executorIdToTasklet.keySet().removeAll(deletedWorkers); final int numAfterWorkers = workerExecutors.size(); final int numAfterServers = serverExecutors.size(); if (numPrevWorkers != numAfterWorkers || numPrevServers != numAfterServers) { final String msgToClient = String.format("(S: %d, W: %d) -> (S: %d, W: %d)", numPrevServers, numPrevWorkers, numAfterServers, numAfterWorkers); jobMessageObserver.sendMessageToClient(msgToClient.getBytes(StandardCharsets.UTF_8)); } }