Flushes all available flushers to the adaptee writer.
The thread falls asleep if we reach the end of the queue without a FinalizeFlusher.

@throws IOException if the adaptee throws an IOException
513177
public synchronized void flushAdaptee() throws IOException {
        OdsFlusher flusher = this.flushers.poll();
        if (flusher == null) return;

        while (flusher != null) {
            this.adaptee.update(flusher);
            if (flusher.isEnd()) {
                this.stopped = true;
                this.notifyAll(); // wakes up other threads: end of game
                return;
            }
            flusher = this.flushers.poll();
        }
        try {
            this.wait();
        } catch (final InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
        this.notifyAll(); // wakes up other threads: no flusher left
    }
944696
public synchronized void flush() throws IOException {
        if (sink != null) {
            if (sink.closedByReader || closed) {
                throw new IOException("Pipe closed");
            }
            synchronized (sink) {
                sink.notifyAll();
            }
        }
    }
699411
@Override
    public void close()
            throws IOException
    {
        if (closed) {
            return;
        }
        try {
            flush();
            out.close();
        }
        finally {
            closed = true;
            inputBufferAllocator.release(inputBuffer);
            outputBufferAllocator.release(outputBuffer);
            inputBuffer = null;
            outputBuffer = null;
        }
    }
411846
void doFlush()
    {
        enableFlush = true;
        flush();
        execute();
        enableFlush = false;
        flushManager.commit();
        flushManager.clearFlushStack();
    }
723735
@Override
  public void flush()
    throws IOException
  {
    OutputStream stream = getStream();

    if (stream == null) {
      return;
    }

    synchronized (stream) {
      stream.flush();
    }
  }
383622
public synchronized void flush() throws IOException {

        Enumeration keys = allSockets.keys();
        // close all sockets before removing them
        while (keys.hasMoreElements()) {
            SocketBox myBox = (SocketBox) keys.nextElement();
            if (myBox != null) {
                myBox.setSocket(null);
            }
        }

        allSockets.clear();
        freeSockets.clear();
        busySockets.clear();
    }
63319
@Override
    public void flush() {

        PrintWriter out = null;
        try {
            try {
                out = new PrintWriter(Utils.createFile(dir, file), "UTF-8");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            String contents = getBuffer().toString();
            out.write(processor.apply(contents));
        } finally {
            closeQuietly(out);
        }
    }
232970
protected void flushBuffer() throws IOException {
		if (capacity == 0) {
			ostream.write(buffer);
			capacity = BITS_IN_BYTE;
			buffer = 0;
			len++;
		}
	}
544627
public void flushTermination()
    {
        for (int i = 0; i < numberOfQueues; i++)
        {
            if (!terminateLists[i].isEmpty())
            {
                this.submitTaskToQueue(this.createTerminateTask(terminateLists[i]), i, processedTerminates);
                this.terminateLists[i] = new ArrayList(batchSize);
                this.terminatesQueued++;
            }
        }
    }
432866
void flushAll() {
		for (Buffer buff : bufferPool) {
			try {
				buff.getExternalLock().lock();
				buff.flush();
			} finally {
				buff.getExternalLock().unlock();
			}
		}
	}
1053685
protected void flush() throws IOException {
		if (this.tempStream != null && this.buffer.position() > 0) {
			final int pos = this.buffer.position();
			this.buffer.rewind();
			this.buffer.limit(pos);

			this.tempStream.write(this.buffer);

			this.buffer.rewind();
			this.buffer.limit(this.buffer.capacity());

			this.bufferPosition += pos;
		}
	}
1250007
public void flushResponse() throws IOException {
        try {
            // Finish GZIP encodig
            if (gzipOut != null) {
                gzipOut.finish();
            }

            flushBuffer();
        }
        finally {
            // Close stream
            if (writer != null) {
                writer.close();
            }
            else {
                if (out != null) {
                    out.close();
                }
            }
        }
    }
941159
@Override
  public void flush() throws IOException
  {
    if (_os == null || ! _needsFlush)
      return;

    _needsFlush = false;
    try {
      _os.flush();
    } catch (IOException e) {
      try {
        close();
      } catch (IOException e1) {
      }
      
      throw ClientDisconnectException.create(e);
    }
  }
194864
protected void flushIfPossible() throws IOException {

        // TODO: do not flush if wasn't requested by underlying application
        if (null != bufferedServletOutputStream) bufferedServletOutputStream.setLastChunk();

        if (null != writer) writer.flushIfOpen();
        else if (null != outputStream) outputStream.flushIfOpen();
        else {
            if (!isCommitted()) {
                notifyBeforeCommit();
            }
            notifyBeforeClose();
        }
    }
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);
        }
    }
1024798
public void flush() throws IOException {
        if (this.out != null) {
            this.out.flush();
        }
        if (this.diskStream != null) {
            this.diskStream.flush();
        }
    }
1285914
public void flush() throws IOException {
        ensureOpen();

        // Finish decompressing and writing pending output data
        if (!inf.finished()) {
            try {
                while (!inf.finished()  &&  !inf.needsInput()) {
                    int n;

                    // Decompress pending output data
                    n = inf.inflate(buf, 0, buf.length);
                    if (n < 1) {
                        break;
                    }

                    // Write the uncompressed output data block
                    out.write(buf, 0, n);
                }
                super.flush();
            } catch (DataFormatException ex) {
                // Improperly formatted compressed (ZIP) data
                String msg = ex.getMessage();
                if (msg == null) {
                    msg = "Invalid ZLIB data format";
                }
                throw new ZipException(msg);
            }
        }
    }