public class CompressPacketOutputStream extends AbstractPacketOutputStream
buf, charset, cmdLength, enableNetworkStatistics, maxAllowedPacket, maxPacketLength, maxQuerySizeToLog, mysqlSeqNo, permitTrace, pos, serverThreadLog, threadId, timestampBeforeFlush, traceCacheout| 构造器和说明 |
|---|
CompressPacketOutputStream(OutputStream out,
long threadId,
Options options,
TimeTrace timeTrace) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
flushBuffer(boolean commandEnd)
Flush the internal buffer.
|
int |
initialPacketPos() |
void |
setMaxAllowedPacket(int maxAllowedPacket) |
void |
startPacket(int compressSeqNo) |
void |
writeEmptyPacket()
Write an empty packet.
|
bufferIsDataAfterMark, checkMaxAllowedLength, checkRemainingSize, clearNetworkStatistics, doFlush, enableNetworkStatistics, endSendRequest, exceedMaxLength, flush, flushBufferStopAtMark, flushLoadDataLocalFile, getCharset, getMaxAllowedPacket, getMaxPacketLength, getOutputStream, getPosition, getTimestampBeforeFlush, getTimeZone, isEncloseParamInParentheses, isMarked, isOracleMode, mark, permitTrace, resetMark, setOracleMode, setPosition, setServerThreadId, setTimeZone, setTraceCache, startSendRequest, write, write, write, write, write, write, write, write, write, writeBytes, writeBytesEscaped, writeBytesEscapedQuote, writeEmptyPacket, writeEscapeQuote, writeEscapeQuote, writeFieldLength, writeFloatV1, writeHex, writeHex, writeInt, writeIntV1, writeLong, writeLongV1, writeShortcloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic CompressPacketOutputStream(OutputStream out, long threadId, Options options, TimeTrace timeTrace)
public void setMaxAllowedPacket(int maxAllowedPacket)
setMaxAllowedPacket 在接口中 PacketOutputStreamsetMaxAllowedPacket 在类中 AbstractPacketOutputStreampublic void startPacket(int compressSeqNo)
startPacket 在接口中 PacketOutputStreamstartPacket 在类中 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 在类中 AbstractPacketOutputStreamcommandEnd - command endIOException - id connection error occur.public void writeEmptyPacket()
throws IOException
writeEmptyPacket 在接口中 PacketOutputStreamwriteEmptyPacket 在类中 AbstractPacketOutputStreamIOException - if socket error occur.Copyright © 2024 oceanbase.com. All rights reserved.