本文整理汇总了Java中org.apache.hadoop.hbase.monitoring.ThreadMonitoring类的典型用法代码示例。如果您正苦于以下问题:Java ThreadMonitoring类的具体用法?Java ThreadMonitoring怎么用?Java ThreadMonitoring使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ThreadMonitoring类属于org.apache.hadoop.hbase.monitoring包,在下文中一共展示了ThreadMonitoring类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dumpTo
import org.apache.hadoop.hbase.monitoring.ThreadMonitoring; //导入依赖的package包/类
/**
* Dump a textual representation of the executor's status
* to the given writer.
*
* @param out the stream to write to
* @param indent a string prefix for each line, used for indentation
*/
public void dumpTo(Writer out, String indent) throws IOException {
out.write(indent + "Status for executor: " + executor + "\n");
out.write(indent + "=======================================\n");
out.write(indent + queuedEvents.size() + " events queued, " +
running.size() + " running\n");
if (!queuedEvents.isEmpty()) {
out.write(indent + "Queued:\n");
for (EventHandler e : queuedEvents) {
out.write(indent + " " + e + "\n");
}
out.write("\n");
}
if (!running.isEmpty()) {
out.write(indent + "Running:\n");
for (RunningEventStatus stat : running) {
out.write(indent + " Running on thread '" +
stat.threadInfo.getThreadName() +
"': " + stat.event + "\n");
out.write(ThreadMonitoring.formatThreadInfo(
stat.threadInfo, indent + " "));
out.write("\n");
}
}
out.flush();
}
示例2: RunningEventStatus
import org.apache.hadoop.hbase.monitoring.ThreadMonitoring; //导入依赖的package包/类
public RunningEventStatus(Thread t, EventHandler event) {
this.threadInfo = ThreadMonitoring.getThreadInfo(t);
this.event = event;
}