本文整理汇总了Java中org.apache.ignite.internal.util.typedef.internal.U.dumpThreads方法的典型用法代码示例。如果您正苦于以下问题:Java U.dumpThreads方法的具体用法?Java U.dumpThreads怎么用?Java U.dumpThreads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.typedef.internal.U
的用法示例。
在下文中一共展示了U.dumpThreads方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void run() {
println("Driver finished with exception [driverNodeId=" + id + ", e=" + e + "]");
println("Full thread dump of the current server node below.");
U.dumpThreads(null);
println("");
((IgniteMXBean)ignite).dumpDebugInfo();
}
示例2: dumpLongRunningOperations
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @param timeout Operation timeout.
*/
public void dumpLongRunningOperations(long timeout) {
try {
GridDhtPartitionsExchangeFuture lastFut = lastInitializedFut;
// If exchange is in progress it will dump all hanging operations if any.
if (lastFut != null && !lastFut.isDone())
return;
if (U.currentTimeMillis() < nextLongRunningOpsDumpTime)
return;
if (dumpLongRunningOperations0(timeout)) {
nextLongRunningOpsDumpTime = U.currentTimeMillis() + nextDumpTimeout(longRunningOpsDumpStep++, timeout);
if (IgniteSystemProperties.getBoolean(IGNITE_THREAD_DUMP_ON_EXCHANGE_TIMEOUT, false)) {
U.warn(diagnosticLog, "Found long running cache operations, dump threads.");
U.dumpThreads(diagnosticLog);
}
if (IgniteSystemProperties.getBoolean(IGNITE_IO_DUMP_ON_TIMEOUT, false)) {
U.warn(diagnosticLog, "Found long running cache operations, dump IO statistics.");
// Dump IO manager statistics.
if (IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_IO_DUMP_ON_TIMEOUT, false))
cctx.gridIO().dumpStats();}
}
else {
nextLongRunningOpsDumpTime = 0;
longRunningOpsDumpStep = 0;
}
}
catch (Exception e) {
U.error(diagnosticLog, "Failed to dump debug information: " + e, e);
}
}
示例3: waitReconnectEvent
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @param log Logger.
* @param latch Latch.
* @throws Exception If failed.
*/
protected static void waitReconnectEvent(IgniteLogger log, CountDownLatch latch) throws Exception {
if (!latch.await(RECONNECT_TIMEOUT, MILLISECONDS)) {
log.error("Failed to wait for reconnect event, will dump threads, latch count: " + latch.getCount());
U.dumpThreads(log);
fail("Failed to wait for disconnect/reconnect event.");
}
}
示例4: testTaskCancelling
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @throws Exception If failed.
*/
public void testTaskCancelling() throws Exception {
Configuration cfg = prepareJobForCancelling();
HadoopJobId jobId = new HadoopJobId(UUID.randomUUID(), 1);
final IgniteInternalFuture<?> fut = grid(0).hadoop().submit(jobId, createJobInfo(cfg, null));
if (!GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
return splitsCount.get() > 0;
}
}, 20000)) {
U.dumpThreads(log);
assertTrue(false);
}
if (!GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
return executedTasks.get() == splitsCount.get();
}
}, 20000)) {
U.dumpThreads(log);
assertTrue(false);
}
// Fail mapper with id "1", cancels others
failMapperId.set(1);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
fut.get();
return null;
}
}, IgniteCheckedException.class, null);
assertEquals(executedTasks.get(), cancelledTasks.get() + 1);
}
示例5: testJobKill
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @throws Exception If failed.
*/
public void testJobKill() throws Exception {
Configuration cfg = prepareJobForCancelling();
Hadoop hadoop = grid(0).hadoop();
HadoopJobId jobId = new HadoopJobId(UUID.randomUUID(), 1);
//Kill unknown job.
boolean killRes = hadoop.kill(jobId);
assertFalse(killRes);
final IgniteInternalFuture<?> fut = hadoop.submit(jobId, createJobInfo(cfg, null));
if (!GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
return splitsCount.get() > 0;
}
}, 20000)) {
U.dumpThreads(log);
assertTrue(false);
}
if (!GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
X.println("___ executed tasks: " + executedTasks.get());
return executedTasks.get() == splitsCount.get();
}
}, 20000)) {
U.dumpThreads(log);
fail();
}
//Kill really ran job.
killRes = hadoop.kill(jobId);
assertTrue(killRes);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
fut.get();
return null;
}
}, IgniteCheckedException.class, null);
assertEquals(executedTasks.get(), cancelledTasks.get());
//Kill the same job again.
killRes = hadoop.kill(jobId);
assertFalse(killRes);
}
示例6: testStopDuringDeployment
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @throws Exception If failed.
*/
public void testStopDuringDeployment() throws Exception {
final CountDownLatch depLatch = new CountDownLatch(1);
final CountDownLatch finishLatch = new CountDownLatch(1);
final Ignite ignite = startGrid(0);
IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
IgniteServices svcs = ignite.services();
IgniteFuture f = svcs.deployClusterSingletonAsync("myClusterSingletonService", new TestServiceImpl());
depLatch.countDown();
try {
f.get();
}
catch (IgniteException ignored) {
finishLatch.countDown();
}
finally {
finishLatch.countDown();
}
return null;
}
}, "deploy-thread");
depLatch.await();
Ignition.stopAll(true);
boolean wait = finishLatch.await(15, TimeUnit.SECONDS);
if (!wait)
U.dumpThreads(log);
assertTrue("Deploy future isn't completed", wait);
fut.get();
}
示例7: testStopDuringHangedDeployment
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @throws Exception If failed.
*/
public void testStopDuringHangedDeployment() throws Exception {
final CountDownLatch depLatch = new CountDownLatch(1);
final CountDownLatch finishLatch = new CountDownLatch(1);
final IgniteEx node0 = startGrid(0);
final IgniteEx node1 = startGrid(1);
final IgniteEx node2 = startGrid(2);
final IgniteCache<Object, Object> cache = node2.getOrCreateCache(new CacheConfiguration<Object, Object>("def")
.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
node0.services().deployNodeSingleton("myService", new TestServiceImpl());
// Guarantee lock owner will never left topology unexpectedly.
final Integer lockKey = keyForNode(node2.affinity("def"), new AtomicInteger(1),
node2.cluster().localNode());
// Lock to hold topology version undone.
final Lock lock = cache.lock(lockKey);
// Try to change topology once service has deployed.
IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
depLatch.await();
node1.close();
return null;
}
}, "top-change-thread");
// Stop node on unstable topology.
GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
depLatch.await();
Thread.sleep(1000);
node0.close();
finishLatch.countDown();
return null;
}
}, "stopping-node-thread");
assertNotNull(node0.services().service("myService"));
// Freeze topology changing
lock.lock();
depLatch.countDown();
boolean wait = finishLatch.await(15, TimeUnit.SECONDS);
if (!wait)
U.dumpThreads(log);
assertTrue("Deploy future isn't completed", wait);
fut.get();
Ignition.stopAll(true);
}