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

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

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

HttpServer.start介绍

[英]Start the server. Does not wait for the server to start.
[中]启动服务器。不等待服务器启动。

代码示例

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

/**
 * Create and start a server with the test webapp
 *
 * @return the newly started server
 *
 * @throws IOException on any failure
 * @throws AssertionError if a condition was not met
 */
public static HttpServer createAndStartTestServer() throws IOException {
 HttpServer server = createTestServer();
 server.start();
 return server;
}

代码示例来源: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

server.start();
int port = server.getPort();

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

new AccessControlList("userA,userB groupC,groupD"));
myServer.setAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE, conf);
myServer.start();
int port = myServer.getPort();
String serverURL = "http://localhost:" + port + "/";

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

myServer.start();
int port = myServer.getPort();
String serverURL = "http://localhost:" + port + "/";

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

RecordingFilter.Initializer.class.getName());
HttpServer http = createTestServer(conf);
http.start();

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

SimpleFilter.Initializer.class.getName());
HttpServer http = createTestServer(conf);
http.start();

代码示例来源:origin: com.facebook.hadoop/hadoop-core

CONF_SERVLET_PATH, DataNode.this);
this.infoServer.addServlet("dnConf", CONF_SERVLET_PATH, ReconfigurationServlet.class);
this.infoServer.start();

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

@BeforeClass public static void setup() throws Exception {
 server = createTestServer();
 server.addServlet("echo", "/echo", EchoServlet.class);
 server.addServlet("echomap", "/echomap", EchoMapServlet.class);
 server.addServlet("htmlcontent", "/htmlcontent", HtmlContentServlet.class);
 server.start();
 baseUrl = getServerURL(server);
}

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

/**
 * Test that the server is alive once started
 *
 * @throws Throwable on failure
 */
@Test public void testStartedServerIsAlive() throws Throwable {
 HttpServer server = null;
 try {
  server = createTestServer();
  assertNotLive(server);
  server.start();
  assertAlive(server);
 } finally {
  stop(server);
 }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

this.infoServer.setAttribute("name.conf", conf);
infoServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);
infoServer.start();

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

this.infoServer.setAttribute("name.conf", conf);
infoServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);
infoServer.start();

代码示例来源:origin: com.facebook.hadoop/hadoop-core

ReconfigurationServlet.class);
this.httpServer.start();

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

this.infoServer.addServlet(null, "/blockScannerReport", 
              DataBlockScanner.Servlet.class);
this.infoServer.start();

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

infoServer.start();
this.infoPort = this.infoServer.getPort();

代码示例来源:origin: io.fabric8/fabric-hadoop

WebHdfsFileSystem.PATH_PREFIX + "/*");
this.infoServer.start();

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

infoServer.start();

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

this.infoServer.addInternalServlet("checksum", "/fileChecksum/*",
  FileChecksumServlets.RedirectServlet.class);
this.infoServer.start();

代码示例来源:origin: com.facebook.hadoop/hadoop-core

"mapOutput", "/mapOutput", MapOutputServlet.class);
server.addInternalServlet("taskLog", "/tasklog", TaskLogServlet.class);
server.start();
this.httpPort = server.getPort();
checkJettyPort();

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

server.addInternalServlet("mapOutput", "/mapOutput", MapOutputServlet.class);
server.addServlet("taskLog", "/tasklog", TaskLogServlet.class);
server.start();
this.httpPort = server.getPort();
checkJettyPort(httpPort);

相关文章