Adds a new host to a cells ring.
@param host	Host name to add
504407
private void addToRing(String host) {
		Cell newCell = new Cell();
		newCell.m_hostName = host;
		if (m_cellRing == null) {
			newCell.next = newCell;
		} else {
			newCell.next = m_cellRing.next;
			m_cellRing.next = newCell;
		}
		m_cellRing = newCell;
	}
888305
public void setHost(String host) {
		if(isModifiable == ModifiableRule.ContactSystem || isModifiable == ModifiableRule.NotModifiable) {
			throw new IllegalArgumentException("Host part of the URI is not modifiable");
		}
		try {
			getSipURI().setHost(host);
		} catch (ParseException e) {
			logger.error("parse exception occured", e);
			throw new IllegalArgumentException("Bad arg!",e);
		}
	}
673025
@Override
    public final synchronized boolean addHost(Host host, boolean refresh) {
        // Already exists
        if (hosts.containsKey(host)) {
            // Check to see if we are adding token ranges or if the token ranges changed
            // which will force a rebuild of the token topology
            Host existingHost = hosts.get(host).getHost();
            if (existingHost.getTokenRanges().size() != host.getTokenRanges().size()) {
                existingHost.setTokenRanges(host.getTokenRanges());
                return true;
            }
            
            ArrayList<TokenRange> currentTokens = Lists.newArrayList(existingHost.getTokenRanges());
            ArrayList<TokenRange> newTokens     = Lists.newArrayList(host.getTokenRanges());
            Collections.sort(currentTokens, compareByStartToken);
            Collections.sort(newTokens,     compareByStartToken);
            for (int i = 0; i < currentTokens.size(); i++) {
                if (!currentTokens.get(i).getStartToken().equals(newTokens.get(i).getStartToken()) ||
                    !currentTokens.get(i).getEndToken().equals(newTokens.get(i).getEndToken())) {
                    return false;
                }
            }
            
            existingHost.setTokenRanges(host.getTokenRanges());
            return true;
        }
        else {
            HostConnectionPool<CL> pool = newHostConnectionPool(host, factory, config);
            if (null == hosts.putIfAbsent(host, pool)) {
                try {
                    monitor.onHostAdded(host, pool);
                    if (refresh) {
                        topology.addPool(pool);
                        rebuildPartitions();
                    }
                    pool.primeConnections(config.getInitConnsPerHost());
                }
                catch (Exception e) {
                    // Ignore, pool will have been marked down internally
                }
                return true;
            }
            else {
                return false;
            }
        }
    }
982882
public void setupCellPositoin(final CellPosition address) {
        ArgUtils.notNull(address, "address");
        setupCellPositoin(address.getRow(), address.getColumn());
    }
1332977
def _expand_host(self, host):
        
        if isinstance(host, basestring):
            return (host, self.default_port)
        return tuple(host)
806818
public void addSingletonCell(int element) {
        SortedSet<Integer> cell = new TreeSet<Integer>();
        cell.add(element);
        this.cells.add(cell);
    }
302953
public void setHost(String host)
        throws java.net.UnknownHostException
    {
        _addr=null;
        if (host!=null)
        {
            if (host.indexOf('/')>0)
                host=host.substring(0,host.indexOf('/'));
            _addrIsHost=!Character.isDigit((host.charAt(0)));
            _addr=InetAddress.getByName(host);
        }
    }
824190
boolean add(DatanodeDescriptor node) {
    hostmapLock.writeLock().lock();
    try {
      if (node==null || contains(node)) {
        return false;
      }
      
      String host = node.getHost();
      DatanodeDescriptor[] nodes = map.get(host);
      DatanodeDescriptor[] newNodes;
      if (nodes==null) {
        newNodes = new DatanodeDescriptor[1];
        newNodes[0]=node;
      } else { // rare case: more than one datanode on the host
        newNodes = new DatanodeDescriptor[nodes.length+1];
        System.arraycopy(nodes, 0, newNodes, 0, nodes.length);
        newNodes[nodes.length] = node;
      }
      map.put(host, newNodes);
      return true;
    } finally {
      hostmapLock.writeLock().unlock();
    }
  }
615721
protected function setHostAndPort($host)
    {
        if (!str_contains($host, ':')) {
            $this->host = $host;
        } else {
            list($this->host, $this->port) = explode(':', $host);

            $this->port = (int) $this->port;
        }
    }
569115
public function setHost($host)
    {
        if (substr($host, -1) === '/') {
            $host = substr($host, 0, strlen($host) - 1);
        }

        $this->host = $host;
    }
28564
public function setHost(Host $host)
    {
        $this->host = $host;

        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker host after worker has started working');
        }
    }
1070940
public void addCell(int... elements) {
        SortedSet<Integer> cell = new TreeSet<Integer>();
        for (int element : elements) {
            cell.add(element);
        }
        this.cells.add(cell);
    }
1333124
def add_host(host):
    
    p = new_prefix()
    p.prefix = str(host['ipaddr'])
    p.type = "host"
    p.description = host['description']
    p.node = host['fqdn']
    p.avps = {}

    # Use remaining data from ipplan to populate comment field.
    if 'additional' in host:
        p.comment = host['additional']

    # Use specific info to create extra attributes.
    if len(host['location']) > 0:
        p.avps['location'] = host['location']

    if len(host['mac']) > 0:
        p.avps['mac'] = host['mac']

    if len(host['phone']) > 0:
        p.avps['phone'] = host['phone']

    if len(host['user']) > 0:
        p.avps['user'] = host['user']

    return p
347644
public void addHostEventHandler(IHostEventHandler hostEventHandler) {
        synchronized (hostEventHandlers) {
            if (!hostEventHandlers.contains(hostEventHandler)) {
                hostEventHandlers.add(hostEventHandler);
            }
        }
    }
1284207
synchronized void addMappings(HttpContext context)
    {
        if (context==_notFoundContext)
            return;
        
        String[] hosts=context.getVirtualHosts();
        if (hosts==null || hosts.length==0)
            hosts = __noVirtualHost;

        // For each host name
        for (int h=0;h<hosts.length;h++)
        {
            String virtualHost=hosts[h];
            addMapping(virtualHost,context);
        }
    }
650129
private void putForeignHost(int hostId, ForeignHost fh) {
        synchronized (m_mapLock) {
            m_foreignHosts = ImmutableMultimap.<Integer, ForeignHost>builder()
                    .putAll(m_foreignHosts)
                    .put(hostId, fh)
                    .build();
        }
    }
1323311
public void setHosts(java.util.Collection<Host> hosts) {
        if (hosts == null) {
            this.hosts = null;
            return;
        }

        this.hosts = new com.amazonaws.internal.SdkInternalList<Host>(hosts);
    }