org.apache.samza.util.Util.logThreadDump()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(163)

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

Util.logThreadDump介绍

暂无

代码示例

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. /**
  2. * Method invoked when the given thread terminates due to the
  3. * given uncaught exception.
  4. * <p>Any exception thrown by this method will be ignored by the
  5. * Java Virtual Machine.
  6. *
  7. * @param t the thread
  8. * @param e the exception
  9. */
  10. @Override
  11. public void uncaughtException(Thread t, Throwable e) {
  12. String msg = String.format("Uncaught exception in thread %s.", t.getName());
  13. LOGGER.error(msg, e);
  14. System.err.println(msg);
  15. e.printStackTrace(System.err);
  16. try {
  17. Util.logThreadDump("Thread dump from uncaught exception handler.");
  18. runnable.run();
  19. } catch (Throwable throwable) {
  20. // Ignore to avoid further exception propagation
  21. }
  22. }
  23. }

代码示例来源:origin: org.apache.samza/samza-core

  1. /**
  2. * Method invoked when the given thread terminates due to the
  3. * given uncaught exception.
  4. * <p>Any exception thrown by this method will be ignored by the
  5. * Java Virtual Machine.
  6. *
  7. * @param t the thread
  8. * @param e the exception
  9. */
  10. @Override
  11. public void uncaughtException(Thread t, Throwable e) {
  12. String msg = String.format("Uncaught exception in thread %s.", t.getName());
  13. LOGGER.error(msg, e);
  14. System.err.println(msg);
  15. e.printStackTrace(System.err);
  16. try {
  17. Util.logThreadDump("Thread dump from uncaught exception handler.");
  18. runnable.run();
  19. } catch (Throwable throwable) {
  20. // Ignore to avoid further exception propagation
  21. }
  22. }
  23. }

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. /**
  2. * Method invoked when the given thread terminates due to the
  3. * given uncaught exception.
  4. * <p>Any exception thrown by this method will be ignored by the
  5. * Java Virtual Machine.
  6. *
  7. * @param t the thread
  8. * @param e the exception
  9. */
  10. @Override
  11. public void uncaughtException(Thread t, Throwable e) {
  12. String msg = String.format("Uncaught exception in thread %s.", t.getName());
  13. LOGGER.error(msg, e);
  14. System.err.println(msg);
  15. e.printStackTrace(System.err);
  16. try {
  17. Util.logThreadDump("Thread dump from uncaught exception handler.");
  18. runnable.run();
  19. } catch (Throwable throwable) {
  20. // Ignore to avoid further exception propagation
  21. }
  22. }
  23. }

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. /**
  2. * Method invoked when the given thread terminates due to the
  3. * given uncaught exception.
  4. * <p>Any exception thrown by this method will be ignored by the
  5. * Java Virtual Machine.
  6. *
  7. * @param t the thread
  8. * @param e the exception
  9. */
  10. @Override
  11. public void uncaughtException(Thread t, Throwable e) {
  12. String msg = String.format("Uncaught exception in thread %s.", t.getName());
  13. LOGGER.error(msg, e);
  14. System.err.println(msg);
  15. e.printStackTrace(System.err);
  16. try {
  17. Util.logThreadDump("Thread dump from uncaught exception handler.");
  18. runnable.run();
  19. } catch (Throwable throwable) {
  20. // Ignore to avoid further exception propagation
  21. }
  22. }
  23. }

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. } else {
  2. LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
  3. Util.logThreadDump(message);
  4. shutdownExecutorService.shutdownNow();
  5. return false;

代码示例来源:origin: org.apache.samza/samza-core

  1. } else {
  2. LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
  3. Util.logThreadDump(message);
  4. shutdownExecutorService.shutdownNow();
  5. return false;

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. public void start() {
  2. if (started) {
  3. LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
  4. return;
  5. }
  6. LOG.info("Starting ContainerHeartbeatMonitor");
  7. scheduler.scheduleAtFixedRate(() -> {
  8. ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
  9. if (!response.isAlive()) {
  10. scheduler.schedule(() -> {
  11. // On timeout of container shutting down, force exit.
  12. LOG.error("Graceful shutdown timeout expired. Force exiting.");
  13. Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
  14. System.exit(1);
  15. }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
  16. onContainerExpired.run();
  17. }
  18. }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
  19. started = true;
  20. }

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. public void start() {
  2. if (started) {
  3. LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
  4. return;
  5. }
  6. LOG.info("Starting ContainerHeartbeatMonitor");
  7. scheduler.scheduleAtFixedRate(() -> {
  8. ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
  9. if (!response.isAlive()) {
  10. scheduler.schedule(() -> {
  11. // On timeout of container shutting down, force exit.
  12. LOG.error("Graceful shutdown timeout expired. Force exiting.");
  13. Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
  14. System.exit(1);
  15. }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
  16. onContainerExpired.run();
  17. }
  18. }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
  19. started = true;
  20. }

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. public void start() {
  2. if (started) {
  3. LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
  4. return;
  5. }
  6. LOG.info("Starting ContainerHeartbeatMonitor");
  7. scheduler.scheduleAtFixedRate(() -> {
  8. ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
  9. if (!response.isAlive()) {
  10. scheduler.schedule(() -> {
  11. // On timeout of container shutting down, force exit.
  12. LOG.error("Graceful shutdown timeout expired. Force exiting.");
  13. Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
  14. System.exit(1);
  15. }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
  16. onContainerExpired.run();
  17. }
  18. }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
  19. started = true;
  20. }

代码示例来源:origin: org.apache.samza/samza-core

  1. public void start() {
  2. if (started) {
  3. LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
  4. return;
  5. }
  6. LOG.info("Starting ContainerHeartbeatMonitor");
  7. scheduler.scheduleAtFixedRate(() -> {
  8. ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
  9. if (!response.isAlive()) {
  10. scheduler.schedule(() -> {
  11. // On timeout of container shutting down, force exit.
  12. LOG.error("Graceful shutdown timeout expired. Force exiting.");
  13. Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
  14. System.exit(1);
  15. }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
  16. onContainerExpired.run();
  17. }
  18. }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
  19. started = true;
  20. }

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. } else {
  2. LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
  3. Util.logThreadDump(message);
  4. shutdownExecutorService.shutdownNow();
  5. return false;

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. } else {
  2. LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
  3. Util.logThreadDump(message);
  4. shutdownExecutorService.shutdownNow();
  5. return false;

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. @Override
  2. public void run() {
  3. Util.logThreadDump("Thread dump at task callback timeout");
  4. String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
  5. callback.failure(new SamzaException(msg));
  6. }
  7. };

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. @Override
  2. public void run() {
  3. Util.logThreadDump("Thread dump at task callback timeout");
  4. String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
  5. callback.failure(new SamzaException(msg));
  6. }
  7. };

代码示例来源:origin: org.apache.samza/samza-core

  1. @Override
  2. public void run() {
  3. Util.logThreadDump("Thread dump at task callback timeout");
  4. String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
  5. callback.failure(new SamzaException(msg));
  6. }
  7. };

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. @Override
  2. public void run() {
  3. Util.logThreadDump("Thread dump at task callback timeout");
  4. String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
  5. callback.failure(new SamzaException(msg));
  6. }
  7. };

相关文章