/** * Mark the request as completed (or canceled). * <p> * Current action: if a node is defined, its request count is decremented */ public void completed() { if (node != null) { node.getOrCreate(roleId).requestCompleted(); } }
/** * Mark the request as completed (or canceled). * <p> * Current action: if a node is defined, its request count is decremented */ public void completed() { if (node != null) { node.getOrCreate(roleId).requestCompleted(); } }
/** * Get the node entry matching a container on this node * @param container container * @return matching node instance for the role */ public NodeEntry getOrCreate(Container container) { return getOrCreate(ContainerPriority.extractRole(container)); }
/** * Get the node entry of a container * @param container container to look up * @return the entry * @throws RuntimeException if the container has no hostname */ public NodeEntry getOrCreateNodeEntry(Container container) { return getOrCreateNodeInstance(container).getOrCreate(container); }
/** * Get the node entry matching a container on this node * @param container container * @return matching node instance for the role */ public NodeEntry getOrCreate(Container container) { return getOrCreate(ContainerPriority.extractRole(container)); }
/** * Get the node entry of a container * @param container container to look up * @return the entry * @throws RuntimeException if the container has no hostname */ public NodeEntry getOrCreateNodeEntry(Container container) { return getOrCreateNodeInstance(container).getOrCreate(container); }
/** * A container has been assigned to a role instance on a node -update the data structures * @param container container */ public void onContainerAssigned(Container container) { NodeInstance node = getOrCreateNodeInstance(container); NodeEntry nodeEntry = node.getOrCreate(container); nodeEntry.onStarting(); log.debug("Node {} has updated NodeEntry {}", node, nodeEntry); }
/** * A container has been assigned to a role instance on a node -update the data structures * @param container container */ public void onContainerAssigned(Container container) { NodeInstance node = getOrCreateNodeInstance(container); NodeEntry nodeEntry = node.getOrCreate(container); nodeEntry.onStarting(); log.debug("Node {} has updated NodeEntry {}", node, nodeEntry); }
/** * Is this node instance a suitable candidate for the specific role? * @param role role ID * @param label label which must match, or "" for no label checks * @return true if the node has space for this role, is running and the labels * match. */ public boolean canHost(int role, String label) { return isOnline() && (SliderUtils.isUnset(label) || label.equals(nodeLabels)) // label match && getOrCreate(role).isAvailable(); // no live role }
/** * Is this node instance a suitable candidate for the specific role? * @param role role ID * @param label label which must match, or "" for no label checks * @return true if the node has space for this role, is running and the labels * match. */ public boolean canHost(int role, String label) { return isOnline() && (SliderUtils.isUnset(label) || label.equals(nodeLabels)) // label match && getOrCreate(role).isAvailable(); // no live role }