@Override public void quiesce() { if (!isTerminated) { isQuiesced = true; priorityQueue.clear(); } }
/** * Reset the internal state of the Scheduler. */ public synchronized void reset() { runnables.clear(); idleState = UNPAUSED; currentTime = START_TIME; isExecutingRunnable = false; }
@Override public void close() { ResourceUtils.closeAll( toClose ); sortedIterators.clear(); toClose.clear(); }
/** * Atomically removes all of the elements from this delay queue. * The queue will be empty after this call returns. * Elements with an unexpired delay are not waited for; they are * simply discarded from the queue. */ public void clear() { final ReentrantLock lock = this.lock; lock.lock(); try { q.clear(); } finally { lock.unlock(); } }
public boolean initNbest() { if (agenda_ == null) { agenda_ = new PriorityQueue<QueueElement>(10, new Comparator<QueueElement>() { public int compare(QueueElement o1, QueueElement o2) { return (int) (o1.fx - o2.fx); } }); } agenda_.clear(); int k = x_.size() - 1; for (int i = 0; i < ysize_; i++) { QueueElement eos = new QueueElement(); eos.node = node_.get(k).get(i); eos.fx = -node_.get(k).get(i).bestCost; eos.gx = -node_.get(k).get(i).cost; eos.next = null; agenda_.add(eos); } return true; }
@Override protected final void closeOp(boolean abort) throws HiveException { priorityQueue.clear(); super.closeOp(abort); }
@Override public void close() { IOUtils.closeQuietly(currentSubIterator); currentSubIterator = null; IOUtils.closeAllQuietly(heap); heap.clear(); } }
@Override public void afterHeuristicChange(boolean forward, boolean backward) { if (forward) { // update PQ due to heuristic change (i.e. weight changed) if (!pqOpenSetFrom.isEmpty()) { // copy into temporary array to avoid pointer change of PQ AStarEntry[] entries = pqOpenSetFrom.toArray(new AStarEntry[pqOpenSetFrom.size()]); pqOpenSetFrom.clear(); for (AStarEntry value : entries) { value.weight = value.weightOfVisitedPath + weightApprox.approximate(value.adjNode, false); // does not work for edge based // ignoreExplorationFrom.add(value.adjNode); pqOpenSetFrom.add(value); } } } if (backward) { if (!pqOpenSetTo.isEmpty()) { AStarEntry[] entries = pqOpenSetTo.toArray(new AStarEntry[pqOpenSetTo.size()]); pqOpenSetTo.clear(); for (AStarEntry value : entries) { value.weight = value.weightOfVisitedPath + weightApprox.approximate(value.adjNode, true); // ignoreExplorationTo.add(value.adjNode); pqOpenSetTo.add(value); } } } }
pq.clear(); round++; if (round >= MAX_ROUNDS) {
@Override public List<Runnable> shutdownNow() { if (shutdown.getAndSet(true)) { throw new IllegalStateException("This executor has been shutdown already"); } List<Runnable> pending = new ArrayList<>(); for (final PendingCallable<?> pendingCallable : pendingCallables) { pending.add( new Runnable() { @Override public void run() { pendingCallable.call(); } }); } synchronized (pendingCallables) { pendingCallables.notifyAll(); pendingCallables.clear(); } return pending; }
@Override public void rewind() { for (PinotSegmentRecordReader recordReader : _pinotSegmentRecordReaders) { recordReader.rewind(); } // If the segment is sorted, we need to re-initialize the priority queue if (isSortedSegment()) { _priorityQueue.clear(); for (PinotSegmentRecordReader recordReader : _pinotSegmentRecordReaders) { if (recordReader.hasNext()) { _priorityQueue.add(new GenericRowWithReader(recordReader.next(), recordReader, _sortOrder, _schema)); } } } else { _currentReaderId = 0; } }
this.activeQueue.clear();
superToastPriorityQueue.clear();
activeQueue.clear(); FlowFileRecord toRequeue; long activeQueueBytes = 0L;
bestmatches.clear();
data.queue.clear(); for ( int i = 0; i < streamSize; i++ ) { while ( data.rows[i] != null && !isStopped() ) {
bucketQueue.clear(); remainingBuckets = 3;
protected final void clear() { heap.clear(); topIdx = null; nextKey = null; }
activeQueue.clear(); incrementActiveQueueSize(-droppedSize.getObjectCount(), -droppedSize.getByteCount()); dropRequest.setCurrentSize(size());
@Override public void clear() { this.queue.clear(); } }