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

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

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

HttpServer.setAttribute介绍

[英]Set a value in the webapp context. These values are available to the jsp pages as "application.getAttribute(name)".
[中]在webapp上下文中设置一个值。这些值作为“application.getAttribute(name)”可用于jsp页面。

代码示例

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 setAttribute(webAppContext, name, value);
}

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

public FileSystem run() throws IOException {
  jobHistory.init(jtFinal, conf, jtFinal.localMachine, jtFinal.startTime);
  jobHistory.initDone(conf, fs);
  final String historyLogDir = 
   jobHistory.getCompletedJobHistoryLocation().toString();
  infoServer.setAttribute("historyLogDir", historyLogDir);
  return new Path(historyLogDir).getFileSystem(conf);
 }
});

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

server.setAttribute("task.tracker", this);
server.setAttribute("local.file.system", local);
server.setAttribute("conf", conf);
server.setAttribute("log", LOG);
server.setAttribute("localDirAllocator", localDirAllocator);
server.setAttribute("shuffleServerMetrics", shuffleServerMetrics);
server.setAttribute(ReconfigurationServlet.
          CONF_SERVLET_RECONFIGURABLE_PREFIX + "/ttconfchange",
          TaskTracker.this);
server.setAttribute("nettyMapOutputHttpPort", nettyMapOutputHttpPort);
server.addInternalServlet("reconfiguration", "/ttconfchange",
              ReconfigurationServlet.class);

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

this.httpServer.setAttribute("datanode.https.port", datanodeSslPort
   .getPort());
this.httpServer.setAttribute("name.node", this);
this.httpServer.setAttribute("name.node.address", getNameNodeAddress());
this.httpServer.setAttribute("name.system.image", getFSImage());
this.httpServer.setAttribute("name.conf", conf);
this.httpServer.addInternalServlet("fsck", "/fsck", FsckServlet.class);
this.httpServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);
this.httpServer.addInternalServlet("checksum", "/fileChecksum/*",
  FileChecksumServlets.RedirectServlet.class);
httpServer.setAttribute(ReconfigurationServlet.
            CONF_SERVLET_RECONFIGURABLE_PREFIX +
            CONF_SERVLET_PATH, NameNode.this);

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

this.infoServer.setAttribute("datanode.https.port", datanodeSslPort
   .getPort());
this.infoServer.addInternalServlet(null, "/getFileChecksum/*",
  FileChecksumServlets.GetServlet.class);
this.infoServer.setAttribute("datanode", this);
this.infoServer.addServlet(null, "/blockScannerReport", 
              DataBlockScannerSet.Servlet.class);
this.infoServer.setAttribute(ReconfigurationServlet.CONF_SERVLET_RECONFIGURABLE_PREFIX +
CONF_SERVLET_PATH, DataNode.this);
this.infoServer.addServlet("dnConf", CONF_SERVLET_PATH, ReconfigurationServlet.class);

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

myServer.setAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE, conf);
myServer.start();
int port = myServer.getPort();

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

myServer.setAttribute(HttpServer.CONF_CONTEXT_ATTRIBUTE, conf);
myServer.start();
int port = myServer.getPort();

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

infoServer = new HttpServer("secondary", infoBindAddress, tmpInfoPort,
  tmpInfoPort == 0, conf);
infoServer.setAttribute("name.system.image", checkpointImage);
this.infoServer.setAttribute("name.conf", conf);
infoServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);
infoServer.start();

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

public void startServerForClientRequests() throws IOException {
 if (this.server == null) {
  InetSocketAddress socAddr = NameNode.getAddress(getConf());
  int handlerCount = getConf().getInt("dfs.namenode.handler.count", 10); 
  
  // create rpc server 
  this.server = RPC.getServer(this, socAddr.getHostName(), socAddr.getPort(),
                handlerCount, false, getConf());
  // The rpc-server port can be ephemeral... ensure we have the correct info
  this.serverAddress = this.server.getListenerAddress();
  FileSystem.setDefaultUri(getConf(), getUri(serverAddress));
  if (this.httpServer != null) {
   // This means the server is being started once out of safemode
   // and jetty is initialized already
   this.httpServer.setAttribute("name.node.address", getNameNodeAddress());
  }
  LOG.info("Namenode up at: " + this.serverAddress);
  
  
  this.server.start();
 }
}

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

SecretKey tokenSecret = JobTokenSecretManager.createSecretKey(jt.getPassword());
server.setAttribute("task.tracker", tt);

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

server.setAttribute("task.tracker", this);
server.setAttribute("local.file.system", local);
server.setAttribute("conf", conf);
server.setAttribute("log", LOG);
server.setAttribute("localDirAllocator", localDirAllocator);
server.setAttribute("shuffleServerMetrics", shuffleServerMetrics);
server.addInternalServlet("mapOutput", "/mapOutput", MapOutputServlet.class);
server.addServlet("taskLog", "/tasklog", TaskLogServlet.class);

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

infoServer = new HttpServer("secondary", infoBindAddress, tmpInfoPort,
  tmpInfoPort == 0, conf);
infoServer.setAttribute("name.system.image", checkpointImage);
this.infoServer.setAttribute("name.conf", conf);
infoServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);
infoServer.start();

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

infoServer = new HttpServer("job", infoBindAddress, tmpInfoPort, 
  tmpInfoPort == 0, conf);
infoServer.setAttribute("job.tracker", this);
infoServer.setAttribute("fileSys", historyFS);
infoServer.addServlet("reducegraph", "/taskgraph", TaskGraphServlet.class);
infoServer.start();

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

infoServer = new HttpServer("job", infoBindAddress, tmpInfoPort,
  tmpInfoPort == 0, conf);
infoServer.setAttribute("job.tracker", this);
infoServer.setAttribute(ReconfigurationServlet.
            CONF_SERVLET_RECONFIGURABLE_PREFIX +
            "/jtconfchange", jobTrackerReconfigurable);
 infoServer.setAttribute(ReconfigurationServlet.
             CONF_SERVLET_RECONFIGURABLE_PREFIX +
             "/fsconfchange", taskScheduler);
 String historyLogDir =
  JobHistory.getCompletedJobHistoryLocation().toString();
 infoServer.setAttribute("historyLogDir", historyLogDir);
 FileSystem historyFS = new Path(historyLogDir).getFileSystem(conf);
 infoServer.setAttribute("fileSys", historyFS);

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

this.infoServer.addInternalServlet(null, "/getFileChecksum/*",
  FileChecksumServlets.GetServlet.class);
this.infoServer.setAttribute("datanode.blockScanner", blockScanner);
this.infoServer.addServlet(null, "/blockScannerReport", 
              DataBlockScanner.Servlet.class);

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

FileChecksumServlets.GetServlet.class);
this.infoServer.setAttribute("datanode", this);
this.infoServer.setAttribute("datanode.blockScanner", blockScanner);
this.infoServer.setAttribute(JspHelper.CURRENT_CONF, conf);
this.infoServer.addServlet(null, "/blockScannerReport", 
              DataBlockScanner.Servlet.class);

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

infoServer = new HttpServer("job", infoBindAddress, tmpInfoPort, 
  tmpInfoPort == 0, conf, aclsManager.getAdminsAcl());
infoServer.setAttribute("job.tracker", this);
final String historyLogDir = 
 jobHistory.getCompletedJobHistoryLocation().toString();
infoServer.setAttribute("historyLogDir", historyLogDir);
FileSystem historyFS = getMROwner().doAs(
  new PrivilegedExceptionAction<FileSystem>() {
infoServer.setAttribute("fileSys", historyFS);

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

this.infoServer.setAttribute("datanode.https.port",
  datanodeSslPort.getPort());
this.infoServer.setAttribute("name.node", nn);
this.infoServer.setAttribute("name.system.image", getFSImage());
this.infoServer.setAttribute("name.conf", conf);
this.infoServer.addInternalServlet("fsck", "/fsck", FsckServlet.class);
this.infoServer.addInternalServlet("getimage", "/getimage", GetImageServlet.class);

相关文章