public class CompressPacketOutputStream extends AbstractPacketOutputStream
buf, cmdLength, maxAllowedPacket, maxQuerySizeToLog, permitTrace, pos, seqNo, serverThreadLog, traceCacheout| Constructor and Description |
|---|
CompressPacketOutputStream(OutputStream out,
int maxQuerySizeToLog) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
flushBuffer(boolean commandEnd)
Flush the internal buffer.
|
int |
getMaxPacketLength() |
int |
initialPacketPos() |
void |
setMaxAllowedPacket(int maxAllowedPacket) |
void |
startPacket(int compressSeqNo) |
void |
writeEmptyPacket()
Write an empty packet.
|
bufferIsDataAfterMark, checkMaxAllowedLength, checkRemainingSize, exceedMaxLength, flush, flushBufferStopAtMark, getMaxAllowedPacket, getOutputStream, isMarked, mark, permitTrace, resetMark, setServerThreadId, setTraceCache, write, write, write, write, write, write, write, write, write, writeBytes, writeBytesEscaped, writeEmptyPacket, writeFieldLength, writeInt, writeLong, writeShortcloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic CompressPacketOutputStream(OutputStream out, int maxQuerySizeToLog)
public int getMaxPacketLength()
getMaxPacketLength in class AbstractPacketOutputStreampublic void setMaxAllowedPacket(int maxAllowedPacket)
setMaxAllowedPacket in interface PacketOutputStreamsetMaxAllowedPacket in class AbstractPacketOutputStreampublic void startPacket(int compressSeqNo)
startPacket in interface PacketOutputStreamstartPacket in class AbstractPacketOutputStreampublic int initialPacketPos()
protected void flushBuffer(boolean commandEnd)
throws IOException
Compression add a 7 header :
in case packet isn't compressed (last 3 bytes == 0):
Content correspond to standard content.
Problem is when standard content is bigger than 16mb : content will not send 4byte standard header + 16mb content, since packet are limited to 16mb then 4 bytes standard header + 16mb - 4 bytes content. the ending 4 bytes are waiting to be send. next packet will then send the waiting data before next packet, putting more waiting data is needed. if ending data is exactly MAX_PACKET_LENGTH length, then an empty packet must be send.
flushBuffer in class AbstractPacketOutputStreamcommandEnd - command endIOException - id connection error occur.public void writeEmptyPacket()
throws IOException
writeEmptyPacket in interface PacketOutputStreamwriteEmptyPacket in class AbstractPacketOutputStreamIOException - if socket error occur.Copyright © 2019 mariadb.org. All rights reserved.