private Set<SingularityTaskHistoryUpdate> getFlattenedPreviousUpdates(SingularityTaskHistoryUpdate update) { Set<SingularityTaskHistoryUpdate> previousUpdates = new HashSet<>(); for (SingularityTaskHistoryUpdate previousUpdate : update.getPrevious()) { previousUpdates.add(previousUpdate.withoutPrevious()); previousUpdates.addAll(getFlattenedPreviousUpdates(previousUpdate)); } return previousUpdates; }
private boolean isTaskAlreadyCleanedUpForShuffle(SingularityTaskHistoryUpdate taskHistoryUpdate) { if (taskHistoryUpdate.getStatusMessage().or("").contains(TaskCleanupType.REBALANCE_CPU_USAGE.name())) { return true; } for (SingularityTaskHistoryUpdate previous : taskHistoryUpdate.getPrevious()) { if (previous.getStatusMessage().or("").contains(TaskCleanupType.REBALANCE_CPU_USAGE.name())) { return true; } } return false; }
foundBouncingTask = true; break; } else if (!maybeCleaningUpdate.get().getPrevious().isEmpty()) { for (SingularityTaskHistoryUpdate previousUpdate : maybeCleaningUpdate.get().getPrevious()) { if (previousUpdate.getStatusMessage().or("").contains("BOUNCE")) { LOG.debug("Found task {} still waiting for bounce to complete", activeTaskId);
private boolean isTaskAlreadyCleanedUpForShuffle(SingularityTaskHistoryUpdate taskHistoryUpdate) { if (taskHistoryUpdate.getStatusMessage().or("").contains(TaskCleanupType.REBALANCE_CPU_USAGE.name())) { return true; } for (SingularityTaskHistoryUpdate previous : taskHistoryUpdate.getPrevious()) { if (previous.getStatusMessage().or("").contains(TaskCleanupType.REBALANCE_CPU_USAGE.name())) { return true; } } return false; }
foundBouncingTask = true; break; } else if (!maybeCleaningUpdate.get().getPrevious().isEmpty()) { for (SingularityTaskHistoryUpdate previousUpdate : maybeCleaningUpdate.get().getPrevious()) { if (previousUpdate.getStatusMessage().or("").contains("BOUNCE")) { LOG.debug("Found task {} still waiting for bounce to complete", activeTaskId);