/** * Get the age of a node hosting container. If it is not known in the history, * return 0. * @param c container * @return age, null if there's no entry for it. */ private long getAgeOf(Container c) { long age = 0; NodeInstance node = rh.getExistingNodeInstance(c); int role = ContainerPriority.extractRole(c); if (node != null) { NodeEntry nodeEntry = node.get(role); if (nodeEntry != null) { age = nodeEntry.getLastUsed(); } } return age; }
/** * Get the age of a node hosting container. If it is not known in the history, * return 0. * @param c container * @return age, null if there's no entry for it. */ private long getAgeOf(Container c) { long age = 0; NodeInstance node = rh.getExistingNodeInstance(c); int role = ContainerPriority.extractRole(c); if (node != null) { NodeEntry nodeEntry = node.get(role); if (nodeEntry != null) { age = nodeEntry.getLastUsed(); } } return age; }