/** * Remove all available slots come from specified TaskManager. * * @param taskManager The id of the TaskManager */ void removeAllForTaskManager(final ResourceID taskManager) { // remove from the by-TaskManager view final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.remove(taskManager); if (slotsForTm != null && slotsForTm.size() > 0) { final String host = slotsForTm.iterator().next().getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); // remove from the base set and the by-host view for (AllocatedSlot slot : slotsForTm) { availableSlots.remove(slot.getSlotAllocationId()); slotsForHost.remove(slot); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } } }
/** * Remove all available slots come from specified TaskManager. * * @param taskManager The id of the TaskManager * @return The set of removed slots for the given TaskManager */ Set<AllocatedSlot> removeAllForTaskManager(final ResourceID taskManager) { // remove from the by-TaskManager view final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.remove(taskManager); if (slotsForTm != null && slotsForTm.size() > 0) { final String host = slotsForTm.iterator().next().getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); // remove from the base set and the by-host view for (AllocatedSlot slot : slotsForTm) { availableSlots.remove(slot.getAllocationId()); slotsForHost.remove(slot); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return slotsForTm; } else { return Collections.emptySet(); } }
/** * Remove all available slots come from specified TaskManager. * * @param taskManager The id of the TaskManager * @return The set of removed slots for the given TaskManager */ Set<AllocatedSlot> removeAllForTaskManager(final ResourceID taskManager) { // remove from the by-TaskManager view final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.remove(taskManager); if (slotsForTm != null && slotsForTm.size() > 0) { final String host = slotsForTm.iterator().next().getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); // remove from the base set and the by-host view for (AllocatedSlot slot : slotsForTm) { availableSlots.remove(slot.getAllocationId()); slotsForHost.remove(slot); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return slotsForTm; } else { return Collections.emptySet(); } }
/** * Remove all available slots come from specified TaskManager. * * @param taskManager The id of the TaskManager * @return The set of removed slots for the given TaskManager */ Set<AllocatedSlot> removeAllForTaskManager(final ResourceID taskManager) { // remove from the by-TaskManager view final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.remove(taskManager); if (slotsForTm != null && slotsForTm.size() > 0) { final String host = slotsForTm.iterator().next().getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); // remove from the base set and the by-host view for (AllocatedSlot slot : slotsForTm) { availableSlots.remove(slot.getAllocationId()); slotsForHost.remove(slot); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return slotsForTm; } else { return Collections.emptySet(); } }
boolean tryRemove(AllocationID slotId) { final SlotAndTimestamp sat = availableSlots.remove(slotId); if (sat != null) { final AllocatedSlot slot = sat.slot(); final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.get(resourceID); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); slotsForTm.remove(slot); slotsForHost.remove(slot); if (slotsForTm.isEmpty()) { availableSlotsByTaskManager.remove(resourceID); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return true; } else { return false; } }
AllocatedSlot tryRemove(AllocationID slotId) { final SlotAndTimestamp sat = availableSlots.remove(slotId); if (sat != null) { final AllocatedSlot slot = sat.slot(); final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.get(resourceID); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); slotsForTm.remove(slot); slotsForHost.remove(slot); if (slotsForTm.isEmpty()) { availableSlotsByTaskManager.remove(resourceID); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return slot; } else { return null; } }
boolean tryRemove(AllocationID slotId) { final SlotAndTimestamp sat = availableSlots.remove(slotId); if (sat != null) { final AllocatedSlot slot = sat.slot(); final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.get(resourceID); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); slotsForTm.remove(slot); slotsForHost.remove(slot); if (slotsForTm.isEmpty()) { availableSlotsByTaskManager.remove(resourceID); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return true; } else { return false; } }
AllocatedSlot tryRemove(AllocationID slotId) { final SlotAndTimestamp sat = availableSlots.remove(slotId); if (sat != null) { final AllocatedSlot slot = sat.slot(); final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); final Set<AllocatedSlot> slotsForTm = availableSlotsByTaskManager.get(resourceID); final Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); slotsForTm.remove(slot); slotsForHost.remove(slot); if (slotsForTm.isEmpty()) { availableSlotsByTaskManager.remove(resourceID); } if (slotsForHost.isEmpty()) { availableSlotsByHost.remove(host); } return slot; } else { return null; } }
preferredFQHostNames.merge(locationPreference.getFQDNHostname(), 1, Integer::sum); Integer hostLocalWeigh = preferredFQHostNames.getOrDefault(slotContext.getTaskManagerLocation().getFQDNHostname(), 0);
preferredFQHostNames.merge(locationPreference.getFQDNHostname(), 1, Integer::sum); Integer hostLocalWeigh = preferredFQHostNames.getOrDefault(slotContext.getTaskManagerLocation().getFQDNHostname(), 0);
location.getFQDNHostname() + ':' + location.dataPort() : "(unassigned)";
/** * Adds an available slot. * * @param slot The slot to add */ void add(final AllocatedSlot slot, final long timestamp) { checkNotNull(slot); SlotAndTimestamp previous = availableSlots.put( slot.getSlotAllocationId(), new SlotAndTimestamp(slot, timestamp)); if (previous == null) { final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); Set<AllocatedSlot> slotsForTaskManager = availableSlotsByTaskManager.get(resourceID); if (slotsForTaskManager == null) { slotsForTaskManager = new HashSet<>(); availableSlotsByTaskManager.put(resourceID, slotsForTaskManager); } slotsForTaskManager.add(slot); Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); if (slotsForHost == null) { slotsForHost = new HashSet<>(); availableSlotsByHost.put(host, slotsForHost); } slotsForHost.add(slot); } else { throw new IllegalStateException("slot already contained"); } }
/** * Adds an available slot. * * @param slot The slot to add */ void add(final AllocatedSlot slot, final long timestamp) { checkNotNull(slot); SlotAndTimestamp previous = availableSlots.put( slot.getAllocationId(), new SlotAndTimestamp(slot, timestamp)); if (previous == null) { final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); Set<AllocatedSlot> slotsForTaskManager = availableSlotsByTaskManager.get(resourceID); if (slotsForTaskManager == null) { slotsForTaskManager = new HashSet<>(); availableSlotsByTaskManager.put(resourceID, slotsForTaskManager); } slotsForTaskManager.add(slot); Set<AllocatedSlot> slotsForHost = availableSlotsByHost.get(host); if (slotsForHost == null) { slotsForHost = new HashSet<>(); availableSlotsByHost.put(host, slotsForHost); } slotsForHost.add(slot); } else { throw new IllegalStateException("slot already contained"); } }
/** * Adds an available slot. * * @param slot The slot to add */ void add(final AllocatedSlot slot, final long timestamp) { checkNotNull(slot); SlotAndTimestamp previous = availableSlots.put( slot.getAllocationId(), new SlotAndTimestamp(slot, timestamp)); if (previous == null) { final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); Set<AllocatedSlot> slotsForTaskManager = availableSlotsByTaskManager.computeIfAbsent(resourceID, k -> new HashSet<>()); slotsForTaskManager.add(slot); Set<AllocatedSlot> slotsForHost = availableSlotsByHost.computeIfAbsent(host, k -> new HashSet<>()); slotsForHost.add(slot); } else { throw new IllegalStateException("slot already contained"); } }
/** * Adds an available slot. * * @param slot The slot to add */ void add(final AllocatedSlot slot, final long timestamp) { checkNotNull(slot); SlotAndTimestamp previous = availableSlots.put( slot.getAllocationId(), new SlotAndTimestamp(slot, timestamp)); if (previous == null) { final ResourceID resourceID = slot.getTaskManagerLocation().getResourceID(); final String host = slot.getTaskManagerLocation().getFQDNHostname(); Set<AllocatedSlot> slotsForTaskManager = availableSlotsByTaskManager.computeIfAbsent(resourceID, k -> new HashSet<>()); slotsForTaskManager.add(slot); Set<AllocatedSlot> slotsForHost = availableSlotsByHost.computeIfAbsent(host, k -> new HashSet<>()); slotsForHost.add(slot); } else { throw new IllegalStateException("slot already contained"); } }
location.getFQDNHostname() + ':' + location.dataPort() : "(unassigned)"; long timestamp = task.getStateTimestamp(ExecutionState.FAILED); taskExceptionList.add(new JobExceptionsInfo.ExecutionExceptionInfo(
location.getFQDNHostname() + ':' + location.dataPort() : "(unassigned)"; long timestamp = task.getStateTimestamp(ExecutionState.FAILED); taskExceptionList.add(new JobExceptionsInfo.ExecutionExceptionInfo(
private static JobExceptionsInfo.ExecutionExceptionInfo generateExecutionExceptionInfo(AccessExecutionJobVertex jobVertex, AccessExecutionVertex executionVertex, AccessExecution task) { String t = task != null ? task.getFailureCauseAsString() : null; if (t != null && !t.equals(ExceptionUtils.STRINGIFIED_NULL_EXCEPTION)) { TaskManagerLocation location = task.getAssignedResourceLocation(); String locationString = location != null ? location.getFQDNHostname() + ':' + location.dataPort() : "(unassigned)"; long timestamp = task.getStateTimestamp(ExecutionState.FAILED); return new JobExceptionsInfo.ExecutionExceptionInfo( t, executionVertex.getTaskNameWithSubtaskIndex(), locationString, timestamp == 0 ? -1 : timestamp, jobVertex.getJobVertexId().toString(), task.getParallelSubtaskIndex(), task.getAttemptNumber()); } else { return null; } } }
final Set<AllocatedSlot> onHost = availableSlotsByHost.get(location.getFQDNHostname()); if (onHost != null) { for (AllocatedSlot candidate : onHost) {
location.getFQDNHostname() + ':' + location.dataPort() : "(unassigned)";