本文整理了Java中org.apache.hadoop.http.HttpServer.isAlive()
方法的一些代码示例,展示了HttpServer.isAlive()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.isAlive()
方法的具体详情如下:
包路径:org.apache.hadoop.http.HttpServer
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!