This is an internal api called to tell the cluster manager that a
a particular node seems dysfunctional and that it should be removed
from the cluster.

@param nodeName Node to be removed
172111
public void nodeTimeout(String nodeName) {
    if (nodeRestarter != null) {
      nodeRestarter.delete(nodeName);
    }
    Set<String> sessions = nodeManager.getNodeSessions(nodeName);
    Set<ClusterNode.GrantId> grantsToRevoke = nodeManager.deleteNode(nodeName);
    if (grantsToRevoke == null) {
      return;
    }
    handleRevokedGrants(nodeName, grantsToRevoke);
    handleDeadNode(nodeName, sessions);
    scheduler.notifyScheduler();
  }
1259661
public void remove(Node node) {
    if (node==null) return;
    if( node instanceof InnerNode ) {
      throw new IllegalArgumentException(
        "Not allow to remove an inner node: "+NodeBase.getPath(node));
    }
    LOG.info("Removing a node: "+NodeBase.getPath(node));
    netlock.writeLock().lock();
    try {
      String currentRackName = node.getNetworkLocation();
      if (clusterMap.remove(node)) {
        InnerNode rack = (InnerNode)getNode(node.getNetworkLocation());
        if (rack == null) {
          if (!racks.remove(currentRackName)) {
            LOG.error("Discrepancy between network topology and list of racks. "
                + "Removed rack "
                + currentRackName
                + " was not in the rack list.");
          }
        }
      }
      LOG.debug("NetworkTopology became:\n" + this.toString());
    } finally {
      netlock.writeLock().unlock();
    }
  }
1029691
def remove_node(self, node):
        
        if _debug: Network._debug("remove_node %r", node)

        self.nodes.remove(node)
        node.lan = None
590128
void blacklistNode(String nodeName, ResourceType resourceType) {
    LOG.info("Node " + nodeName + " has been blacklisted for resource " +
      resourceType);
    clusterManager.getMetrics().setBlacklistedNodes(
        faultManager.getBlacklistedNodeCount());
    deleteAppFromNode(nodeName, resourceType);
  }
725393
public static final void clusterName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "clusterName", name);

        _clusterName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "clusterName");
    }
1094741
public static void removeAllChildren(final Node node) {
        assert node != null;
        assert node.getNodeType() != Node.ATTRIBUTE_NODE;
        if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
            Element documentElement = ((Document) node).getDocumentElement();
            if (documentElement != null) {
                ((Document) node).removeChild(documentElement);
            }
            return;
        }
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            Element element = (Element) node;
            for (Node n = element.getFirstChild(); n != null; n = element.getFirstChild()) {
                element.removeChild(n);
            }
        }
    }
1019274
public function remove($nodeName)
    {
        $children = self::removeTreeNode($this->hierarchy, $nodeName);
        // @todo remove all children
        $this->removeNodeFromList($nodeName);
        $this->updateRequired = true;

        return $this;
    }
697081
private int invalidateWorkForOneNode(String nodeId) {
    List<Block> blocksToInvalidate = null;
    DatanodeDescriptor dn = null;
    writeLock();
    try {
      // blocks should not be replicated or removed if safe mode is on
      if (isInSafeMode()) {
        return 0;
      }
      // get blocks to invalidate for the nodeId
      assert nodeId != null;
      dn = datanodeMap.get(nodeId);
      if (dn == null) {
        recentInvalidateSets.remove(nodeId);
        return 0;
      }

      LightWeightHashSet<Block> invalidateSet = recentInvalidateSets
          .get(nodeId);
      if (invalidateSet == null) {
        return 0;
      }
      // # blocks that can be sent in one message is limited
      blocksToInvalidate = invalidateSet.pollN(ReplicationConfigKeys.blockInvalidateLimit);

      // If we send everything in this message, remove this node entry
      if (invalidateSet.isEmpty()) {
        recentInvalidateSets.remove(nodeId);
      }

      dn.addBlocksToBeInvalidated(blocksToInvalidate);
      pendingDeletionBlocksCount -= blocksToInvalidate.size();
    } finally {
      writeUnlock();
      if (NameNode.stateChangeLog.isInfoEnabled() && blocksToInvalidate != null
          && blocksToInvalidate.size() != 0) {
        StringBuffer blockList = new StringBuffer();
        for (Block blk : blocksToInvalidate) {
          blockList.append(' ');
          blockList.append(blk);
        }
        NameNode.stateChangeLog.info("BLOCK* ask "
          + dn.getName() + " to delete " + blockList);
      }
    }
    return blocksToInvalidate.size();
  }
666911
public static void deleteNode(DbConn cnx, int id)
    {
        int countRunning = cnx.runSelectSingle("ji_select_count_by_node", Integer.class, id);
        if (countRunning > 0)
        {
            cnx.setRollbackOnly();
            throw new JqmAdminApiUserException(
                    "cannot delete a node with running instances. Disable it, wait for the end of all running instances, then retry.");
        }

        try
        {
            Node n = Node.select_single(cnx, "node_select_by_id", id);
            Calendar limit = Calendar.getInstance();
            limit.add(Calendar.MINUTE, -10);
            if (n.getLastSeenAlive() != null && n.getLastSeenAlive().after(limit))
            {
                cnx.setRollbackOnly();
                throw new JqmAdminApiUserException(
                        "Can only remove a node either properly shut down or that has crashed more than 10 minutes ago.");
            }
        }
        catch (NoResultException e)
        {
            throw new JqmAdminApiUserException("no item with ID " + id);
        }

        cnx.runUpdate("dp_delete_for_node", id);
        QueryResult qr = cnx.runUpdate("node_delete_by_id", id);
        if (qr.nbUpdated != 1)
        {
            cnx.setRollbackOnly();
            throw new JqmAdminApiUserException("no item with ID " + id);
        }
    }
773204
@Override
    public void nodeName(int index, String nodeName) throws OperationFormatException {

        assertValidNodeName(nodeName);
        validatedNodeName(index, nodeName);
    }
102909
public void nodeAppRemoved(String nodeName, ResourceType type) {
    Set<String> sessions = nodeManager.getNodeSessions(nodeName);
    Set<ClusterNode.GrantId> grantsToRevoke =
      nodeManager.deleteAppFromNode(nodeName, type);
    if (grantsToRevoke == null) {
      return;
    }
    Set<String> affectedSessions = new HashSet<String>();
    for (String sessionHandle : sessions) {
      try {
        if (sessionManager.getSession(sessionHandle).
            getTypes().contains(type)) {
          affectedSessions.add(sessionHandle);
        }
      } catch (InvalidSessionHandle ex) {
        // ignore
        LOG.warn("Found invalid session: " + sessionHandle
            + " while timing out node: " + nodeName);
      }
    }
    handleDeadNode(nodeName, affectedSessions);
    handleRevokedGrants(nodeName, grantsToRevoke);
    scheduler.notifyScheduler();
  }
794590
@Override
	public void removeActions(String nodeID) {

		// Stop local services
		if (this.nodeID.equals(nodeID)) {
			stopAllLocalServices();
		}

		// Remove actions
		final long stamp = lock.writeLock();
		try {
			Iterator<Strategy<ActionEndpoint>> endpoints = strategies.values().iterator();
			while (endpoints.hasNext()) {
				Strategy<ActionEndpoint> strategy = endpoints.next();
				strategy.remove(nodeID);
				if (strategy.isEmpty()) {
					endpoints.remove();
				}
			}

			// Update service names
			names.clear();
			names.addAll(strategies.keySet());

			// Delete cached node descriptor
			if (this.nodeID.equals(nodeID)) {
				clearDescriptorCache();
			}

		} finally {
			lock.unlockWrite(stamp);
		}

		// Reject promises
		Iterator<PendingPromise> pendingPromises = promises.values().iterator();
		boolean removed = false;
		while (pendingPromises.hasNext()) {
			PendingPromise pending = pendingPromises.next();
			if (pending.nodeID.equals(nodeID)) {
				removed = true;
				pendingPromises.remove();
				executor.execute(() -> {
					try {
						pending.promise.complete(new RequestRejectedError(nodeID, pending.action));
					} catch (Throwable cause) {
						logger.warn("Unable to reject action \"" + pending.action + "\"!", cause);
					}
				});
			}
		}

		// Reschedule timeout checker
		if (removed) {
			scheduler.execute(() -> {
				reschedule(Long.MAX_VALUE);
			});
		}

		// Notify listeners
		if (this.nodeID.equals(nodeID)) {

			// Notify local listeners (LOCAL services changed)
			broadcastServicesChanged(true);
		} else {

			// Notify local listeners (REMOTE services changed)
			broadcastServicesChanged(false);
		}
	}
136951
public static void removeName(Node n) {
    checkState(n.isFunction() || n.isClass());
    Node originalName = n.getFirstChild();
    Node emptyName = n.isFunction() ? IR.name("") : IR.empty();
    n.replaceChild(originalName, emptyName.useSourceInfoFrom(originalName));
  }
728546
private void removeNode(Node node)
	{
		result.remove(node);

		for (Edge edge : node.getUpstream())
		{
			result.remove(edge);
		}

		for (Edge edge : node.getDownstream())
		{
			result.remove(edge);
		}
	}
291801
@Override
    public String removeLayoutAttribute(String nodeId, String name) {
        Validate.notEmpty(nodeId, "nodeId cannot be null");
        Validate.notEmpty(name, "name cannot be null");

        final LayoutNodeAttributesImpl layoutAttribute = getLayoutNodeAttributes(nodeId, false);
        if (layoutAttribute == null) {
            return null;
        }
        final Map<String, String> attributes = layoutAttribute.getAttributes();
        return attributes.remove(name);
    }
204248
public boolean removeNode(RiakNode node)
    {
        stateCheck(State.CREATED, State.RUNNING, State.QUEUING);
        boolean removed = false;
        try
        {
            nodeListLock.writeLock().lock();
            removed = nodeList.remove(node);
            for (NodeStateListener listener : stateListeners)
            {
                node.removeStateListener(listener);
            }
        }
        finally
        {
            nodeListLock.writeLock().unlock();
        }
        nodeManager.removeNode(node);
        return removed;
    }
949637
public void removeDatanode(DatanodeID nodeID)
    throws IOException {
    writeLock();
    try {
      DatanodeDescriptor nodeInfo = getDatanode(nodeID);
      if (nodeInfo != null) {
        removeDatanode(nodeInfo);
      } else {
        NameNode.stateChangeLog.warn("BLOCK* NameSystem.removeDatanode: "
          + nodeID.getName() + " does not exist");
      }
    } finally {
      writeUnlock();
    }
  }