/** * Mark a container finished; if it was released then that is treated * differently. history is {@code touch()}-ed * * * @param container completed container * @param wasReleased was the container released? * @param shortLived was the container short lived? * @param outcome * @return true if the node was queued */ protected synchronized boolean markContainerFinished(Container container, boolean wasReleased, boolean shortLived, ContainerOutcome outcome) { NodeEntry nodeEntry = getOrCreateNodeEntry(container); log.info("Finished container for node {}, released={}, shortlived={}", nodeEntry.rolePriority, wasReleased, shortLived); boolean available; if (shortLived) { nodeEntry.onStartFailed(); available = false; } else { available = nodeEntry.containerCompleted(wasReleased, outcome); maybeQueueNodeForWork(container, nodeEntry, available); } touch(); return available; }
/** * Mark a container finished; if it was released then that is treated * differently. history is {@code touch()}-ed * * * @param container completed container * @param wasReleased was the container released? * @param shortLived was the container short lived? * @param outcome * @return true if the node was queued */ protected synchronized boolean markContainerFinished(Container container, boolean wasReleased, boolean shortLived, ContainerOutcome outcome) { NodeEntry nodeEntry = getOrCreateNodeEntry(container); log.info("Finished container for node {}, released={}, shortlived={}", nodeEntry.rolePriority, wasReleased, shortLived); boolean available; if (shortLived) { nodeEntry.onStartFailed(); available = false; } else { available = nodeEntry.containerCompleted(wasReleased, outcome); maybeQueueNodeForWork(container, nodeEntry, available); } touch(); return available; }