De-queues the highest priority entry from the table
@throws SIConnectionDroppedException if the priorty queue has been
closed or purged.
@return RequestData Returns the highest priority request data
object or null.
963643
public TransmissionData dequeue()
   throws SIConnectionDroppedException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dequeue");

      TransmissionData retValue = null;

      Queue queue = null;
      synchronized(queueMonitor)
      {
         if (state == CLOSED)
         {
            throw new SIConnectionDroppedException(TraceNLS.getFormattedMessage(JFapChannelConstants.MSG_BUNDLE, "PRIORITY_QUEUE_PURGED_SICJ0077", null, "PRIORITY_QUEUE_PURGED_SICJ0077"));
         }
         else
         {
            // Find the highest non-empty priority
            int priority = JFapChannelConstants.MAX_PRIORITY_LEVELS-1;
            while((priority >= 0) && (queueArray[priority].depth == 0)) --priority;

            if (priority >= 0)
            {
               queue = queueArray[priority];

               // Dequeue the data and update the queue appropriately.
               TransmissionDataIterator iterator = queue.head();               // D217401
               retValue = iterator.next();

               queue.bytes -= retValue.getSize();

               // If there is no more data left to iterate over then remove the
               // transmission data from the queue and update the depth counters.
               if (!iterator.hasNext())
               {
                  queue.dequeue();                                      // D217401
                  --queue.depth;
                  --totalQueueDepth;
               }

               // If the priority queue is in closing state and we have just emptied
               // the queue, mark the queue as closed and unblock anyone waiting for the
               // queue to close.
               if ((totalQueueDepth == 0) && (state == CLOSING))
               {
                  state = CLOSED;                           // Transition to the close state
                  closeWaitersMonitor.setActive(false);     // Unblock anyone waiting for the close

                  // Un-block any queue monitors, in case other threads are blocked waiting
                  // to try and queue data.
                  for (int i=0; i < JFapChannelConstants.MAX_PRIORITY_LEVELS; ++i)
                     queueArray[i].monitor.setActive(false);
               }

               // If dequeueing the data caused a change in capacity then
               // take the appropriate actions
               if (!queue.hasCapacity &&
                   (queue.bytes < maxQueueBytes) &&
                   queue.depth < maxQueueDepth)
               {
                  // Mark the queue as having capacity
                  queue.hasCapacity = true;

                  // If the change in capacity results in more priority levels having capacity then...
                  if (priority < lowestPriorityWithCapacity)
                  {
                     // Unblock any threads waiting on the lower capacity levels
                     int newLowestPriorityWithCapacity = priority;
                     while((newLowestPriorityWithCapacity > 0) &&
                           queueArray[newLowestPriorityWithCapacity-1].hasCapacity)
                     {
                        queueArray[newLowestPriorityWithCapacity].monitor.setActive(false);
                        --newLowestPriorityWithCapacity;
                     }
                     lowestPriorityWithCapacity = newLowestPriorityWithCapacity;
                     queueArray[lowestPriorityWithCapacity].monitor.setActive(false);
                  }
               }
            }
         }
      }

      if (retValue != null)
      {
         if (type == Conversation.CLIENT)
            clientQueuedBytes -= retValue.getSize();
         else
            meQueuedBytes -= retValue.getSize();
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dequeue", retValue);
      return retValue;
   }
1119372
@Override
    public Future<M> requestData() {
        logger.debug(this + " requestData...");
        try {
            validateInitialization();
            synchronized (syncMonitor) {

                // Check if sync is in process.
                if (syncFuture != null && !syncFuture.isDone()) {

                    // Recover sync task if it was canceled for instance during remote reinitialization.
                    if (syncTask == null || syncTask.isDone()) {
                        syncTask = sync();
                    }
                    return syncFuture;
                } else {
                    // cleanup old sync task
                    if (syncTask != null && !syncTask.isDone()) {
                        syncTask.cancel(true);
                    }
                }

                // Create new sync process
                syncFuture = new CompletableFutureLite();
                syncTask = sync();
                return syncFuture;
            }
        } catch (CouldNotPerformException ex) {
            return FutureProcessor.canceledFuture(new CouldNotPerformException("Could not request data!", ex));
        }
    }
168179
public function drop()
    {

        $params = [
            'index' => $this->name,
            'client' => ['ignore' => $this->ignores]
        ];

        return $this->connection->indices()->delete($params);
    }
528942
public TestResult getFirstNonSuccessfulResult() {
        for (ResponsePayload payload : payloads.values()) {

            if (payload != null) {

                TestResult testResult = payload.getTestResult();

                if (testResult != null) {
                    switch (testResult.getStatus()) {
                        case FAILED:
                            return testResult;
                        case SKIPPED:
                            return testResult;
                        case PASSED:
                    }
                }
            }
        }

        return null;
    }
510565
public final Object dequeue()
    throws NoSuchElementException
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "dequeue");

    if (m_head == m_tail)
      throw new NoSuchElementException();
    Object obj = m_array[m_head];
    m_array[m_head++] = null;
    if (m_head == m_array.length)
      m_head = 0;

//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "dequeue", obj);
    return obj;
  }
340253
public function dequeue()
    {
        $message = $this->client->receiveMessage([
            'AttributeNames' => ['ApproximateReceiveCount'],
            'QueueUrl' => $this->url,
            'WaitTimeSeconds' => $this->pollingTimeout,
            'VisibilityTimeout' => $this->visibilityTimeout,
        ])->toArray();

        if (!SqsMessageTransformer::hasItems($message)) {
            return false;
        }

        return SqsMessageTransformer::fromMessage($message);
    }
181648
protected int getPriority()
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "getPriority");
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "getPriority", ""+priority);
      return priority;
   }
1158546
public int completed(InetAddress request)
    {
        String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(request);
        Queue<InetAddress> requests = requestsByDatacenter.get(dc);
        assert requests != null;
        assert request.equals(requests.peek());
        requests.poll();
        if (!requests.isEmpty())
            processor.process(requests.peek());
        return --remaining;
    }
255616
public function getLastAuditUser(){
        if($this->status !== 'completed') return null;
        $node = $this->resourcenodes()->where('result','agreed')->orderby('orders', 'desc')->first();
        return (!$node) ? null : $node->user;
    }
335441
public function dequeuePlain()
    {
        $document = $this->collection
            ->find()
            ->sort(array(
                'priority' => -1,
                'datetime' => 1,
            ))
            ->findAndRemove();
        
        if (!$document) {
            return null;
        }
        
        return $document->get('payload');
    }
947120
private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) {
        AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
        while(resourceRequest != null) {
            if(resourceRequest.getDeadlineNs() < System.nanoTime()) {
                resourceRequest.handleTimeout();
                resourceRequest = requestQueue.poll();
            } else {
                break;
            }
        }
        return resourceRequest;
    }
1087402
public int getMaxQueuedConnections() {
	return getThreadPool() == null ? -1 :
	    ((getThreadPool().getQueue() instanceof ArrayBlockingQueue) ?
	     ((ArrayBlockingQueue)getThreadPool().getQueue()).size() +
	     ((ArrayBlockingQueue)getThreadPool().getQueue()).remainingCapacity() : -1);	     
    }
1097366
public function dequeue() {
        if ($this->isEmpty()) {
            return false;
        }
        $this->tail = $this->tail % $this->size;
        $data = $this->elements[$this->tail];
        $this->tail++;
        return $data;
    }
837925
public static Buffer getQueue() {

        return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new UnboundedFifoBuffer() {

            /** The serialization version id constant. */
            private static final long serialVersionUID = 606444342980861724L;

            /**
             * Called when the queue is full to remove the oldest element.<p>
             *
             * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove()
             */
            @Override
            public Object remove() {

                CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove();
                return publishJob;
            }
        }, CmsPublishJobInfoBean.class));
    }
773638
public function getRequestData()
    {
        parent::getRequestData();

        if ($this->getRequest() instanceof Request) {
            if (in_array($this->getRequest()->getMethod(), array('PUT', 'DELETE'))) {
                $this->requestData[$this->getRequest()->getMethod()] = $this->getRequest()->request->all();
            }
        }

        return $this->requestData;
    }
463266
@Override
    public M requestStatus() throws CouldNotPerformException {
        logger.debug("requestStatus of " + this);
        try {
            return getData();
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw ExceptionPrinter.printHistoryAndReturnThrowable(new CouldNotPerformException("Could not request status update.", ex), logger, LogLevel.ERROR);
        }
    }
540062
ServerRequest dequeue() {
        ServerRequest req = null;
        synchronized (reqQueueLockObject) {
            try {
                req = queue.remove(0);
                persist();
            } catch (IndexOutOfBoundsException | NoSuchElementException ignored) {
            }
        }
        return req;
    }