@Override public boolean stop() { generation++; return Utils.stopThreads(threads); }
/** * First interrupts all the threads in the specified list and then waits until they have terminated. * If any have not terminated after a short delay (1000 ms), false is returned. */ public static boolean stopThreads(List<Thread> threads) { boolean status = true; threads.forEach(t -> t.interrupt()); for (Thread t : threads) { status = joinThread(t) && status; } return status; }
public boolean stop() { savedIndex = 0; return Utils.stopThreads(threads); }
public boolean stop() { return Utils.stopThreads(threads); }
/** * Stop. */ public void stop() { com.yahoo.gondola.core.Utils.stopThreads(new ArrayList<>(threads.values())); }
public boolean stop() { generation++; boolean status = channel.stop(); return Utils.stopThreads(threads) && status; }
@Override public void stop() { singleThreadExecutor.shutdown(); nodes.forEach(CloseableUtils::closeQuietly); for (NodeCache node : nodes) { try { node.close(); } catch (IOException e) { // ignored. logger.warn("[{}] Close ZK node cache failed. message={}", gondola.getHostId(), e.getMessage()); } } Utils.stopThreads(threads); }
/** * Stops all threads and releases all resources. After this call, start() can be called again. * * @return true if no errors were detected. */ public boolean stop() { logger.info("Stopping Gondola instance for host {}...", hostId); boolean status = network.stop(); // Shut down all local threads status = Utils.stopThreads(threads) && status; threads.clear(); // Shut down threads in all dependencies for (Shard shard : shards) { status = shard.stop() && status; } shards.clear(); shardMap.clear(); status = storage.stop() && status; status = clock.stop() && status; try { mbs.unregisterMBean(objectName); inited = false; } catch (InstanceNotFoundException | MBeanRegistrationException e) { logger.error("Unregister MBean failed", e); } catch (Exception e) { logger.error(e.getMessage(), e); } return status; }
public boolean stop() { boolean status = true; for (Peer peer : peers.values()) { status = peer.stop() && status; } for (Peer slave : slaves) { status = slave.stop() && status; } status = saveQueue.stop() && status; status = commitQueue.stop() && status; status = Utils.stopThreads(threads) && status; try { fileLock(false); } catch (IOException e) { logger.error("Could not release file lock", e); status = false; } return status; }
/** * See Stoppable.stop(). */ @Override public boolean stop() { // Stop new retry threads from starting stopped = true; // Stop any existing retry threads and then close the current socket, if any for (Thread t : threads) { ((SocketCreator) t).close(); } boolean status = Utils.stopThreads(threads); close(socket, in, out); ((SocketNetwork) gondola.getNetwork()).removeChannel(this); return status; }