org.apache.hadoop.http.HttpServer.isAlive()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.hadoop.http.HttpServer.isAlive()方法的一些代码示例,展示了HttpServer.isAlive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.isAlive()方法的具体详情如下:
包路径:org.apache.hadoop.http.HttpServer
类名称:HttpServer
方法名:isAlive

HttpServer.isAlive介绍

[英]Test for the availability of the web server
[中]测试web服务器的可用性

代码示例

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Return the host and port of the HttpServer, if live
 * @return the classname and any HTTP URL
 */
@Override
public String toString() {
 return listener != null ?
   ("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
     + (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
   : "Inactive HttpServer";
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Return the host and port of the HttpServer, if live
 * @return the classname and any HTTP URL
 */
@Override
public String toString() {
 return listener != null ?
   ("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
     + (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
   : "Inactive HttpServer";
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Return the host and port of the HttpServer, if live
 * @return the classname and any HTTP URL
 */
@Override
public String toString() {
 return listener != null ?
   ("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
     + (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
   : "Inactive HttpServer";
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Return the host and port of the HttpServer, if live
 * @return the classname and any HTTP URL
 */
@Override
public String toString() {
 return listener != null ?
   ("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
     + (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
   : "Inactive HttpServer";
}

代码示例来源:origin: org.apache.hadoop/hadoop-common-test

/**
 * Check that a server is alive by probing the {@link HttpServer#isAlive()} method
 * and the text of its toString() description
 * @param server server
 */
private void assertAlive(HttpServer server) {
 assertTrue("Server is not alive", server.isAlive());
 assertToStringContains(server, HttpServer.STATE_DESCRIPTION_ALIVE);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common-test

private void assertNotLive(HttpServer server) {
 assertTrue("Server should not be live", !server.isAlive());
 assertToStringContains(server, HttpServer.STATE_DESCRIPTION_NOT_LIVE);
}

相关文章