/* (non-Javadoc)
@see org.zoodb.internal.model1p.DataSink#flush()
184594
@Override
    public void flush() {
        if (isStarted) {
            flushBuffer();
            //To avoid memory leaks...
            Arrays.fill(buffer, null);
            isStarted = false;
        }
    }
500473
@Override
    public void flush() throws IOException {
        checkWriter();
        writer.flush();
        try {
            contentStoreUtil.storeContentStream(tempFile,
                                                spaceId,
                                                contentId,
                                                mimetype);
        } catch (DuraCloudRuntimeException ex) {
            throw new IOException("flush failed: " + ex.getMessage(), ex);
        }
    }
1327957
@Override
    public final void flush()
        throws IOException
    {
        _flushBuffer();
        if (_writer != null) {
            if (isEnabled(Feature.FLUSH_PASSED_TO_STREAM)) {
                _writer.flush();
            }
        }
    }
1030575
private void flush() {
    	switch(state){
    	case TEXT:
    	case CDATA:
            if(text.length() > 0) {
                doc.text(text.toString());
            }
            break;
    	case COMMENT:
        	if (comment != null) {
                comment.comment(text.toString());
            }
        	break;
    	case ATTRIBUTE_KEY:
            attributekey = text.toString();
            if (html)
                attributekey = attributekey.toLowerCase();
    		break;
    	case QUOTE:
    	case ATTRIBUTE_VALUE:
        	attributevalue = text.toString();
            attributes.put(attributekey,attributevalue);
            break;
    	default:
    		// do nothing
    	}
        text.setLength(0);
    }
1196434
private void flushJoinTableData()
    {
        if (applyFlush())
        {
            for (JoinTableData jtData : flushManager.getJoinTableData())
            {
                if (!jtData.isProcessed())
                {
                    EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                            jtData.getEntityClass());
                    Client client = getClient(m);
                    if (OPERATION.INSERT.equals(jtData.getOperation()))
                    {
                        client.persistJoinTable(jtData);
                        jtData.setProcessed(true);
                    }
                    else if (OPERATION.DELETE.equals(jtData.getOperation()))
                    {
                        for (Object pk : jtData.getJoinTableRecords().keySet())
                        {
                            client.deleteByColumn(m.getSchema(), jtData.getJoinTableName(),
                                    jtData.getJoinColumnName(), pk);
                        }
                        jtData.setProcessed(true);
                    }
                }

            }
        }
    }
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);
        }
    }
752433
@Override
    public void flush()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "flush");
        // Cleanup any pending NACK alarms.  Since we're flushing we don't
        // care about these anymore.
        synchronized (pendingAlarms)
        {
            for (Iterator i = getAlarms(this); i.hasNext();)
            {
                NRTExpiryHandle next = (NRTExpiryHandle) i.next();
                next.timer.cancel();
                i.remove();
            }
        }

        // SIB0115
        // If nack alarms are cancelled then deregister the health state for detected gaps
        getControlAdapter().getHealthState().deregister(HealthStateListener.GAP_DETECTED_STATE);

        // We shouldn't be flushed if we have pending unacked data.  But
        // just as a sanity check, throw an exception here if we have
        // something undelivered.
        if (oststream
                        .containsState(
                                       new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
                                       TickRange.Value)
            || oststream.containsState(
                                       new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
                                       TickRange.Uncommitted))
        {
            //TODO: throw some interesting exception
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "flush");
    }
357829
@SuppressWarnings("deprecation")
    public void flush() throws SAXException {
        if (!alreadyComplainedAboutThisRun
                && !Normalizer.isNormalized(buf, 0, pos, Normalizer.NFC, 0)) {
            errAboutTextRun();
        }
        reset();
    }
447917
@Override
  protected void flush(Buffer data, boolean isEnd)
  {
    if (isClosed()) {
      throw new IllegalStateException();
    }

    _request.outProxy().write(_request, data, isEnd);
    
    /*
    boolean isHeader = ! isCommitted();
    toCommitted();
    
    MessageResponseHttp2 message;
    
    TempBuffer next = head;
    TempBuffer tBuf = null;
    
    if (head != null) {
      int headLength = head.length();
    
      if (headLength > 0) {
        tBuf = head;
      
        next = TempBuffer.allocate();
      }
    }
    
    message = new MessageResponseHttp2(_request, tBuf, isHeader, isEnd);
    _request.getOutHttp().offer(message);
    
    return next;
    */
  }
1071249
@Override
    public synchronized void flush() {
        if (trouble) {
            return;
        }

        if (isDestinationActivated()) {
            try {
                getOut().flush();
            }
            catch (IOException e) {
                handleIOException(e);
            }
        }
    }
62415
protected void flushObjects ()
    {
        long now = System.currentTimeMillis();
        for (Iterator<IntMap.IntEntry<FlushRecord>> iter = _flushes.intEntrySet().iterator();
             iter.hasNext(); ) {
            IntMap.IntEntry<FlushRecord> entry = iter.next();
//             int oid = entry.getIntKey();
            FlushRecord rec = entry.getValue();
            if (rec.expire <= now) {
                iter.remove();
                flushObject(rec.object);
//                 Log.info("Flushed object " + oid + ".");
            }
        }
    }
393227
private void flushBuffer(final ByteBuffer buffer, final DataOutput stream) throws IOException {
        buffer.flip();
        stream.write(buffer.array(), buffer.arrayOffset(), buffer.remaining());

        buffer.clear();
    }
411846
void doFlush()
    {
        enableFlush = true;
        flush();
        execute();
        enableFlush = false;
        flushManager.commit();
        flushManager.clearFlushStack();
    }
201193
public void flush() throws IOException
    {
        super.flush();
        if (_complete&&!_completed)
        {
            _completed=true;

            _packet.resetData();
            _packet.addByte(AJP13ResponsePacket.__END_RESPONSE);
            _packet.addBoolean(_persistent);
            _packet.setDataSize();
            write(_packet);
            _packet.resetData();
        }
    }
605797
public synchronized void flush()
	{
		if (out != null)
			try {
				out.flush();
			}
			catch (final IOException e) {
				getErrorHandler().error(this, "on flush", e);
			}
	}
1059051
public void flush()
  {
    int level = getLevel().intValue();
    
    for (int i = 0; i < _handlers.length; i++) {
      Handler handler = _handlers[i];

      if (level <= handler.getLevel().intValue())
        handler.flush();
    }
  }
503502
public function flush()
    {
        $keys = $this->redis->keys($this->redis->prefix('*'));

        foreach ($keys as $key) {
            $this->redis->del($key);
        }
    }