当前位置: 首页>>代码示例>>Java>>正文


Java U.dumpThreads方法代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:IgniteFailoverAbstractBenchmark.java

示例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);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:40,代码来源:GridCachePartitionExchangeManager.java

示例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.");
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:IgniteClientReconnectAbstractTest.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:44,代码来源:HadoopTaskExecutionSelfTest.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:60,代码来源:HadoopTaskExecutionSelfTest.java

示例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();
}
 
开发者ID:apache,项目名称:ignite,代码行数:46,代码来源:GridServiceProcessorStopSelfTest.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:69,代码来源:GridServiceProcessorStopSelfTest.java


注:本文中的org.apache.ignite.internal.util.typedef.internal.U.dumpThreads方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。