log_format.h 896 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  4. //
  5. // Log format information shared by reader and writer.
  6. // See ../doc/log_format.md for more detail.
  7. #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_
  8. #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_
  9. namespace leveldb {
  10. namespace log {
  11. enum RecordType {
  12. // Zero is reserved for preallocated files
  13. kZeroType = 0,
  14. kFullType = 1,
  15. // For fragments
  16. kFirstType = 2,
  17. kMiddleType = 3,
  18. kLastType = 4
  19. };
  20. static const int kMaxRecordType = kLastType;
  21. static const int kBlockSize = 32768;
  22. // Header is checksum (4 bytes), length (2 bytes), type (1 byte).
  23. static const int kHeaderSize = 4 + 2 + 1;
  24. } // namespace log
  25. } // namespace leveldb
  26. #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_