the broker info saved in zookeeper
<p>
format: <b>creatorId:host:port</b>

@return broker info saved in zookeeper
428240
public String getZKString() {
        return String.format("%s:%s:%s:%s", creatorId.replace(':', '#'), host.replace(':', '#'), port, autocreated);
    }
553605
private ClientConnectionManager getConnectionManager() {
        synchronized (this.getClass()) {
            if (sharedCM == null) {
                PoolingClientConnectionManager cm = new PoolingClientConnectionManager();
                cm.setMaxTotal(maxConnections);
                cm.setDefaultMaxPerRoute(maxConnections);
                sharedCM = cm;
            }
            return sharedCM;
        }
    }
800514
public int getPort() {
    final Connector[] connectors = this.server.getConnectors();
    checkState(connectors.length >= 1, "Server must have at least 1 connector");

    // The first connector is created upon initializing the server. That's the one that has the port.
    return connectors[0].getLocalPort();
  }
504408
public String getHost()
    {
        if (_addr==null)
            return __0_0_0_0;
        
        return _addrIsHost?_addr.getHostName():_addr.getHostAddress();
    }
411713
public java.util.List<String> getHostReservationIdSet() {
        if (hostReservationIdSet == null) {
            hostReservationIdSet = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return hostReservationIdSet;
    }
109170
def kafka_config(self):
        
        # 读取配置文件中的端口
        config_obj = self.configure[self.args.config[1]]
        kafka_ports = config_obj.get('KAFKA_PORTS')
        # 默认端口9092
        if not kafka_ports:
            kafka_ports_arr = ['9092']
        else:
            kafka_ports_arr = kafka_ports.replace(' ', '').split(',')

        # chmod project root owner
        sudo('chown {user}:{user} -R {path}'.format(
            user=config_obj.get('user'),
            path=bigdata_conf.project_root
        ))
        # change kafka bin permission for JAVA
        sudo('chmod -R 777 {0}/bin'.format(bigdata_conf.kafka_home))

        # 配置zookeeper服务
        self.systemctl_autostart(
            'zookeeper.service',
            '/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties',
            '/opt/kafka/bin/zookeeper-server-stop.sh /opt/kafka/config/zookeeper.properties'
        )

        # 循环生成kafka配置文件
        with cd('{0}/config'.format(bigdata_conf.kafka_home)):
            for idx, k_port in enumerate(kafka_ports_arr):
                conf_file = 'server.properties-{0}'.format(k_port)
                run('cp server.properties {0}'.format(conf_file))

                # 修改kafka配置文件
                sed(conf_file, 'broker.id=.*', 'broker.id={0}'.format(idx))
                uncomment(conf_file, 'listeners=PLAINTEXT')
                sed(conf_file, 'PLAINTEXT://.*', 'PLAINTEXT://{0}:{1}'.format(
                    env.host_string, k_port
                ))
                sed(conf_file, 'log.dirs=.*',
                    'log.dirs=/tmp/kafka-log-{0}'.format(k_port))

                # 配置kafka服务
                self.systemctl_autostart(
                    'kafka-{0}.service'.format(k_port),
                    '/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/{0}'.format(conf_file),
                    '/opt/kafka/bin/kafka-server-stop.sh /opt/kafka/config/{0}'.format(conf_file)
                )
853605
public int getRemotePort() {
		int port = -1;

		if(getTransaction() != null) {
			if(((SIPTransaction)getTransaction()).getPeerPacketSourceAddress() != null) {
				port = ((SIPTransaction)getTransaction()).getPeerPacketSourcePort();
			} else {
				port = ((SIPTransaction)getTransaction()).getPeerPort();
			}
		} else {
			ViaHeader via = (ViaHeader) message.getHeader(ViaHeader.NAME);
			// https://code.google.com/p/sipservlets/issues/detail?id=137
            boolean isExternal = sipFactoryImpl.getSipApplicationDispatcher().isViaHeaderExternal(via);
            if(message instanceof Request && !isExternal) {
                // locally generated messages should return -1 as per Javadoc
                return -1;
            }
			if(via != null) {
				port = via.getPort();
			}
		}
		if(port<=0) {
			return 5060;
		}
		else {
			return port;
		}
	}
22867
public ZooKeeper getZooKeeperClient() {
        if (zookeeper == null) {
            try {
                zookeeper = createZooKeeperClient();
                int retryAttempts = 5;
                while(!zookeeper.getState().isConnected() && retryAttempts > 0) {
                    LOG.debug("connecting...");
                    retryAttempts--;
                    Thread.sleep(1000);
                }
            } catch (IOException | InterruptedException e) {
                throw new CitrusRuntimeException(e);
            }

        }

        return zookeeper;
    }
469840
private CuratorFramework getNewCuratorClient() {
    CuratorFramework client = CuratorFrameworkFactory.newClient(mZookeeperAddress,
        (int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_SESSION_TIMEOUT),
        (int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_CONNECTION_TIMEOUT),
        new ExponentialBackoffRetry(Constants.SECOND_MS, 3));
    client.start();

    // Sometimes, if the master crashes and restarts too quickly (faster than the zookeeper
    // timeout), zookeeper thinks the new client is still an old one. In order to ensure a clean
    // state, explicitly close the "old" client and recreate a new one.
    client.close();
    client = CuratorFrameworkFactory.newClient(mZookeeperAddress,
        (int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_SESSION_TIMEOUT),
        (int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_CONNECTION_TIMEOUT),
        new ExponentialBackoffRetry(Constants.SECOND_MS, 3));
    client.start();
    return client;
  }
1003081
public EnvInfo info() {
    if (closed) {
      throw new AlreadyClosedException();
    }
    final MDB_envinfo info = new MDB_envinfo(RUNTIME);
    checkRc(LIB.mdb_env_info(ptr, info));

    final long mapAddress;
    if (info.f0_me_mapaddr.get() == null) {
      mapAddress = 0;
    } else {
      mapAddress = info.f0_me_mapaddr.get().address();
    }

    return new EnvInfo(
        mapAddress,
        info.f1_me_mapsize.longValue(),
        info.f2_me_last_pgno.longValue(),
        info.f3_me_last_txnid.longValue(),
        info.f4_me_maxreaders.intValue(),
        info.f5_me_numreaders.intValue());
  }
408824
public NodeDescriptor getDescriptor() {
		cachedDescriptor.writeLock.lock();
		try {

			// Check timestamp
			long current = registry.getTimestamp();
			if (timestamp.get() == current) {
				return cachedDescriptor;
			} else {
				while (true) {
					current = registry.getTimestamp();
					cachedDescriptor.info = registry.getDescriptor();
					if (current == registry.getTimestamp()) {
						timestamp.set(current);
						break;
					}
				}
				cachedDescriptor.seq++;
				cachedDescriptor.info.put("seq", cachedDescriptor.seq);
				cachedDescriptor.info.put("port", reader.getCurrentPort());
			}

		} finally {
			cachedDescriptor.writeLock.unlock();
		}
		return cachedDescriptor;
	}
1097639
public Builder toBuilder() {
    Builder builder =
        builder(getServices())
            .additionalArguments(getAdditionalArguments())
            .automaticRestart(automaticRestart)
            .defaultGcsBucketName(defaultGcsBucketName)
            .environment(getEnvironment())
            .host(host)
            .jvmFlags(getJvmFlags())
            .port(port)
            .projectId(projectId);
    return builder;
  }
1352622
public static final Tree getNodeInfos(ServiceBroker broker, Transporter transporter) {
		Tree infos = new Tree();
		if (transporter == null) {
			infos.putObject(broker.getNodeID(), broker.getConfig().getServiceRegistry().getDescriptor());
		} else {
			Set<String> nodeIDset = transporter.getAllNodeIDs();
			String[] nodeIDarray = new String[nodeIDset.size()];
			nodeIDset.toArray(nodeIDarray);
			Arrays.sort(nodeIDarray, String.CASE_INSENSITIVE_ORDER);
			for (String nodeID : nodeIDarray) {
				Tree info = transporter.getDescriptor(nodeID);
				if (info == null) {
					continue;
				}
				infos.putObject(nodeID, info);
			}
		}
		return infos;
	}
420395
public String getInfo() {
        ReportCreator reporter = new ReportCreator(this);
        return reporter.msdosHeaderReport() + reporter.coffHeaderReport() +
                reporter.optHeaderReport() + reporter.secTableReport();
    }
519307
@Override
    public String getIdentity() {
        return protocol + Constants.PROTOCOL_SEPARATOR + host + ":" + port +
                "/" + getParameter(URLParamType.group.getName(), URLParamType.group.getValue()) + "/" +
                getPath() + "/" + getParameter(URLParamType.version.getName(), URLParamType.version.getValue()) +
                "/" + getParameter(URLParamType.nodeType.getName(), URLParamType.nodeType.getValue());
    }
1013423
public long getSessionId() {
        long sessionId = 0;
        try {
            ZooKeeper zk = zooKeeper.getZooKeeper();
            if (zk != null) {
                sessionId = zk.getSessionId();
            }
        } catch (Exception e) {
            // Ignore the exception
        }
        return sessionId;
    }
748715
@Override
    protected Object createPoolOrConnection()
    {
        PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(getPersistenceUnit());

        Properties props = persistenceUnitMetadata.getProperties();

        String host = externalProperties != null ? (String) externalProperties.get(PersistenceProperties.KUNDERA_NODES)
                : null;
        String port = externalProperties != null ? (String) externalProperties.get(PersistenceProperties.KUNDERA_PORT)
                : null;

        if (host == null)
        {
            host = props.getProperty(PersistenceProperties.KUNDERA_NODES);
        }

        if (port == null)
        {
            port = props.getProperty(PersistenceProperties.KUNDERA_PORT);
        }

        String[] hosts = getHosts(host);

        Properties properties = ((ESClientPropertyReader) propertyReader).getConnectionProperties();

        Builder builder = Settings.settingsBuilder();

        builder.put("client.transport.sniff", true);

        if (properties != null)
        {
            builder.put(properties);
        }

        Settings settings = builder.build();

        TransportClient client = TransportClient.builder().settings(settings).build();

        for (String h : hosts)
        {
            client.addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress(h, new Integer(port))));
        }

        return client;
    }