private
HttpServer infoServer =
null
;
...
private
void
startInfoServer(Configuration conf)
throws
IOException {
InetSocketAddress infoSocAddr = DataNode.getInfoAddr(conf);
String infoHost = infoSocAddr.getHostName();
int
tmpInfoPort = infoSocAddr.getPort();
this
.infoServer = (secureResources ==
null
)
?
new
HttpServer(
"datanode"
, infoHost, tmpInfoPort, tmpInfoPort ==
0
,
conf,
new
AccessControlList(conf.get(DFS_ADMIN,
" "
)))
:
new
HttpServer(
"datanode"
, infoHost, tmpInfoPort, tmpInfoPort ==
0
,
conf,
new
AccessControlList(conf.get(DFS_ADMIN,
" "
)),
secureResources.getListener());
LOG.info(
"Opened info server at "
+ infoHost +
":"
+ tmpInfoPort);
.....
this
.infoServer.addInternalServlet(
null
,
"/streamFile/*"
, StreamFile.
class
);
this
.infoServer.addInternalServlet(
null
,
"/getFileChecksum/*"
,
FileChecksumServlets.GetServlet.
class
);
this
.infoServer.setAttribute(
"datanode"
,
this
);
this
.infoServer.setAttribute(JspHelper.CURRENT_CONF, conf);
this
.infoServer.addServlet(
null
,
"/blockScannerReport"
,
DataBlockScanner.Servlet.
class
);
if
(WebHdfsFileSystem.isEnabled(conf, LOG)) {
infoServer.addJerseyResourcePackage(DatanodeWebHdfsMethods.
class
.getPackage().getName() +
";"
+ Param.
class
.getPackage().getName(),
WebHdfsFileSystem.PATH_PREFIX +
"/*"
);
}
this
.infoServer.start();
}