Package org.apache.hadoop.http

Examples of org.apache.hadoop.http.HttpServer.start()


        server.defineFilter(server.getWebAppContext(), "guice",
          GuiceFilter.class.getName(), null, new String[] { "/*" });

        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here


  private static HttpServer startHttpServer() throws Exception {
    new File(System.getProperty(
        "build.webapps", "build/webapps") + "/test").mkdirs();
    HttpServer server = new HttpServer("test", "0.0.0.0", 0, true);
    server.addServlet("jobend", "/jobend", JobEndServlet.class);
    server.start();

    JobEndServlet.calledTimes = 0;
    JobEndServlet.requestUri = null;
    JobEndServlet.baseUrl = "http://localhost:" + server.getPort() + "/";
    JobEndServlet.foundJobState = null;
View Full Code Here

        server.defineFilter(server.getWebAppContext(), "guice",
          GuiceFilter.class.getName(), null, new String[] { "/*" });

        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here

          server.setAttribute(entry.getKey(), entry.getValue());
        }
        server.addGlobalFilter("guice", GuiceFilter.class.getName(), null);
        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here

  @Test
  public void testReadURL() throws Exception {
    // Start a simple web server which hosts the log data.
    HttpServer server = new HttpServer("test", "0.0.0.0", 0, true);
    server.start();
    try {
      server.addServlet("fakeLog", "/fakeLog", FakeLogServlet.class);
      URL url = new URL("http://localhost:" + server.getPort() + "/fakeLog");
      EditLogInputStream elis = EditLogFileInputStream.fromUrl(
          url, HdfsConstants.INVALID_TXID, HdfsConstants.INVALID_TXID,
View Full Code Here

    JettyBugMonitor monitor = new JettyBugMonitor(conf);
   
    new File(System.getProperty("build.webapps", "build/webapps") + "/test"
      ).mkdirs();
    HttpServer server = new HttpServer("test", "0.0.0.0", 0, true);
    server.start();
    try {
      List<Long> threads = monitor.waitForJettyThreads();
      assertEquals(1, threads.size());
    } finally {
      server.stop();
View Full Code Here

          server.setAttribute(entry.getKey(), entry.getValue());
        }
        server.addGlobalFilter("guice", GuiceFilter.class.getName(), null);
        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here

          server.setAttribute(entry.getKey(), entry.getValue());
        }
        server.addGlobalFilter("guice", GuiceFilter.class.getName(), null);
        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here

      log.info("log.info1");
      log.error("log.error1");
      assertTrue(!Level.ERROR.equals(log.getEffectiveLevel()));

      HttpServer server = new HttpServer("..", "localhost", 22222, true);
      server.start();
      int port = server.getPort();

      //servlet
      URL url = new URL("http://localhost:" + port
          + "/logLevel?log=" + logName + "&level=" + Level.ERROR);
View Full Code Here

          server.setAttribute(entry.getKey(), entry.getValue());
        }
        server.addGlobalFilter("guice", GuiceFilter.class.getName(), null);
        webapp.setConf(conf);
        webapp.setHttpServer(server);
        server.start();
        LOG.info("Web app /"+ name +" started at "+ server.getPort());
      } catch (ClassNotFoundException e) {
        throw new WebAppException("Error starting http server", e);
      } catch (IOException e) {
        throw new WebAppException("Error starting http server", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.