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


Java U.cancel方法代码示例

本文整理汇总了Java中org.apache.ignite.internal.util.typedef.internal.U.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java U.cancel方法的具体用法?Java U.cancel怎么用?Java U.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.internal.util.typedef.internal.U的用法示例。


在下文中一共展示了U.cancel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Stops the server.
 *
 * @throws IgniteCheckedException
 */
public void stop() throws IgniteCheckedException {
    // Stop TCP server.
    if (nioSrvr != null)
        nioSrvr.stop();

    U.cancel(shmemAcceptWorker);
    U.join(shmemAcceptWorker, log);

    U.cancel(shmemWorkers);
    U.join(shmemWorkers, log);

    shmemWorkers.clear();

    // Force closing on stop (safety).
    for (HadoopCommunicationClient client : clients.values())
        client.forceClose();

    // Clear resources.
    nioSrvr = null;

    boundTcpPort = -1;
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:HadoopExternalCommunication.java

示例2: stop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void stop(boolean cancel) throws IgniteCheckedException {
    busyLock.block();

    // Stop receiving notifications.
    getSpi().setListener(null);

    // Stop discovery worker and metrics updater.
    U.closeQuiet(metricsUpdateTask);

    U.cancel(discoWrk);

    U.join(discoWrk, log);

    // Stop SPI itself.
    stopSpi();

    // Stop spi if was not add in spi map but port was open.
    if (!registeredDiscoSpi)
        getSpi().spiStop();

    registeredDiscoSpi = false;

    if (log.isDebugEnabled())
        log.debug(stopInfo());
}
 
开发者ID:apache,项目名称:ignite,代码行数:27,代码来源:GridDiscoveryManager.java

示例3: stop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Stops all threads and releases all resources.
 */
public void stop() {
    if (!closed) {
        closed = true;

        // Make sure to entirely stop acceptor if any.
        U.interrupt(acceptThread);
        U.join(acceptThread, log);

        U.cancel(clientWorkers);
        U.join(clientWorkers, log);

        filterChain.stop();

        for (GridSelectorNioSessionImpl ses : sessions)
            ses.onServerStopped();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridNioServer.java

示例4: join

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Waits for all workers to finish.
 *
 * @param cancel Flag to indicate whether workers should be cancelled
 *      before waiting for them to finish.
 */
public void join(boolean cancel) {
    if (cancel)
        U.cancel(workers);

    // Record current interrupted status of calling thread.
    boolean interrupted = Thread.interrupted();

    try {
        U.join(workers, log);
    }
    finally {
        // Reset interrupted flag on calling thread.
        if (interrupted)
            Thread.currentThread().interrupt();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:GridWorkerPool.java

示例5: close

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void close() {
    closed = true;

    U.closeQuiet(srvSock);

    if (gcWorker != null) {
        U.cancel(gcWorker);

        // This method may be called from already interrupted thread.
        // Need to ensure cleaning on close.
        boolean interrupted = Thread.interrupted();

        try {
            U.join(gcWorker);
        }
        catch (IgniteInterruptedCheckedException e) {
            U.warn(log, "Interrupted when stopping GC worker.", e);
        }
        finally {
            if (interrupted)
                Thread.currentThread().interrupt();
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:26,代码来源:IpcSharedMemoryServerEndpoint.java

示例6: spiStop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void spiStop() throws IgniteSpiException {
    assert stopping;

    unregisterMBean();

    // Stop TCP server.
    if (nioSrvr != null)
        nioSrvr.stop();

    U.interrupt(commWorker);
    U.join(commWorker, log);

    U.cancel(shmemAcceptWorker);
    U.join(shmemAcceptWorker, log);

    U.cancel(shmemWorkers);
    U.join(shmemWorkers, log);

    shmemWorkers.clear();

    // Force closing on stop (safety).
    for (GridCommunicationClient[] clients0 : clients.values()) {
        for (GridCommunicationClient client : clients0) {
            if (client != null)
                client.forceClose();
        }
    }

    // Clear resources.
    nioSrvr = null;
    commWorker = null;

    boundTcpPort = -1;

    // Ack stop.
    if (log.isDebugEnabled())
        log.debug(stopInfo());
}
 
开发者ID:apache,项目名称:ignite,代码行数:40,代码来源:TcpCommunicationSpi.java

示例7: stopCleanupWorker

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 *
 */
private void stopCleanupWorker() {
    if (null != cleanupWorker) {
        U.cancel(cleanupWorker);
        U.join(cleanupWorker, log);

        cleanupWorker = null;
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:GridCacheSharedTtlCleanupManager.java


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