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