for (;;) { try { // be somewhat tolerant of failures if (checkCancelled()) { break; if (checkCancelled()) { break; Set<InternalDistributedMember> recipients = getAllRecipients(cache, temp); cache.getDistributionManager().removeMembersWithSameOrNewerVersion( recipients = getAllRecipients(cache, temp); cache.getDistributionManager().retainMembersWithSameOrNewerVersion( recipients, Version.GFE_80); if (checkCancelled()) { break;
/** * shutdown this thread and the caller thread will join this thread */ public void shutdown() { this.shutdown = true; this.interrupt(); boolean interrupted = Thread.interrupted(); try { this.join(15 * 1000); } catch (InterruptedException e) { interrupted = true; } finally { if (interrupted) { Thread.currentThread().interrupt(); } } if (this.isAlive()) { logger .warning(LocalizedStrings.HARegionQueue_QUEUEREMOVALTHREAD_IGNORED_CANCELLATION); } } }
/** * @param sender * can be null. */ public static void cleanUpStatics(AbstractGatewaySender sender) { buckToDispatchLock = null; regionToDispatchedKeysMapEmpty = null; regionToDispatchedKeysMap.clear(); synchronized (ParallelGatewaySenderQueue.class) { if (removalThread != null) { removalThread.shutdown(); removalThread = null; } } if (conflationExecutor != null) { cleanupConflationThreadPool(sender); conflationExecutor = null; } }
for (;;) { try { // be somewhat tolerant of failures if (checkCancelled()) { break; if (checkCancelled()) { break; Set recipients = getAllRecipients(cache, temp); ParallelQueueRemovalMessage pqrm = new ParallelQueueRemovalMessage(temp); pqrm.setRecipients(recipients); if (checkCancelled()) { break;
removalThread = new BatchRemovalThread( (GemFireCacheImpl)sender.getCache(), this); removalThread.start();
queueEmptyLock = new StoppableReentrantLock(sender.getCancelCriterion()); queueEmptyCondition = queueEmptyLock.newCondition(); this.removalThread = new BatchRemovalThread((GemFireCacheImpl)sender.getCache()); this.removalThread.start();
/** * shutdown this thread and the caller thread will join this thread */ public void shutdown() { this.shutdown = true; this.interrupt(); boolean interrupted = Thread.interrupted(); try { this.join(15 * 1000); } catch (InterruptedException e) { interrupted = true; } finally { if (interrupted) { Thread.currentThread().interrupt(); } } if (this.isAlive()) { logger.warn(LocalizedMessage.create(LocalizedStrings.HARegionQueue_QUEUEREMOVALTHREAD_IGNORED_CANCELLATION)); } } }
/** * Constructor : Creates and initializes the thread */ public BatchRemovalThread(GemFireCacheImpl c, ParallelGatewaySenderQueue queue) { super("BatchRemovalThread"); //TODO:REF: Name for this thread ? this.setDaemon(true); this.cache = c; this.parallelQueue = queue; }
/** * Constructor : Creates and initializes the thread */ public BatchRemovalThread(GemFireCacheImpl c) { super("BatchRemovalThread"); //TODO:REF: Name for this thread ? this.setDaemon(true); this.cache = c; }
/** * This method does the cleanup of any threads, sockets, connection that are held up * by the queue. Note that this cleanup doesn't clean the data held by the queue. */ public void cleanUp() { if (this.removalThread != null) { this.removalThread.shutdown(); } if (conflationExecutor != null) { cleanupConflationThreadPool(); } }