/** * Sets fsimage for use by servlets. * * @param fsImage FSImage to set */ void setFSImage(FSImage fsImage) { httpServer.setAttribute(FSIMAGE_ATTRIBUTE_KEY, fsImage); }
/** * Sets startup progress of namenode for use by servlets. * * @param prog StartupProgress to set */ void setStartupProgress(StartupProgress prog) { httpServer.setAttribute(STARTUP_PROGRESS_ATTRIBUTE_KEY, prog); }
/** * Sets address of namenode for use by servlets. * * @param nameNodeAddress InetSocketAddress to set */ void setNameNodeAddress(InetSocketAddress nameNodeAddress) { httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, NetUtils.getConnectAddress(nameNodeAddress)); }
httpServer.setAttribute(JN_ATTRIBUTE_KEY, localJournalNode); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true);
this.infoServer.setAttribute(HttpServer2.CONF_CONTEXT_ATTRIBUTE, conf); this.infoServer.setAttribute("datanode", datanode); this.infoServer.setAttribute(JspHelper.CURRENT_CONF, conf); this.infoServer.addServlet(null, "/blockScannerReport", BlockScanner.Servlet.class);
infoServer.setAttribute("secondary.name.node", this); infoServer.setAttribute("name.system.image", checkpointImage); infoServer.setAttribute(JspHelper.CURRENT_CONF, conf); infoServer.addInternalServlet("imagetransfer", ImageServlet.PATH_SPEC, ImageServlet.class, true);
DFSConfigKeys.DFS_DATANODE_HTTPS_ADDRESS_KEY, infoHost + ":" + DFSConfigKeys.DFS_DATANODE_HTTPS_DEFAULT_PORT)); httpServer.setAttribute(DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY, datanodeSslPort.getPort()); NamenodeWebHdfsMethods.class.getPackage().getName()); httpServer.setAttribute(NAMENODE_ATTRIBUTE_KEY, nn); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); setupServlets(httpServer, conf); httpServer.start();
/** * Sets fsimage for use by servlets. * * @param fsImage FSImage to set */ void setFSImage(FSImage fsImage) { httpServer.setAttribute(FSIMAGE_ATTRIBUTE_KEY, fsImage); }
/** * Sets fsimage for use by servlets. * * @param fsImage FSImage to set */ void setFSImage(FSImage fsImage) { httpServer.setAttribute(FSIMAGE_ATTRIBUTE_KEY, fsImage); }
/** * Sets startup progress of namenode for use by servlets. * * @param prog StartupProgress to set */ void setStartupProgress(StartupProgress prog) { httpServer.setAttribute(STARTUP_PROGRESS_ATTRIBUTE_KEY, prog); }
/** * Sets startup progress of namenode for use by servlets. * * @param prog StartupProgress to set */ void setStartupProgress(StartupProgress prog) { httpServer.setAttribute(STARTUP_PROGRESS_ATTRIBUTE_KEY, prog); }
public void setWebServerAttribute(HasServer hasServer) { httpServer.setAttribute(HAS_SERVER_ATTRIBUTE_KEY, hasServer); }
public void setWebServerAttribute(HasServer hasServer) { httpServer.setAttribute(HAS_SERVER_ATTRIBUTE_KEY, hasServer); }
/** * Sets address of namenode for use by servlets. * * @param nameNodeAddress InetSocketAddress to set */ void setNameNodeAddress(InetSocketAddress nameNodeAddress) { httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, NetUtils.getConnectAddress(nameNodeAddress)); }
/** * Sets address of namenode for use by servlets. * * @param nameNodeAddress InetSocketAddress to set */ void setNameNodeAddress(InetSocketAddress nameNodeAddress) { httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, NetUtils.getConnectAddress(nameNodeAddress)); }
void start() throws IOException { final InetSocketAddress httpAddr = getAddress(conf); final String httpsAddrString = conf.get( DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_KEY, DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_DEFAULT); InetSocketAddress httpsAddr = NetUtils.createSocketAddr(httpsAddrString); HttpServer2.Builder builder = DFSUtil.httpServerTemplateForNNAndJN(conf, httpAddr, httpsAddr, "journal", DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_INTERNAL_SPNEGO_PRINCIPAL_KEY, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY); httpServer = builder.build(); httpServer.setAttribute(JN_ATTRIBUTE_KEY, localJournalNode); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true); httpServer.start(); }
void start() throws IOException { final InetSocketAddress httpAddr = getAddress(conf); final String httpsAddrString = conf.get( DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_KEY, DFSConfigKeys.DFS_JOURNALNODE_HTTPS_ADDRESS_DEFAULT); InetSocketAddress httpsAddr = NetUtils.createSocketAddr(httpsAddrString); HttpServer2.Builder builder = DFSUtil.httpServerTemplateForNNAndJN(conf, httpAddr, httpsAddr, "journal", DFSConfigKeys.DFS_JOURNALNODE_KERBEROS_INTERNAL_SPNEGO_PRINCIPAL_KEY, DFSConfigKeys.DFS_JOURNALNODE_KEYTAB_FILE_KEY); httpServer = builder.build(); httpServer.setAttribute(JN_ATTRIBUTE_KEY, localJournalNode); httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true); httpServer.start(); }
public static void openHBase(String tablename) throws IOException { Configuration conf = HBaseConfiguration.create(); synchronized (HConnection.class) { if (connection == null) connection = HConnectionManager.createConnection(conf); } synchronized (HTableInterface.class) { if (table == null) { table = connection.getTable("recsys_logs"); } } /* start http info server */ HttpServer2.Builder builder = new HttpServer2.Builder().setName("recsys").setConf(conf); InetSocketAddress addr = NetUtils.createSocketAddr("0.0.0.0", 8089); builder.addEndpoint(URI.create("http://" + NetUtils.getHostPortString(addr))); infoServer = builder.build(); infoServer.addServlet("monitor", "/monitor", RecsysLogs.class); infoServer.setAttribute("htable", table); infoServer.setAttribute("conf", conf); infoServer.start(); }
/** * Test that the server is alive once started * * @throws Throwable * on failure */ @Test public void testWepAppContextAfterServerStop() throws Throwable { HttpServer2 server = null; String key = "test.attribute.key"; String value = "test.attribute.value"; server = createTestServer(); assertNotLive(server); server.start(); server.setAttribute(key, value); assertAlive(server); assertEquals(value, server.getAttribute(key)); stop(server); assertNull("Server context should have cleared", server.getAttribute(key)); } }
/** * Test that the server is alive once started * * @throws Throwable * on failure */ @Test public void testWepAppContextAfterServerStop() throws Throwable { HttpServer2 server = null; String key = "test.attribute.key"; String value = "test.attribute.value"; server = createTestServer(); assertNotLive(server); server.start(); server.setAttribute(key, value); assertAlive(server); assertEquals(value, server.getAttribute(key)); stop(server); assertNull("Server context should have cleared", server.getAttribute(key)); } }