@Override public String toString() { Preconditions.checkState(!listeners.isEmpty()); StringBuilder sb = new StringBuilder("HttpServer (") .append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE) .append("), listening at:"); for (ServerConnector l : listeners) { sb.append(l.getHost()).append(":").append(l.getPort()).append("/,"); } return sb.toString(); }
public boolean isRunning() { return httpServer.isAlive(); }
@Override public String toString() { Preconditions.checkState(!listeners.isEmpty()); StringBuilder sb = new StringBuilder("HttpServer (") .append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE) .append("), listening at:"); for (Connector l : listeners) { sb.append(l.getHost()).append(":").append(l.getPort()).append("/,"); } return sb.toString(); }
@Override public String toString() { Preconditions.checkState(!listeners.isEmpty()); StringBuilder sb = new StringBuilder("HttpServer (") .append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE) .append("), listening at:"); for (Connector l : listeners) { sb.append(l.getHost()).append(":").append(l.getPort()).append("/,"); } return sb.toString(); }
@Override public String toString() { Preconditions.checkState(!listeners.isEmpty()); StringBuilder sb = new StringBuilder("HttpServer (") .append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE) .append("), listening at:"); for (Connector l : listeners) { sb.append(l.getHost()).append(":").append(l.getPort()).append("/,"); } return sb.toString(); }
@Override public String toString() { Preconditions.checkState(!listeners.isEmpty()); StringBuilder sb = new StringBuilder("HttpServer (") .append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE) .append("), listening at:"); for (Connector l : listeners) { sb.append(l.getHost()).append(":").append(l.getPort()).append("/,"); } return sb.toString(); }
public static void closeHBase() { if (table != null) try { table.close(); } catch (IOException e) { logger.error("关闭 table 出错", e); } if (connection != null) try { connection.close(); } catch (IOException e) { logger.error("关闭 connection 出错", e); } if (infoServer != null && infoServer.isAlive()) try { infoServer.stop(); } catch (Exception e) { logger.error("关闭 infoServer 出错", e); } }
public static void closeHBase() { if (table != null) try { table.close(); } catch (IOException e) { logger.error("关闭 table 出错", e); } if (connection != null) try { connection.close(); } catch (IOException e) { logger.error("关闭 connection 出错", e); } if (infoServer != null && infoServer.isAlive()) try { infoServer.stop(); } catch (Exception e) { logger.error("关闭 infoServer 出错", e); } }
/** * Check that a server is alive by probing the {@link HttpServer2#isAlive()} method * and the text of its toString() description * @param server server */ private void assertAlive(HttpServer2 server) { assertTrue("Server is not alive", server.isAlive()); assertToStringContains(server, HttpServer2.STATE_DESCRIPTION_ALIVE); }
/** * Check that a server is alive by probing the {@link HttpServer2#isAlive()} method * and the text of its toString() description * @param server server */ private void assertAlive(HttpServer2 server) { assertTrue("Server is not alive", server.isAlive()); assertToStringContains(server, HttpServer2.STATE_DESCRIPTION_ALIVE); }
private void assertNotLive(HttpServer2 server) { assertTrue("Server should not be live", !server.isAlive()); assertToStringContains(server, HttpServer2.STATE_DESCRIPTION_NOT_LIVE); }
private void assertNotLive(HttpServer2 server) { assertTrue("Server should not be live", !server.isAlive()); assertToStringContains(server, HttpServer2.STATE_DESCRIPTION_NOT_LIVE); }