Clears all the messages in the message queue, clears the peer in transport
if it's the DISCONNECTED message. This function should be called only
right before going back to recovery.
322390
protected void clearMessageQueue() {
    MessageTuple tuple = null;
    while ((tuple = messageQueue.poll()) != null) {
      Message msg = tuple.getMessage();
      if (msg.getType() == MessageType.DISCONNECTED) {
        this.transport.clear(msg.getDisconnected().getServerId());
      } else if (msg.getType() == MessageType.SHUT_DOWN) {
        throw new LeftCluster("Shutdown Zab.");
      }
    }
  }
472628
public synchronized void clear() {
		for (int i = 0; i < planes; i++) {
			readPointer[i] = writePointer[i] = 0;
			bytesToRead[i] = 0;
			bytesToWrite[i] = buffer[i].capacity();
		}
	}
816758
def clear_messages(self, queue_name, timeout=None):
        '''
        
        '''
        _validate_not_none('queue_name', queue_name)
        request = HTTPRequest()
        request.method = 'DELETE'
        request.host = self._get_host()
        request.path = _get_path(queue_name, True)
        request.query = [('timeout', _int_to_str(timeout))]
        self._perform_request(request)
908985
def disconnect(self, message=""):
        
        try:
            del self.connected
        except AttributeError:
            return

        self.quit(message)

        self.transport.close()

        self._handle_event(Event("disconnect", self.server, "", [message]))
764285
public void flushMessageCache() {

        // clear the cached message objects
        m_messages = new HashMap<Locale, CmsWorkplaceMessages>();
        if (LOG.isDebugEnabled()) {
            try {
                throw new RuntimeException("Tracing exception");
            } catch (Exception e) {
                LOG.info("Tracing call to CmsWorkplaceManager.flushMessageCache method.", e);
            }
        }
    }
185702
public void clear() {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isEntryEnabled()) {
            Tr.entry(tc, "clear");
        }

        clearAllHeaders();
        this.eohPosition = HeaderStorage.NOTSET;
        this.currentElem = null;
        this.stateOfParsing = PARSING_CRLF;
        this.binaryParsingState = GenericConstants.PARSING_HDR_FLAG;
        this.parsedToken = null;
        this.parsedTokenLength = 0;
        this.bytePosition = 0;
        this.byteLimit = 0;
        this.currentReadBB = null;
        clearBuffers();
        this.debugContext = this;
        this.numCRLFs = 0;
        this.bIsMultiLine = false;
        this.lastCRLFBufferIndex = HeaderStorage.NOTSET;
        this.lastCRLFPosition = HeaderStorage.NOTSET;
        this.lastCRLFisCR = false;
        this.headerChangeCount = 0;
        this.headerAddCount = 0;
        this.bOverChangeLimit = false;
        this.compactHeaderFlag = false;
        this.table = null;
        this.isPushPromise = false;
        this.processedXForwardedHeader = false;
        this.processedForwardedHeader = false;
        this.forwardHeaderErrorState = false;
        this.forwardedByList = null;
        this.forwardedForList = null;
        this.forwardedHost = null;
        this.forwardedPort = null;
        this.forwardedProto = null;

        if (bTrace && tc.isEntryEnabled()) {
            Tr.exit(tc, "clear");
        }
    }
495183
def onClose(self, was_clean, code, reason):
        
        logger.debug("Connection closed ({peer})".format(peer=self.peer))

        # Publish ON_CLOSE message
        self.factory.mease.publisher.publish(
            message_type=ON_CLOSE, client_id=self._client_id, client_storage=self.storage)

        self.factory.remove_client(self)
1050272
private void cleanPipes()
    {
        assert (pipe != null);

        //  Get rid of half-processed messages in the out pipe. Flush any
        //  unflushed messages upstream.
        pipe.rollback();
        pipe.flush();
        //  Remove any half-read message from the in pipe.
        while (incompleteIn) {
            Msg msg = pullMsg();
            if (msg == null) {
                assert (!incompleteIn);
                break;
            }
            // msg.close ();
        }
    }
1358725
function clear_messages()
    {
        $this->last_error = null;
        $this->last_error_id = null;
        $this->last_query = null;
    }
714253
void clearMsg(AppMsg appMsg) {
        if(msgQueue.contains(appMsg) || stickyQueue.contains(appMsg)){
            // Avoid the message from being removed twice.
            removeMessages(MESSAGE_DISPLAY, appMsg);
            removeMessages(MESSAGE_ADD_VIEW, appMsg);
            removeMessages(MESSAGE_REMOVE, appMsg);
            msgQueue.remove(appMsg);
            stickyQueue.remove(appMsg);
            removeMsg(appMsg);
        }
    }
614758
final void clear() {
        reset();
        
        _freeQueue.clear();
        _targetQueue.clear();
        _compactedQueue.clear();
        while(!_updateManager.isServiceQueueEmpty()) {
            CompactionUpdateBatch batch = _updateManager.pollBatch();
            _updateManager.recycleBatch(batch);
        }
    }
619123
protected void removeCleanupAndDestroyAllFreeConnections() { // removed iterator code
        // This method is called within a synchronize block
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "removeCleanupAndDestroyAllFreeConnections");
        }
        int mcWrapperListIndex = mcWrapperList.size() - 1;
        for (int i = mcWrapperListIndex; i >= 0; --i) {
            MCWrapper mcw = (MCWrapper) mcWrapperList.remove(i);
            mcw.setPoolState(0);
            --numberOfConnectionsAssignedToThisFreePool;
            cleanupAndDestroyMCWrapper(mcw);
            pm.totalConnectionCount.decrementAndGet();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "removeCleanupAndDestroyAllFreeConnections");
        }
    }
348418
public void clean() {
        Instant minAge = Instant.now().minus(storageTimeInSeconds, ChronoUnit.SECONDS);
        synchronized (messages) {
            messages.removeIf(messageRef -> Optional.ofNullable(messageRef.get())
                    .map(message -> !message.isCachedForever() && message.getCreationTimestamp().isBefore(minAge))
                    .orElse(true));
            long foreverCachedAmount = messages.stream()
                    .map(Reference::get)
                    .filter(Objects::nonNull)
                    .filter(Message::isCachedForever)
                    .count();
            messages.removeAll(messages.stream()
                                       .filter(messageRef -> Optional.ofNullable(messageRef.get())
                                               .map(message -> !message.isCachedForever())
                                               .orElse(true))
                                       .limit(Math.max(0, messages.size() - capacity - foreverCachedAmount))
                                       .collect(Collectors.toList()));
        }
    }
1104142
void clear() {
    for(int i=0; i<LEVEL; i++) {
      priorityQueues.get(i).clear();
    }
    raidQueue.clear();
  }
1205707
public MessageMgr clear() {
		for(MessageTypeHandler handler : this.messageHandlers.values()){
			handler.clear();
		}
		this.messages.clear();
		return this;
	}
279177
public void clear() {
        while (tail != head) {
            hpackHeaderFields[tail++] = null;
            if (tail == hpackHeaderFields.length) {
                tail = 0;
            }
        }
        head = 0;
        tail = 0;
        size = 0;
    }
896798
private void clearOnline() {

        if (!isEnabled()) {
            return;
        }
        if (LOG.isInfoEnabled()) {
            LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_ONLINE_KEYS_AND_ENTRIES_0));
        }
        clearAccordingToSuffix(CACHE_ONLINESUFFIX, false);
    }