Skip to content

Log Segment File Format

agazso edited this page May 24, 2011 · 2 revisions

Log Segment File Format, Version 0

Header

  • u32 Version
  • u64 LogSegmentID
  • Log Segments

Log Segment

  • u64 Size
  • u64 Uncompressed length
  • u32 CRC
  • Commands

Command

Depending on the first byte, the command is either a SET or a DELETE command.

SET Command

  • u8 's'
  • Bool Use previous ShardID. If false, then optional:
    • u16 ContextID
    • u64 ShardID
  • u16 Key Length
  • Key
  • u32 Value Length
  • Value

DELETE Command

  • u8 'd'
  • Bool Use previous ShardID. If false, then optional:
    • u16 ContextID
    • u64 ShardID
  • u16 Key Length
  • Key