@Override public String getSecureClientAddress() { if (zks.secureServerCnxnFactory != null) { return String.format("%s:%d", zks.secureServerCnxnFactory .getLocalAddress().getHostString(), zks.secureServerCnxnFactory.getLocalPort()); } return ""; }
public String getClientAddress() { if (null != peer.cnxnFactory) { return formatInetAddr(peer.cnxnFactory.getLocalAddress()); } else { return ""; } }
private void updateThreadName() { String plain = cnxnFactory != null ? cnxnFactory.getLocalAddress() != null ? formatInetAddr(cnxnFactory.getLocalAddress()) : "disabled" : "disabled"; String secure = secureCnxnFactory != null ? formatInetAddr(secureCnxnFactory.getLocalAddress()) : "disabled"; setName(String.format("QuorumPeer[myid=%d](plain=%s)(secure=%s)", getId(), plain, secure)); }
String hostString1 = peer1.cnxnFactory.getLocalAddress().getHostString(); assertEquals(clientIP.getHostAddress(), hostString1); QuorumPeer peer2 = new QuorumPeer(peersView, dataDir, dataDir, clientPort, electionAlg, myId, tickTime, initLimit, syncLimit); String hostString2 = peer2.cnxnFactory.getLocalAddress().getHostString(); assertEquals(clientIP.getHostAddress(), hostString2);
@Override public void run() { setName("QuorumPeer" + "[myid=" + getId() + "]" + cnxnFactory.getLocalAddress());
public InetSocketAddress getLocalAddress() { return factory.getLocalAddress(); }
public InetSocketAddress getLocalAddress() { return factory.getLocalAddress(); }
/** * Get the connection address * @return the connection as an address * @throws IllegalStateException if the connection is not yet valid */ public InetSocketAddress getConnectionAddress() { Preconditions.checkState(factory != null, "service not started"); return factory.getLocalAddress(); }
/** * Get the connection address * @return the connection as an address * @throws IllegalStateException if the connection is not yet valid */ public InetSocketAddress getConnectionAddress() { Preconditions.checkState(factory != null, "service not started"); return factory.getLocalAddress(); }
/** * Get the connection string. * @return the string * @throws IllegalStateException if the connection is not yet valid */ public String getConnectionString() { Preconditions.checkState(factory != null, "service not started"); InetSocketAddress addr = factory.getLocalAddress(); return String.format("%s:%d", addr.getHostName(), addr.getPort()); }
/** * Get the connection string. * @return the string * @throws IllegalStateException if the connection is not yet valid */ public String getConnectionString() { Preconditions.checkState(factory != null, "service not started"); InetSocketAddress addr = factory.getLocalAddress(); return String.format("%s:%d", addr.getHostName(), addr.getPort()); }
public String getConnectionStr() { InetSocketAddress addr = factory.getLocalAddress(); return String.format("%s:%d", addr.getHostName(), addr.getPort()); }
public String getConnectionStr() { InetSocketAddress addr = factory.getLocalAddress(); return String.format("%s:%d", addr.getHostName(), addr.getPort()); }
private String startZk() throws IOException, InterruptedException, URISyntaxException { String zkValue = properties.getProperty("zookeeper.connect"); LOG.info("Starting zookeeper at {}", zkValue); URL zkAddress = getURL(zkValue); File snapshotDir = constructDir("zk/txn"); File logDir = constructDir("zk/snap"); factory = NIOServerCnxnFactory.createFactory(new InetSocketAddress(zkAddress.getHost(), zkAddress.getPort()), 1024); factory.startup(new ZooKeeperServer(snapshotDir, logDir, 500)); String ret = factory.getLocalAddress().getAddress().toString(); LOG.info("Embedded zookeeper for Kafka started at {}", ret); return ret; }
private String startZk() throws IOException, InterruptedException, URISyntaxException { String zkValue = properties.getProperty("zookeeper.connect"); LOG.info("Starting zookeeper at {}", zkValue); URL zkAddress = getURL(zkValue); File snapshotDir = constructDir("zk/txn"); File logDir = constructDir("zk/snap"); factory = NIOServerCnxnFactory.createFactory(new InetSocketAddress(zkAddress.getHost(), zkAddress.getPort()), 1024); factory.startup(new ZooKeeperServer(snapshotDir, logDir, 500)); String ret = factory.getLocalAddress().getAddress().toString(); LOG.info("Embedded zookeeper for Kafka started at {}", ret); return ret; }
@Override public void run() { setName("QuorumPeer" + "[myid=" + getId() + "]" + cnxnFactory.getLocalAddress());