Java Code Examples for org.apache.hadoop.util.ReflectionUtils#printThreadInfo()

The following examples show how to use org.apache.hadoop.util.ReflectionUtils#printThreadInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: incubator-tajo   File: ThreadUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param t Waits on the passed thread to die dumping a threaddump every
 * minute while its up.
 * @throws InterruptedException
 */
public static void threadDumpingIsAlive(final Thread t)
throws InterruptedException {
  if (t == null) {
    return;
  }

  while (t.isAlive()) {
    t.join(60 * 1000);
    if (t.isAlive()) {
      ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
          "Automatic Stack Trace every 60 seconds waiting on " +
          t.getName());
    }
  }
}
 
Example 2
Source Project: hadoop-ozone   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 3
private void assertXceiverCount(int expected) {
  int count = getXceiverCountWithoutServer();
  if (count != expected) {
    ReflectionUtils.printThreadInfo(System.err, "Thread dumps");
    fail("Expected " + expected + " xceivers, found " +
        count);
  }
}
 
Example 4
Source Project: hadoop   File: HttpServer.java    License: Apache License 2.0 5 votes vote down vote up
@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);      
}
 
Example 5
Source Project: hadoop   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 6
Source Project: big-c   File: TestDataTransferKeepalive.java    License: Apache License 2.0 5 votes vote down vote up
private void assertXceiverCount(int expected) {
  int count = getXceiverCountWithoutServer();
  if (count != expected) {
    ReflectionUtils.printThreadInfo(System.err, "Thread dumps");
    fail("Expected " + expected + " xceivers, found " +
        count);
  }
}
 
Example 7
Source Project: big-c   File: HttpServer.java    License: Apache License 2.0 5 votes vote down vote up
@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);      
}
 
Example 8
Source Project: big-c   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 9
Source Project: lucene-solr   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 10
Source Project: knox   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 11
Source Project: knox   File: HttpServer2.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  if (!HttpServer2.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);
}
 
Example 12
Source Project: RDFS   File: HttpServer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
  PrintWriter out = new PrintWriter
                (HtmlQuoting.quoteOutputStream(response.getOutputStream()));
  ReflectionUtils.printThreadInfo(out, "");
  out.close();
  ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);      
}
 
Example 13
Source Project: hadoop-gpu   File: HttpServer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
  PrintWriter out = new PrintWriter(response.getOutputStream());
  ReflectionUtils.printThreadInfo(out, "");
  out.close();
  ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);      
}