Log Block Container Model - Manages multiple log blocks with automatic sorting and organization.
This container model manages collections of LogBlockModel instances, providing organized access
to log blocks with automatic sorting by block number. It serves as the storage layer within
LogStreamModel instances, handling the efficient organization and retrieval of log blocks
that make up a complete log stream.
Stream Block Storage - Central storage for all blocks within a log stream
Sequential Block Access - Navigate through log blocks in chronological order
Block Organization - Maintain sorted collections of log segments
Memory Management - Efficiently organize log data for stream processing
Block Lifecycle - Handle adding and removing blocks as streams evolve
Example: Container Usage Within Stream
// Typically used internally by LogStreamModel constlogStream = LogStream.instance('system-logs').build(); awaitlogStream.load();
// Access the container through the stream constblockContainer = logStream._blocks; // Internal container constblocks = logStream.blocks; // Public access to blocks
// Container automatically sorts blocks by blockNum console.log(`Stream has ${blocks.length} blocks`); blocks.forEach(block=> { console.log(`Block ${block.blockNum}: ${block.lineCount} lines`); });
Log Block Container Model - Manages multiple log blocks with automatic sorting and organization.
This container model manages collections of LogBlockModel instances, providing organized access to log blocks with automatic sorting by block number. It serves as the storage layer within LogStreamModel instances, handling the efficient organization and retrieval of log blocks that make up a complete log stream.
Key Features
Architecture Role
The container fits into the log streaming architecture as:
Common Use Cases
Example: Container Usage Within Stream
Example: Direct Container Operations
Example: React Block List Component
See