Class DecompressPacketInputStream
java.lang.Object
org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream
- All Implemented Interfaces:
PacketInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private intprivate intprivate intprivate final byte[]private final InputStreamprivate static final Loggerprivate static final intprivate final intprivate intprivate static final intprivate final byte[]private Stringprivate LruTraceCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcache(byte[] rawBytes, int length) voidclose()intintprivate byte[]getPacket(boolean reUsable) byte[]getPacketArray(boolean reUsable) Get next packet.private voidreadBlocking(byte[] arr, int length) private voidreadCompressBlocking(byte[] arr, int compressedLength, int decompressedLength) voidsetServerThreadId(long serverThreadId, Boolean isMaster) Set server thread id.voidsetTraceCache(LruTraceCache traceCache)
-
Field Details
-
REUSABLE_BUFFER_LENGTH
private static final int REUSABLE_BUFFER_LENGTH- See Also:
-
MAX_PACKET_SIZE
private static final int MAX_PACKET_SIZE- See Also:
-
logger
-
header
private final byte[] header -
reusableArray
private final byte[] reusableArray -
inputStream
-
maxQuerySizeToLog
private final int maxQuerySizeToLog -
cacheData
private byte[] cacheData -
cachePos
private int cachePos -
cacheEnd
private int cacheEnd -
packetSeq
private int packetSeq -
compressPacketSeq
private int compressPacketSeq -
serverThreadLog
-
traceCache
-
-
Constructor Details
-
DecompressPacketInputStream
-
-
Method Details
-
getPacket
- Specified by:
getPacketin interfacePacketInputStream- Throws:
IOException
-
getPacketArray
Get next packet. Packet can be compressed, and if so, can contain many standard packet.- Specified by:
getPacketArrayin interfacePacketInputStream- Parameters:
reUsable- if can use existing reusable buffer to avoid creating array- Returns:
- array packet.
- Throws:
IOException- if socket exception occur.
-
readCompressBlocking
private void readCompressBlocking(byte[] arr, int compressedLength, int decompressedLength) throws IOException - Throws:
IOException
-
readBlocking
- Throws:
IOException
-
cache
private void cache(byte[] rawBytes, int length) -
getNextCachePacket
private byte[] getNextCachePacket() -
getLastPacketSeq
public int getLastPacketSeq()- Specified by:
getLastPacketSeqin interfacePacketInputStream
-
getCompressLastPacketSeq
public int getCompressLastPacketSeq()- Specified by:
getCompressLastPacketSeqin interfacePacketInputStream
-
close
- Specified by:
closein interfacePacketInputStream- Throws:
IOException
-
setServerThreadId
Set server thread id.- Specified by:
setServerThreadIdin interfacePacketInputStream- Parameters:
serverThreadId- current server thread id.isMaster- is server master
-
setTraceCache
- Specified by:
setTraceCachein interfacePacketInputStream
-