本文整理了Java中org.apache.samza.util.Util.logThreadDump()
方法的一些代码示例,展示了Util.logThreadDump()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.logThreadDump()
方法的具体详情如下:
包路径:org.apache.samza.util.Util
类名称:Util
方法名:logThreadDump
暂无
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* Method invoked when the given thread terminates due to the
* given uncaught exception.
* <p>Any exception thrown by this method will be ignored by the
* Java Virtual Machine.
*
* @param t the thread
* @param e the exception
*/
@Override
public void uncaughtException(Thread t, Throwable e) {
String msg = String.format("Uncaught exception in thread %s.", t.getName());
LOGGER.error(msg, e);
System.err.println(msg);
e.printStackTrace(System.err);
try {
Util.logThreadDump("Thread dump from uncaught exception handler.");
runnable.run();
} catch (Throwable throwable) {
// Ignore to avoid further exception propagation
}
}
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* Method invoked when the given thread terminates due to the
* given uncaught exception.
* <p>Any exception thrown by this method will be ignored by the
* Java Virtual Machine.
*
* @param t the thread
* @param e the exception
*/
@Override
public void uncaughtException(Thread t, Throwable e) {
String msg = String.format("Uncaught exception in thread %s.", t.getName());
LOGGER.error(msg, e);
System.err.println(msg);
e.printStackTrace(System.err);
try {
Util.logThreadDump("Thread dump from uncaught exception handler.");
runnable.run();
} catch (Throwable throwable) {
// Ignore to avoid further exception propagation
}
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* Method invoked when the given thread terminates due to the
* given uncaught exception.
* <p>Any exception thrown by this method will be ignored by the
* Java Virtual Machine.
*
* @param t the thread
* @param e the exception
*/
@Override
public void uncaughtException(Thread t, Throwable e) {
String msg = String.format("Uncaught exception in thread %s.", t.getName());
LOGGER.error(msg, e);
System.err.println(msg);
e.printStackTrace(System.err);
try {
Util.logThreadDump("Thread dump from uncaught exception handler.");
runnable.run();
} catch (Throwable throwable) {
// Ignore to avoid further exception propagation
}
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* Method invoked when the given thread terminates due to the
* given uncaught exception.
* <p>Any exception thrown by this method will be ignored by the
* Java Virtual Machine.
*
* @param t the thread
* @param e the exception
*/
@Override
public void uncaughtException(Thread t, Throwable e) {
String msg = String.format("Uncaught exception in thread %s.", t.getName());
LOGGER.error(msg, e);
System.err.println(msg);
e.printStackTrace(System.err);
try {
Util.logThreadDump("Thread dump from uncaught exception handler.");
runnable.run();
} catch (Throwable throwable) {
// Ignore to avoid further exception propagation
}
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
} else {
LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
Util.logThreadDump(message);
shutdownExecutorService.shutdownNow();
return false;
代码示例来源:origin: org.apache.samza/samza-core
} else {
LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
Util.logThreadDump(message);
shutdownExecutorService.shutdownNow();
return false;
代码示例来源:origin: org.apache.samza/samza-core_2.11
public void start() {
if (started) {
LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
return;
}
LOG.info("Starting ContainerHeartbeatMonitor");
scheduler.scheduleAtFixedRate(() -> {
ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
if (!response.isAlive()) {
scheduler.schedule(() -> {
// On timeout of container shutting down, force exit.
LOG.error("Graceful shutdown timeout expired. Force exiting.");
Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
System.exit(1);
}, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
onContainerExpired.run();
}
}, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
started = true;
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
public void start() {
if (started) {
LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
return;
}
LOG.info("Starting ContainerHeartbeatMonitor");
scheduler.scheduleAtFixedRate(() -> {
ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
if (!response.isAlive()) {
scheduler.schedule(() -> {
// On timeout of container shutting down, force exit.
LOG.error("Graceful shutdown timeout expired. Force exiting.");
Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
System.exit(1);
}, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
onContainerExpired.run();
}
}, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
started = true;
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
public void start() {
if (started) {
LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
return;
}
LOG.info("Starting ContainerHeartbeatMonitor");
scheduler.scheduleAtFixedRate(() -> {
ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
if (!response.isAlive()) {
scheduler.schedule(() -> {
// On timeout of container shutting down, force exit.
LOG.error("Graceful shutdown timeout expired. Force exiting.");
Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
System.exit(1);
}, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
onContainerExpired.run();
}
}, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
started = true;
}
代码示例来源:origin: org.apache.samza/samza-core
public void start() {
if (started) {
LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor.");
return;
}
LOG.info("Starting ContainerHeartbeatMonitor");
scheduler.scheduleAtFixedRate(() -> {
ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat();
if (!response.isAlive()) {
scheduler.schedule(() -> {
// On timeout of container shutting down, force exit.
LOG.error("Graceful shutdown timeout expired. Force exiting.");
Util.logThreadDump("Thread dump at heartbeat monitor shutdown timeout.");
System.exit(1);
}, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS);
onContainerExpired.run();
}
}, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS);
started = true;
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
} else {
LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
Util.logThreadDump(message);
shutdownExecutorService.shutdownNow();
return false;
代码示例来源:origin: org.apache.samza/samza-core_2.10
} else {
LOG.error("Shutdown function for {} remains unfinished after timeout({}ms) or interruption", message, timeoutMs);
Util.logThreadDump(message);
shutdownExecutorService.shutdownNow();
return false;
代码示例来源:origin: org.apache.samza/samza-core_2.12
@Override
public void run() {
Util.logThreadDump("Thread dump at task callback timeout");
String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
callback.failure(new SamzaException(msg));
}
};
代码示例来源:origin: org.apache.samza/samza-core_2.11
@Override
public void run() {
Util.logThreadDump("Thread dump at task callback timeout");
String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
callback.failure(new SamzaException(msg));
}
};
代码示例来源:origin: org.apache.samza/samza-core
@Override
public void run() {
Util.logThreadDump("Thread dump at task callback timeout");
String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
callback.failure(new SamzaException(msg));
}
};
代码示例来源:origin: org.apache.samza/samza-core_2.10
@Override
public void run() {
Util.logThreadDump("Thread dump at task callback timeout");
String msg = "Callback for task {} " + callback.taskName + " timed out after " + timeout + " ms.";
callback.failure(new SamzaException(msg));
}
};
内容来源于网络,如有侵权,请联系作者删除!