Get the number of up foreign hosts. Used for test purposes.
@return The number of up foreign hosts.
163837
public int countForeignHosts() {
        int retval = 0;
        for (ForeignHost host : m_foreignHosts.values()) {
            if ((host != null) && (host.isUp())) {
                retval++;
            }
        }
        return retval;
    }
687208
public static UUID getLocalHostId()
    {
        String req = "SELECT host_id FROM system.%s WHERE key='%s'";
        UntypedResultSet result = executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY));

        // Look up the Host UUID (return it if found)
        if (!result.isEmpty() && result.one().has("host_id"))
            return result.one().getUUID("host_id");

        // ID not found, generate a new one, persist, and then return it.
        UUID hostId = UUID.randomUUID();
        logger.warn("No host ID found, created {} (Note: This should happen exactly once per node).", hostId);
        return setLocalHostId(hostId);
    }
153093
@Override
  public long getLargeUpdateCount() {
    if (results != null && results.getCmdInformation() != null && !results.isBatch()) {
      return results.getCmdInformation().getLargeUpdateCount();
    }
    return -1;
  }
656129
public function getObjectsCount() : int
    {
        return $this->nb_language_list->getSize() +
               $this->nb_role_list->getSize() +
               $this->nb_site_list->getSize()
        ;
    }
782524
public int leechers() {
    int count = 0;
    for (TrackedPeer peer : this.peers.values()) {
      if (!peer.isCompleted()) {
        count++;
      }
    }
    return count;
  }
450799
def get_hosts
      begin
        @host.get_hosts
      rescue => ex
        Util.log_exception(ex, caller_locations(1, 1)[0].label)
        raise ex
      end
    end
810619
public function getUpList() {
		$list = $this->getList();
		foreach($list as $migration=>$params) {
			if(!isset($params['migrated']))
				unset($list[$migration]);
		}
		return $list;
	}
401307
public long[][] getRemoteSites() {
        int localhost = VoltDB.instance().getHostMessenger().getHostId();
        long[][] retval = new long[m_allHostsImmutable.size() - 1][];
        int i = 0;
        for (int host : m_allHostsImmutable) {
            if (host != localhost) {
                retval[i++] = longListToArray(m_hostsToSitesImmutable.get(host));
            }
        }
        return retval;
    }
44876
public String getRemoteHost()
  {
    InetAddress remoteAddress = addressRemote();
    
    if (remoteAddress != null)
      return remoteAddress.getHostAddress();
    else
      return null;
  }
382509
public InetAddress
getAddress() {
	try {
		if (name == null)
			return InetAddress.getByAddress(toArray(addr));
		else
			return InetAddress.getByAddress(name.toString(),
							toArray(addr));
	} catch (UnknownHostException e) {
		return null;
	}
}
257371
public static String getHostname()
    {
        String      host = "unknown";
        try
        {
            return InetAddress.getLocalHost().getHostName();
        }
        catch ( UnknownHostException e )
        {
            // ignore
        }
        return host;
    }
114841
public static int count(final String host, final String searchStr) {
    int count = 0;
    for (int startIndex = 0; startIndex < host.length(); startIndex++) {
      int findLoc = host.indexOf(searchStr, startIndex);
      if (findLoc == -1) {
        break;
      } else {
        count++;
        startIndex = findLoc + searchStr.length() - 1;
      }
    }
    return count;
  }
301677
public int getRequestCount() {
        synchronized (mapPluginStats) {
            int count = requestCount + getAnalyser().getRequestCount();
            for (PluginStats stats : mapPluginStats.values()) {
                count += stats.getMessageCount();
            }
            return count;
        }
    }
597521
public int getNumberOfSuccessors() {

		int numberOfSuccessors = 0;

		for (int i = 0; i < this.outputGates.length; ++i) {
			numberOfSuccessors += this.outputGates[i].getNumberOfEdges();
		}

		return numberOfSuccessors;
	}
883470
public int numberOfInserts() {
        final Integer cachedValue = numberOfInsertsCache;

        if (cachedValue != null) {
            return cachedValue;
        }

        int numberOfInserts = 0;

        for (T object : results.keySet()) {
            if (results.get(object).wasInserted()) {
                numberOfInserts++;
            }
        }

        numberOfInsertsCache = numberOfInserts;

        return numberOfInserts;
    }
554484
public String determineAddresses() {
		if (CollectionUtils.isEmpty(this.parsedAddresses)) {
			return this.host + ":" + this.port;
		}
		List<String> addressStrings = new ArrayList<>();
		for (Address parsedAddress : this.parsedAddresses) {
			addressStrings.add(parsedAddress.host + ":" + parsedAddress.port);
		}
		return StringUtils.collectionToCommaDelimitedString(addressStrings);
	}
1070500
public int getNumberWaiting() {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            return parties - count;
        } finally {
            lock.unlock();
        }
    }