2pc_docs.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2014 The lldb Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. /*
  5. Anatomy of a WAL file
  6. WAL file
  7. A sequence of packets
  8. WAL packet, parts in slice notation
  9. [0:4], 4 bytes: N uint32 // network byte order
  10. [4:4+N], N bytes: payload []byte // gb encoded scalars
  11. Packets, including the 4 byte 'size' prefix, MUST BE padded to size == 0 (mod
  12. 16). The values of the padding bytes MUST BE zero.
  13. Encoded scalars first item is a packet type number (packet tag). The meaning of
  14. any other item(s) of the payload depends on the packet tag.
  15. Packet definitions
  16. {wpt00Header int, typ int, s string}
  17. typ: Must be zero (ACIDFiler0 file).
  18. s: Any comment string, empty string is okay.
  19. This packet must be present only once - as the first packet of
  20. a WAL file.
  21. {wpt00WriteData int, b []byte, off int64}
  22. Write data (WriteAt(b, off)).
  23. {wpt00Checkpoint int, sz int64}
  24. Checkpoint (Truncate(sz)).
  25. This packet must be present only once - as the last packet of
  26. a WAL file.
  27. */
  28. package lldb
  29. //TODO optimize bitfiler/wal/2pc data above final size