Class DecompressPacketInputStream
java.lang.Object
org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream
- All Implemented Interfaces:
PacketInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private int
private int
private int
private final byte[]
private final InputStream
private static final Logger
private static final int
private final int
private int
private static final int
private final byte[]
private String
private LruTraceCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
cache
(byte[] rawBytes, int length) void
close()
int
int
private byte[]
getPacket
(boolean reUsable) byte[]
getPacketArray
(boolean reUsable) Get next packet.private void
readBlocking
(byte[] arr, int length) private void
readCompressBlocking
(byte[] arr, int compressedLength, int decompressedLength) void
setServerThreadId
(long serverThreadId, Boolean isMaster) Set server thread id.void
setTraceCache
(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:
getPacket
in interfacePacketInputStream
- Throws:
IOException
-
getPacketArray
Get next packet. Packet can be compressed, and if so, can contain many standard packet.- Specified by:
getPacketArray
in 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:
getLastPacketSeq
in interfacePacketInputStream
-
getCompressLastPacketSeq
public int getCompressLastPacketSeq()- Specified by:
getCompressLastPacketSeq
in interfacePacketInputStream
-
close
- Specified by:
close
in interfacePacketInputStream
- Throws:
IOException
-
setServerThreadId
Set server thread id.- Specified by:
setServerThreadId
in interfacePacketInputStream
- Parameters:
serverThreadId
- current server thread id.isMaster
- is server master
-
setTraceCache
- Specified by:
setTraceCache
in interfacePacketInputStream
-