本文整理汇总了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();
}
示例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.");
}
}
示例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;
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
}