本文整理了Java中org.apache.hadoop.http.HttpServer.getPort()
方法的一些代码示例,展示了HttpServer.getPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.getPort()
方法的具体详情如下:
包路径:org.apache.hadoop.http.HttpServer
类名称:HttpServer
方法名:getPort
[英]Get the port that the server is on
[中]获取服务器所在的端口
代码示例来源:origin: com.facebook.hadoop/hadoop-core
@Override // DataNodeMXBean
public String getHttpPort(){
return Integer.toString(this.infoServer.getPort());
}
代码示例来源:origin: com.facebook.hadoop/hadoop-core
protected void checkJettyPort() throws IOException {
//See HADOOP-4744
int port = server.getPort();
if (port < 0) {
shuttingDown = true;
throw new IOException("Jetty problem. Jetty didn't bind to a " +
"valid port");
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
/**
* Pass in a server, return a URL bound to localhost and its port
* @param server server
* @return a URL bonded to the base of the server
* @throws MalformedURLException if the URL cannot be created.
*/
public static URL getServerURL(HttpServer server)
throws MalformedURLException {
assertNotNull("No server", server);
int port = server.getPort();
return new URL("http://localhost:" + port + "/");
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test
@Before
public void setUp() throws Exception {
dir = new File(System.getProperty("build.webapps", "build/webapps") + "/test");
System.out.println("dir="+dir.getAbsolutePath());
if(!dir.exists()) {
assertTrue(dir.mkdirs());
}
server = new HttpServer("test", "0.0.0.0", 0, true);
server.addServlet("shuffle", "/mapOutput", TaskTracker.MapOutputServlet.class);
server.start();
int port = server.getPort();
baseUrl = new URL("http://localhost:" + port + "/");
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
int port = server.getPort();
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
myServer.setAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE, conf);
myServer.start();
int port = myServer.getPort();
String serverURL = "http://localhost:" + port + "/";
for (String servlet : new String[] { "conf", "logs", "stacks",
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
myServer.setAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE, conf);
myServer.start();
int port = myServer.getPort();
String serverURL = "http://localhost:" + port + "/";
for (String servlet : new String[] { "conf", "logs", "stacks",
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
final String prefix = "http://localhost:" + http.getPort();
try {
for(int i = 0; i < urls.length; i++) {
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
final String prefix = "http://localhost:" + http.getPort();
try {
for(int i = 0; i < sequence.length; i++) {
代码示例来源:origin: com.facebook.hadoop/hadoop-core
infoPort = infoServer.getPort();
conf.set("dfs.secondary.http.address", infoBindAddress + ":" +infoPort);
LOG.info("Secondary Web-server up at: " + infoBindAddress + ":" +infoPort);
代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core
infoPort = infoServer.getPort();
conf.set("dfs.secondary.http.address", infoBindAddress + ":" +infoPort);
LOG.info("Secondary Web-server up at: " + infoBindAddress + ":" +infoPort);
代码示例来源:origin: com.facebook.hadoop/hadoop-core
infoPort = this.httpServer.getPort();
this.httpAddress = new InetSocketAddress(infoHost, infoPort);
conf.set("dfs.http.address", infoHost + ":" + infoPort);
代码示例来源:origin: org.apache.hadoop/hadoop-mapred
checkJettyPort(server.getPort());
} catch (InterruptedException ie) {
LOG.info("Interrupted. Closing down.");
代码示例来源:origin: com.facebook.hadoop/hadoop-core
void setupNS(Configuration conf, AbstractList<File> dataDirs)
throws IOException {
// get NN proxy
DatanodeProtocol dnp =
(DatanodeProtocol)RPC.waitForProxy(DatanodeProtocol.class,
DatanodeProtocol.versionID, nnAddr, conf);
setNameNode(dnp);
// handshake with NN
NamespaceInfo nsInfo = handshake();
setNamespaceInfo(nsInfo);
synchronized(DataNode.this){
setupNSStorage();
}
nsRegistration.setIpcPort(ipcServer.getListenerAddress().getPort());
nsRegistration.setInfoPort(infoServer.getPort());
}
代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core
this.infoServer.start();
this.dnRegistration.setInfoPort(this.infoServer.getPort());
myMetrics = new DataNodeMetrics(conf, dnRegistration.getStorageID());
代码示例来源:origin: org.apache.hadoop/hadoop-mapred
infoServer.addServlet("reducegraph", "/taskgraph", TaskGraphServlet.class);
infoServer.start();
this.infoPort = this.infoServer.getPort();
代码示例来源:origin: io.fabric8/fabric-hadoop
this.dnRegistration.setInfoPort(this.infoServer.getPort());
myMetrics = DataNodeInstrumentation.create(conf,
dnRegistration.getStorageID());
代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core
this.infoPort = this.infoServer.getPort();
conf.set("dfs.http.address", infoHost + ":" + infoPort);
LOG.info("Web-server up at: " + infoHost + ":" + infoPort);
代码示例来源:origin: com.facebook.hadoop/hadoop-core
server.addInternalServlet("taskLog", "/tasklog", TaskLogServlet.class);
server.start();
this.httpPort = server.getPort();
checkJettyPort();
代码示例来源:origin: org.apache.hadoop/hadoop-mapred
server.addServlet("taskLog", "/tasklog", TaskLogServlet.class);
server.start();
this.httpPort = server.getPort();
checkJettyPort(httpPort);
内容来源于网络,如有侵权,请联系作者删除!