Flush the journal write queue (asynchronous)
487264
public void flush() throws JournalException
    {
    	if (failing)
    		throw new JournalException("Store journal is failing");
    	
    	boolean newFlushRequired = false;
    	synchronized (journalWriteQueue)
        {
    		if (unflushedJournalSize > maxUnflushedJournalSize)
    		{
    			newFlushRequired = !flushingJournal;
    			if (newFlushRequired)
    				flushingJournal = true;
    			unflushedJournalSize = 0;
    		}
        }
    	
    	// Flush journal to store (asynchronous)
    	if (newFlushRequired)
        {
        	try
        	{
        		asyncTaskManager.execute(flushJournalAsyncTask);
        	}
        	catch (JMSException e)
        	{
        		throw new JournalException("Cannot flush journal asynchronously : "+e);
        	}
        }
    }
351650
protected function flushWrites()
	{
		foreach ($this->queuedForWrite as $style)
		{
      		if ($style->value && $this->uploadedFile->isImage()) {
				$file = $this->resizer->resize($this->uploadedFile, $style);
			}
			else {
				$file = $this->uploadedFile->getRealPath();
			}

			$filePath = $this->path($style->name);
			$this->move($file, $filePath);
		}

		$this->queuedForWrite = array();
	}
770897
@GuardedBy("evictionLock")
    void drainWriteBuffer() {
        for (int i = 0; i < WRITE_BUFFER_DRAIN_THRESHOLD; i++) {
            final Runnable task = writeBuffer.poll();
            if (task == null) {
                break;
            }
            task.run();
        }
    }
1240199
public void flush()
    {
        try {
            // Flush index writer
            indexWriter.flush();

            // Write out metrics mutations
            BatchWriter metricsWriter = connector.createBatchWriter(table.getMetricsTableName(), writerConfig);
            metricsWriter.addMutations(getMetricsMutations());
            metricsWriter.close();

            // Re-initialize the metrics
            metrics.clear();
            metrics.put(METRICS_TABLE_ROW_COUNT, new AtomicLong(0));
        }
        catch (MutationsRejectedException e) {
            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Index mutation was rejected by server on flush", e);
        }
        catch (TableNotFoundException e) {
            throw new PrestoException(ACCUMULO_TABLE_DNE, "Accumulo table does not exist", e);
        }
    }
846954
def flush(self):
        """"""
        writer = self.writer
        if writer is None:
            raise GaugedUseAfterFreeError
        self.flush_writer_position()
        keys = self.translate_keys()
        blocks = []
        current_block = self.current_block
        statistics = self.statistics
        driver = self.driver
        flags = 0  # for future extensions, e.g. block compression
        for namespace, key, block in self.pending_blocks():
            length = block.byte_length()
            if not length:
                continue
            key_id = keys[(namespace, key)]
            statistics[namespace].byte_count += length
            blocks.append((namespace, current_block, key_id, block.buffer(),
                           flags))
        if self.config.overwrite_blocks:
            driver.replace_blocks(blocks)
        else:
            driver.insert_or_append_blocks(blocks)
            if not Gauged.writer_flush_maps(writer, True):
                raise MemoryError
        update_namespace = driver.add_namespace_statistics
        for namespace, stats in statistics.iteritems():
            update_namespace(namespace, self.current_block,
                             stats.data_points, stats.byte_count)
        statistics.clear()
        driver.commit()
        self.flush_now = False
62505
void flush() {
		internalLock.writeLock().lock();
		flushLock.lock();
		try {
			if (isNew || modifiedBy.size() > 0) {
				VanillaDb.logMgr().flush(lastLsn);
				contents.write(blk);
				modifiedBy.clear();
				isNew = false;
			}
		} finally {
			flushLock.unlock();
			internalLock.writeLock().unlock();
		}
	}
541087
protected synchronized void flushPendingWriteRequests() throws Exception {
        LOGGER.debug(" flushPendingWriteRequests()");

        if (writeRequestQueue == null) {
            return;
        }

        Event scheduledWrite;
        while ((scheduledWrite = writeRequestQueue.poll()) != null) {
            LOGGER.debug(" Flushing buffered write request: {}",
                    scheduledWrite.data);

            getProxyFilter().filterWrite(scheduledWrite.nextFilter,
                    getSession(), (WriteRequest) scheduledWrite.data);
        }

        // Free queue
        writeRequestQueue = null;
    }
1203632
private void flushBuffer() {
		// Do the actual logging:
		removes.ensureCapacity(buffer.size());
		for(Iterator<LoggingEvent> i = buffer.iterator(); i.hasNext();) {
			try {
				LoggingEvent event = (LoggingEvent)i.next();
				doLog(event);
				removes.add(event);
			} catch(Exception e) {
				errorHandler.error("Failed to flush log", e, ErrorCode.FLUSH_FAILURE);
			}
		}

		// Remove from the buffer any events that were reported:
		buffer.removeAll(removes);

		// Clear the buffer of reported events:
		removes.clear();
	}
1185854
protected void flushData()
    {
        try
        {
            out.write(buffer, 0, validBufferBytes);
            lastFlushOffset += validBufferBytes;
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }
        if (runPostFlush != null)
            runPostFlush.run();
    }
1327957
@Override
    public final void flush()
        throws IOException
    {
        _flushBuffer();
        if (_writer != null) {
            if (isEnabled(Feature.FLUSH_PASSED_TO_STREAM)) {
                _writer.flush();
            }
        }
    }
264432
def flush(self):
        """"""
        while not self._queue.empty():
            self._queue.get()
            self._queue.task_done()
        self.close()
843405
private void flushSync() throws Exception {
		while (producer.getOutstandingRecordsCount() > 0) {
			producer.flush();
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				LOG.warn("Flushing was interrupted.");
				break;
			}
		}
	}
1122327
function flush() {
    if (queue.length) {
      //
      // We might want to indicate that these are already queued, so we don't
      // fetch data again.
      //
      queue.splice(0).sort(function sort(a, b) {
        return a.id - b.id;
      }).forEach(onmessage);
    }
  }
345072
function flush(writeTo) {
    var outputTo = bufferLen + matchStart - chunkLength;

    while (outputTo > 0 && outputTo > bufferStart) {
      if (outputTo > buffer[0].length-1) {
        var part = buffer.shift();
        outputBuffer.push(part.slice(bufferStart));

        bufferStart = Math.max(0, bufferStart - part.length);
        bufferLen -= part.length;
        outputTo -= part.length;
      } else {
        outputBuffer.push(buffer[0].slice(bufferStart, outputTo));
        bufferStart = outputTo;
        break;
      }
    }
    if (writeTo) {
      // Output everything ready as one chunk
      writeTo.push(outputBuffer.join(''));
      outputBuffer.length = 0;
    }
  }
611901
void flush(Writer out)
         throws IOException
    {
        if (nest!=null)
            nest.flush(out);
        else
        {
            write(out);
            elements.clear();
        }
    }
1081989
def Flush(self):
    """"""
    if self.locked and self.CheckLease() == 0:
      self._RaiseLockError("Flush")

    self._WriteAttributes()
    self._SyncAttributes()

    if self.parent:
      self.parent.Flush()
440553
public void flush()
        throws IOException
    {
        try
        {
            if (!_commited)
            {
                _commited=true;
                if (_commitObserver!=null)
                    _commitObserver.outputNotify(this,OutputObserver.__COMMITING,null);
            }
            
            wrapBuffer();
            
            // Add headers
            if (_httpMessageWriter.size()>0)
            {
                prewrite(_httpMessageWriter.getBuf(),0,_httpMessageWriter.size());
                _httpMessageWriter.resetWriter();
            }
            
            if (size()>0)
                writeTo(_out);
        }
        catch (IOException e)
        {
            throw new EOFException(e);
        }
        finally
        {
            reset(_preReserve);
        }
    }