public function addNodes($nodes, $weight = 1)
    {
        foreach ($nodes as $node) {
            $this->_nodes[] = array('n' => $node, 'w' => $weight);
            $this->_nodeCount++;

            $nodeIndex = $this->_nodeCount - 1;
            $nodeString = serialize($node);

            $numberOfReplicas = (int)($weight * $this->_numberOfReplicas);
            for ($i = 0; $i < $numberOfReplicas; $i++) {
                $this->_circle[$this->hash($nodeString . $i)] = $nodeIndex;
            }
        }

        $this->_updateCircle();
    }
public function addNodes($nodes, $weight = 1)
    {
        foreach ($nodes as $node) {
            $this->_nodes[] = array('n' => $node, 'w' => $weight);
            $this->_nodeCount++;

            $nodeIndex = $this->_nodeCount - 1;
            $nodeString = serialize($node);

            $numberOfReplicas = (int)($weight * $this->_numberOfReplicas);
            for ($i = 0; $i < $numberOfReplicas; $i++) {
                $this->_circle[$this->hash($nodeString . $i)] = $nodeIndex;
            }
        }

        $this->_updateCircle();
    }
public function addNodes ( $ nodes , $ weight = 1 ) { foreach ( $ nodes as $ node ) { $ this -> _nodes [ ] = array ( 'n' => $ node , 'w' => $ weight ) ; $ this -> _nodeCount ++ ; $ nodeIndex = $ this -> _nodeCount - 1 ; $ nodeString = serialize ( $ node ) ; $ numberOfReplicas = ( int ) ( $ weight * $ this -> _numberOfReplicas ) ; for ( $ i = 0 ; $ i < $ numberOfReplicas ; $ i ++ ) { $ this -> _circle [ $ this -> hash ( $ nodeString . $ i ) ] = $ nodeIndex ; } } $ this -> _updateCircle ( ) ; }
Add multiple nodes to the hash with the same weight.

@param array    $nodes   An array of nodes.
@param integer  $weight  The weight to add the nodes with.
Add multiple nodes to the hash with the same weight .