作者: 谢瑞阳 10225101483 徐翔宇 10225101535

35 line
858 B

  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.txt 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), type (1 byte), length (2 bytes).
  23. static const int kHeaderSize = 4 + 1 + 2;
  24. }
  25. }
  26. #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_