添加一个Node
@param $node_name
@param $ip
776089
protected function addNode($node_name, $ip)
    {
        new ClusterClient($ip, $this->port, function (ClusterClient $client) use ($node_name) {
            //同步uid
            $content = [];
            foreach ($this->map[$this->node_name] as $value) {
                $content[] = $value;
                if (count($content) >= 10000) {
                    $client->syncNodeData($this->node_name, $content, ClusterProcess::TYPE_UID);
                    $content = [];
                }
            }
            if (count($content) > 0) {
                $client->syncNodeData($this->node_name, $content, ClusterProcess::TYPE_UID);
            }

            if (!isset($this->map[$node_name])) {
                $this->map[$node_name] = new Set();
            }
            //同步Actor
            $content = [];
            foreach ($this->actorMap[$this->node_name] as $value) {
                $content[] = $value;
                if (count($content) >= 10000) {
                    $client->syncNodeData($this->node_name, $content, ClusterProcess::TYPE_ACTOR);
                    $content = [];
                }
            }
            if (count($content) > 0) {
                $client->syncNodeData($this->node_name, $content, ClusterProcess::TYPE_ACTOR);
            }
            if (!isset($this->actorMap[$node_name])) {
                $this->actorMap[$node_name] = new Set();
            }
            $this->client[$node_name] = $client;
            if (Start::isLeader()) {
                get_instance()->pub('$SYS/nodes', array_keys($this->map));
            }
        });
    }
1204107
def add_node_connection(self, link, nodes):
        
        # Description
        src_desc = 'connected to %s on port %s' % \
                   (self.get_node_name_from_id(link['destination_node_id'],
                                               nodes),
                    self.get_port_name_from_id(link['destination_node_id'],
                                               link['destination_port_id'],
                                               nodes))
        dest_desc = 'connected to %s on port %s' % \
                    (self.get_node_name_from_id(link['source_node_id'],
                                                nodes),
                     self.get_port_name_from_id(link['source_node_id'],
                                                link['source_port_id'],
                                                nodes))
        # Add source connections
        for node in nodes:
            if node['id'] == link['source_node_id']:
                for port in node['ports']:
                    if port['id'] == link['source_port_id']:
                        port['link_id'] = link['id']
                        port['description'] = src_desc
                        break
            elif node['id'] == link['destination_node_id']:
                for port in node['ports']:
                    if port['id'] == link['destination_port_id']:
                        port['link_id'] = link['id']
                        port['description'] = dest_desc
                        break
1019390
public void addNode(NodeT node) {
        node.setOwner(this);
        nodeTable.put(node.key(), node);
    }
364169
public static function create($parameter_name) {
    $parameter_name = '$' . ltrim($parameter_name, '$');
    $parameter_node = new ParameterNode();
    $parameter_node->addChild(new VariableNode(T_VARIABLE, $parameter_name), 'name');
    return $parameter_node;
  }
1316328
def node(name, options = {}, &block)
        return unless resolve_condition(options)

        result = block.call(@_object)
        if name.present?
          @_result[create_key(name)] = result
        elsif result.is_a?(Hash) # merge hash into root hash
          @_result.merge!(result)
        end
      end
1158837
def create_new_node(project_root, environment)
      # Ask the hostname for node
      hostname = ask_not_existing_hostname(project_root, environment)
      # Ask IP for node
      ip = ask_ip(environment)
      # Node creation
      node = Bebox::Node.new(environment, project_root, hostname, ip)
      output = node.create
      ok _('wizard.node.creation_success')
      return output
    end
204527
public function addEdge(&$nodeA, &$nodeB, $name = NULL, $directed = TRUE, $data = array(), $weight = 0)
    {

        $edge = new Graph\Edge($nodeA, $name, $nodeB, $data, $directed, $weight); //Will need to decide whether to use nodeAId-nodeBId as edgeId
        $edgeId = $edge->getId();

        //Directed edges have their Id's referenced in arcSet
        if ($directed && !in_array($edgeId, $this->arcSet))
            $this->arcSet[] = $edgeId;

        //@TODO This is not the ideal way to set parrallel edges, Parralel edges connect the same pair of nodes
        //If edge already exists, increment the weight;
        if (isset($this->edgeSet[$edgeId])) {
            $this->edgeSet[$edgeId]->weight++;
            $edgeData = $this->edgeSet[$edgeId]->getData();
            $data = array_merge($edgeData, $data);
            //Makeing a directed array undirected
            if (!$directed && in_array($edgeId, $this->arcSet))
                $this->arcSet = array_diff($this->arcSet, array($edgeId));
            return true;
        }
        //array_merge edge data
        if (!isset($this->edgeSet[$edgeId]))
            $this->edgeSet[$edgeId] = &$edge;

        //If directed, use edgeIsArc to indicate;
        return true;
    }
961095
public void addNode(String name, Set<ResourceType> resourceTypes) {
    List<FaultStatsForType> faultStats = new ArrayList<FaultStatsForType>(
        resourceTypes.size());
    for (ResourceType type : resourceTypes) {
      faultStats.add(new FaultStatsForType(type));
    }
    nodeToFaultStats.put(name, faultStats);
  }
683238
def set_node(self, host, port, server_type=None):
        
        node_name = "{0}:{1}".format(host, port)
        node = {
            'host': host,
            'port': port,
            'name': node_name,
            'server_type': server_type
        }
        self.nodes[node_name] = node
        return node
639636
public function callActorBack($workerId, $token, $result, $node_name)
    {
        if ($node_name) {
            if ($node_name == $this->node_name) {//本机
                EventDispatcher::getInstance()->dispathToWorkerId($workerId, $token, $result);
                return;
            }
            if (!isset($this->client[$node_name])) return;
            $this->client[$node_name]->callActorBack($workerId, $token, $result);
        }
    }
162364
public void addNode(Node node) {

		long nId = node.getId();
		
		if (this.containsNode(nId))
			throw new DuplicatedNodeException(nId);
		int index = nextNodeId++;
		nodeIdMapping.put(nId, index);

		int aliveIndex = index >> 5;
		int aliveSubIndex = index & 31;

		if (aliveIndex >= aliveNodes.size())
			aliveNodes.add(0);

		aliveNodes.set(aliveIndex, aliveNodes.get(aliveIndex) | (byte)(1 << aliveSubIndex));

		adjacency.add(new IntHashSet[] {new IntHashSet(), new IntHashSet()});

		nodes.add(node);
		numberOfNodes++;
	}
114518
public function removeNodeUid($node_name, $uid)
    {
        ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->th_removeUid($node_name, $uid);
    }
136215
private function condition(ParentNode $node, $property_name) {
    $this->mustMatch('(', $node, 'openParen');
    if ($this->currentType === T_YIELD) {
      $node->addChild($this->_yield(), $property_name);
    }
    else {
      $node->addChild($this->expr(), $property_name);
    }
    $this->mustMatch(')', $node, 'closeParen');
  }
18650
public void addProcessor(String nodeName, NodeProcessor processor)
	{
		if (null == processor)
		{
			throw new IllegalArgumentException("Processor should not be null.");
		}
		if (IS_EMPTY.test(nodeName))
		{
			throw new IllegalArgumentException("The node name should not be empty.");
		}
		getActionPool().put(nodeName, processor);
	}
1374286
public function th_addUid($node_name, $uid)
    {
        if (!isset($this->map[$node_name])) {
            $this->map[$node_name] = new Set();
        }
        $this->map[$node_name]->add($uid);
        if (Start::isLeader()) {
            get_instance()->pub('$SYS/uidcount', $this->countOnline());
        }
    }
541523
async def addNode(self, name, valu, props=None):
        '''
        
        '''

        try:

            fnib = self._getNodeFnib(name, valu)
            retn = await self._addNodeFnib(fnib, props=props)
            return retn

        except asyncio.CancelledError:
            raise

        except Exception:

            mesg = f'Error adding node: {name} {valu!r} {props!r}'
            logger.exception(mesg)
            if self.strict:
                raise

            return None
858306
@Procedure(mode = Mode.WRITE)
    @Description("apoc.index.addNodeByName('name',node,['prop1',...]) add node to an index for the given name")
    public void addNodeByName(@Name("name") String name, @Name("node") Node node, @Name("properties") List<String> propKeys) {
        Index<Node> index = getNodeIndex(name, null);
        indexEntityProperties(node, propKeys, index);
    }