public class CompressPacketOutputStream extends AbstractPacketOutputStream
buf, cmdLength, logger, maxAllowedPacket, maxQuerySizeToLog, permitTrace, pos, seqNo, serverThreadLog, traceCache
out
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() |
void |
setMaxAllowedPacket(int maxAllowedPacket) |
void |
startPacket(int compressSeqNo) |
void |
writeEmptyPacket()
Write an empty packet.
|
checkMaxAllowedLength, checkRemainingSize, flush, getMaxAllowedPacket, getOutputStream, isAllowedCmdLength, permitTrace, setServerThreadId, setTraceCache, write, write, write, write, write, write, write, write, write, writeBytes, writeBytesEscaped, writeEmptyPacket, writeFieldLength, writeInt, writeLong, writeShort
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public CompressPacketOutputStream(OutputStream out, int maxQuerySizeToLog)
public int getMaxPacketLength()
getMaxPacketLength
in class AbstractPacketOutputStream
public void setMaxAllowedPacket(int maxAllowedPacket)
setMaxAllowedPacket
in interface PacketOutputStream
setMaxAllowedPacket
in class AbstractPacketOutputStream
public void startPacket(int compressSeqNo)
startPacket
in interface PacketOutputStream
startPacket
in class AbstractPacketOutputStream
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 AbstractPacketOutputStream
commandEnd
- command endIOException
- id connection error occur.public void writeEmptyPacket() throws IOException
writeEmptyPacket
in interface PacketOutputStream
writeEmptyPacket
in class AbstractPacketOutputStream
IOException
- if socket error occur.Copyright © 2017. All rights reserved.