Class Chunk
- java.lang.Object
-
- com.gurock.smartinspect.packets.Packet
-
- com.gurock.smartinspect.protocols.cloud.Chunk
-
public class Chunk extends Packet
-
-
Field Summary
Fields Modifier and Type Field Description ShortchunkFormatShortheaderSizestatic LoggerloggerintpacketCountByteArrayOutputStreamstream-
Fields inherited from class com.gurock.smartinspect.packets.Packet
PACKET_HEADER
-
-
Constructor Summary
Constructors Constructor Description Chunk(long chunkMaxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanFitFormattedPacket()voidchunkFormattedPacket()voidcompilePacket(Packet packet)Compile but don't add to the chunk yet.PacketTypegetPacketType()Intended to return the type of the packet.intgetSize()This method returns the total occupied memory size of this packet.longmillisecondsSinceTheFirstPacket()-
Methods inherited from class com.gurock.smartinspect.packets.Packet
getBytes, getLevel, getStringSize, getThreadId, isThreadSafe, lock, setBytes, setLevel, setThreadSafe, unlock
-
-
-
-
Field Detail
-
logger
public static final Logger logger
-
headerSize
public Short headerSize
-
chunkFormat
public Short chunkFormat
-
stream
public ByteArrayOutputStream stream
-
packetCount
public int packetCount
-
-
Method Detail
-
getSize
public int getSize()
Description copied from class:PacketThis method returns the total occupied memory size of this packet. This functionality is used by the backlog protocol feature to calculate the total backlog queue size.
-
getPacketType
public PacketType getPacketType()
Description copied from class:PacketIntended to return the type of the packet.- Specified by:
getPacketTypein classPacket- Returns:
- The type of this packet. Please see the PacketType type for a list of available packet types
-
compilePacket
public void compilePacket(Packet packet) throws IOException
Compile but don't add to the chunk yet.- Parameters:
packet- packet to compile- Throws:
IOException- io exception
-
canFitFormattedPacket
public boolean canFitFormattedPacket()
-
chunkFormattedPacket
public void chunkFormattedPacket() throws IOException- Throws:
IOException
-
millisecondsSinceTheFirstPacket
public long millisecondsSinceTheFirstPacket()
-
-