ChunkedContext

internal class ChunkedContext(response: ChunkedScrapeResponse, maxZippedContentSize: Long)(source)

Accumulates chunked scrape response data with CRC32 integrity validation.

When a scrape response exceeds the gRPC message size limit, the agent sends it as a sequence of header, chunk, and summary messages. This class reassembles the chunks into a single byte stream, validating running CRC32 checksums and byte/chunk counts at each step. On successful summary validation, it produces a complete ScrapeResults.

Parameters

response

the initial chunked response containing the header

maxZippedContentSize

maximum allowed total zipped content size in bytes

See also

Constructors

Link copied to clipboard
constructor(response: ChunkedScrapeResponse, maxZippedContentSize: Long)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun applyChunk(data: ByteArray, chunkByteCount: Int, chunkCount: Int, chunkChecksum: Long)
Link copied to clipboard
fun applySummary(summaryChunkCount: Int, summaryByteCount: Int, summaryChecksum: Long): ScrapeResults