public abstract class AbstractPacketInputStream extends Object implements PacketInputStream
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
enableNetworkStatistics |
protected InputStream |
inputStream |
protected static int |
MAX_PACKET_SIZE |
protected int |
maxQuerySizeToLog |
protected int |
mysqlSeqNo |
protected static int |
REUSABLE_BUFFER_LENGTH |
protected byte[] |
reusableArray |
protected String |
serverThreadLog |
protected long |
threadId |
protected long |
timestampAfterRead |
protected LruTraceCache |
traceCache |
| Constructor and Description |
|---|
AbstractPacketInputStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearNetworkStatistics() |
void |
close() |
protected abstract void |
doTrace(int offset,
int length,
byte[] rawBytes) |
void |
enableNetworkStatistics(boolean flag) |
abstract int |
getCompressLastPacketSeq() |
int |
getLastPacketSeq() |
abstract Buffer |
getPacket(boolean reUsable) |
abstract byte[] |
getPacketArray(boolean reUsable) |
long |
getTimestampAfterRead() |
protected abstract void |
readMysqlStream(byte[] rawBytes,
int off,
int remaining) |
void |
setServerThreadId(long serverThreadId,
Boolean isMaster)
Set server thread id.
|
void |
setTraceCache(LruTraceCache traceCache) |
protected InputStream inputStream
protected long threadId
protected int mysqlSeqNo
protected LruTraceCache traceCache
protected String serverThreadLog
protected int maxQuerySizeToLog
protected boolean enableNetworkStatistics
protected long timestampAfterRead
protected static final int REUSABLE_BUFFER_LENGTH
protected static final int MAX_PACKET_SIZE
protected final byte[] reusableArray
public abstract Buffer getPacket(boolean reUsable) throws IOException
getPacket in interface PacketInputStreamIOExceptionpublic abstract byte[] getPacketArray(boolean reUsable)
throws IOException
getPacketArray in interface PacketInputStreamIOExceptionprotected abstract void readMysqlStream(byte[] rawBytes,
int off,
int remaining)
throws IOException
IOExceptionprotected abstract void doTrace(int offset,
int length,
byte[] rawBytes)
public int getLastPacketSeq()
getLastPacketSeq in interface PacketInputStreampublic abstract int getCompressLastPacketSeq()
getCompressLastPacketSeq in interface PacketInputStreampublic void close()
throws IOException
close in interface PacketInputStreamIOExceptionpublic void setServerThreadId(long serverThreadId,
Boolean isMaster)
setServerThreadId in interface PacketInputStreamserverThreadId - current server thread id.isMaster - is server masterpublic void setTraceCache(LruTraceCache traceCache)
setTraceCache in interface PacketInputStreampublic void enableNetworkStatistics(boolean flag)
enableNetworkStatistics in interface PacketInputStreampublic long getTimestampAfterRead()
getTimestampAfterRead in interface PacketInputStreampublic void clearNetworkStatistics()
clearNetworkStatistics in interface PacketInputStreamCopyright © 2022 oceanbase.com. All rights reserved.