public int getClientPort() { if (cnxnFactory != null) { return cnxnFactory.getLocalPort(); } return -1; }
public int getSecureClientPort() { return secureServerCnxnFactory != null ? secureServerCnxnFactory.getLocalPort() : -1; }
public int getClientPort() { return serverCnxnFactory != null ? serverCnxnFactory.getLocalPort() : -1; }
@Override public String getSecureClientPort() { if (zks.secureServerCnxnFactory != null) { return Integer.toString(zks.secureServerCnxnFactory.getLocalPort()); } return ""; }
public int getClientPort() { return cnxnFactory.getLocalPort(); }
public int getClientPort() { return serverCnxnFactory != null ? serverCnxnFactory.getLocalPort() : -1; }
@Override public String getSecureClientAddress() { if (zks.secureServerCnxnFactory != null) { return String.format("%s:%d", zks.secureServerCnxnFactory .getLocalAddress().getHostString(), zks.secureServerCnxnFactory.getLocalPort()); } return ""; }
public int getClientPort() { return cnxnFactory.getLocalPort(); }
public int getLocalPort() { if (cnxnFactory == null) { throw new IllegalStateException("A port has not yet been selected"); } int port; try { port = cnxnFactory.getLocalPort(); } catch (NullPointerException e) { throw new IllegalStateException("A port has not yet been selected"); } if (port == 0) { throw new IllegalStateException("A port has not yet been selected"); } return port; }
public String getConnectString() { return "127.0.0.1:" + cnxnFactory.getLocalPort(); } }
/** * Shutdown the serving instance * @throws IOException If there is a low-level I/O error. */ protected void shutdown() throws IOException { zooKeeperServer.shutdown(); ZKDatabase zkDb = zooKeeperServer.getZKDatabase(); if (cnxnFactory != null && cnxnFactory.getLocalPort() != 0) { waitForServerDown(getZkHost() + ":" + getPort(), 5000); } if (cnxnFactory != null) { cnxnFactory.shutdown(); try { cnxnFactory.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (zkDb != null) { zkDb.close(); } }
conf = HBaseConfiguration.create(miniCluster.getConfig()); conf.set(HConstants.HBASE_DIR, hbaseRoot.toURI().toURL().toString()); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, factory.getLocalPort()); conf.set("hbase.master.hostname", "localhost"); conf.set("hbase.regionserver.hostname", "localhost");