本文整理了Java中org.apache.hadoop.http.HttpServer.isInstrumentationAccessAllowed()
方法的一些代码示例,展示了HttpServer.isInstrumentationAccessAllowed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.isInstrumentationAccessAllowed()
方法的具体详情如下:
包路径:org.apache.hadoop.http.HttpServer
类名称:HttpServer
方法名:isInstrumentationAccessAllowed
[英]Checks the user has privileges to access to instrumentation servlets.
If hadoop.security.instrumentation.requires.admin
is set to FALSE (default value) it always returns TRUE.
If hadoop.security.instrumentation.requires.admin
is set to TRUE it will check that if the current user is in the admin ACLS. If the user is in the admin ACLs it returns TRUE, otherwise it returns FALSE.
[中]检查用户是否具有访问检测servlet的权限。
如果hadoop.security.instrumentation.requires.admin
设置为FALSE(默认值),则它始终返回TRUE。
如果hadoop.security.instrumentation.requires.admin
设置为TRUE,它将检查当前用户是否在管理ACL中。如果用户在管理ACL中,则返回TRUE,否则返回FALSE。
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}
response.setContentType("text/plain; charset=UTF-8");
try (PrintStream out = new PrintStream(
response.getOutputStream(), false, "UTF-8")) {
ReflectionUtils.printThreadInfo(out, "");
}
ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
}
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}
response.setContentType("text/plain; charset=UTF-8");
try (PrintStream out = new PrintStream(
response.getOutputStream(), false, "UTF-8")) {
ReflectionUtils.printThreadInfo(out, "");
}
ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
}
}
代码示例来源:origin: io.hops/hadoop-common
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}
response.setContentType("text/plain; charset=UTF-8");
try (PrintStream out = new PrintStream(
response.getOutputStream(), false, "UTF-8")) {
ReflectionUtils.printThreadInfo(out, "");
}
ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}
response.setContentType("text/plain; charset=UTF-8");
try (PrintStream out = new PrintStream(
response.getOutputStream(), false, "UTF-8")) {
ReflectionUtils.printThreadInfo(out, "");
}
ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
}
}
代码示例来源:origin: io.fabric8/fabric-hadoop
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// Do the authorization
if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}
PrintWriter out = new PrintWriter
(HtmlQuoting.quoteOutputStream(response.getOutputStream()));
ReflectionUtils.printThreadInfo(out, "");
out.close();
ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
}
}
内容来源于网络,如有侵权,请联系作者删除!