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


Java U.shutdownNow方法代码示例

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


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

示例1: afterTest

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
    U.shutdownNow(ClientAbstractSelfTest.class, exec, log);

    exec = null;

    if (client != null)
        GridClientFactory.stop(client.id(), true);

    client = null;

    synchronized (cacheStores) {
        for (HashMapStore cacheStore : cacheStores.values())
            cacheStore.map.clear();
    }

    grid().cache(DEFAULT_CACHE_NAME).clear();
    grid().cache(CACHE_NAME).clear();

    INTERCEPTED_OBJECTS.clear();
}
 
开发者ID:apache,项目名称:ignite,代码行数:22,代码来源:ClientAbstractSelfTest.java

示例2: onKernalStop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void onKernalStop(boolean cancel) {
    if (srv != null) {
        busyLock.block();

        srv.stop();

        ctx.ports().deregisterPorts(getClass());

        if (execSvc != null) {
            U.shutdownNow(getClass(), execSvc, log);

            execSvc = null;
        }

        if (log.isDebugEnabled())
            log.debug("Client connector processor stopped.");
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:ClientListenerProcessor.java

示例3: stop

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

    U.shutdownNow(getClass(), pool, log);

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

示例4: stop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("OverlyStrongTypeCast")
@Override public void stop() throws IgniteException {
    if (log.isDebugEnabled())
        log.debug("Stopping page memory.");

    U.shutdownNow(getClass(), asyncRunner, log);

    if (segments != null) {
        for (Segment seg : segments)
            seg.close();
    }

    directMemoryProvider.shutdown();
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:PageMemoryImpl.java

示例5: stopThreads

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** */
public void stopThreads() {
    if (execSvc != null) {
        U.shutdownNow(getClass(), execSvc, log);

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

示例6: afterTest

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
    U.shutdownNow(getClass(), ctxExec, log);
    U.shutdownNow(getClass(), customExec, log);

    ctxExec = null;
    customExec = null;
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:IgniteFutureImplTest.java

示例7: afterTest

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
    U.shutdownNow(getClass(), exec, log);

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

示例8: loadCache

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void loadCache(IgniteBiInClosure<K, V> clo, Object... args) throws CacheLoaderException {
    if (clo == null)
        return;

    if (args == null || args.length == 0)
        args = new String[] {"select * from " + controller.getPersistenceSettings().getKeyspace() + "." + cassandraTable() + ";"};

    ExecutorService pool = null;

    Collection<Future<?>> futs = new ArrayList<>(args.length);

    try {
        pool = Executors.newFixedThreadPool(maxPoolSize, new IgniteThreadFactory(ignite.name(), CACHE_LOADER_THREAD_NAME));

        CassandraSession ses = getCassandraSession();

        for (Object obj : args) {
            LoadCacheCustomQueryWorker<K, V> task = null;

            if (obj instanceof Statement)
                task = new LoadCacheCustomQueryWorker<>(ses, (Statement)obj, controller, log, clo);
            else if (obj instanceof String) {
                String qry = ((String)obj).trim();

                if (qry.toLowerCase().startsWith("select"))
                    task = new LoadCacheCustomQueryWorker<>(ses, (String) obj, controller, log, clo);
            }

            if (task != null)
                futs.add(pool.submit(task));
        }

        for (Future<?> fut : futs)
            U.get(fut);

        if (log != null && log.isDebugEnabled() && storeSes != null)
            log.debug("Cache loaded from db: " + storeSes.cacheName());
    }
    catch (IgniteCheckedException e) {
        if (storeSes != null)
            throw new CacheLoaderException("Failed to load Ignite cache: " + storeSes.cacheName(), e.getCause());
        else
            throw new CacheLoaderException("Failed to load cache", e.getCause());
    }
    finally {
        U.shutdownNow(getClass(), pool, log);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:50,代码来源:CassandraCacheStore.java


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