]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/log_format.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / db / log_format.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
5 //
6 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. See the AUTHORS file for names of contributors.
9 //
10 // Log format information shared by reader and writer.
11 // See ../doc/log_format.txt for more detail.
12
13 #pragma once
14 namespace rocksdb {
15 namespace log {
16
17 enum RecordType {
18 // Zero is reserved for preallocated files
19 kZeroType = 0,
20 kFullType = 1,
21
22 // For fragments
23 kFirstType = 2,
24 kMiddleType = 3,
25 kLastType = 4,
26
27 // For recycled log files
28 kRecyclableFullType = 5,
29 kRecyclableFirstType = 6,
30 kRecyclableMiddleType = 7,
31 kRecyclableLastType = 8,
32 };
33 static const int kMaxRecordType = kRecyclableLastType;
34
35 static const unsigned int kBlockSize = 32768;
36
37 // Header is checksum (4 bytes), length (2 bytes), type (1 byte)
38 static const int kHeaderSize = 4 + 2 + 1;
39
40 // Recyclable header is checksum (4 bytes), type (1 byte), log number
41 // (4 bytes), length (2 bytes).
42 static const int kRecyclableHeaderSize = 4 + 1 + 4 + 2;
43
44 } // namespace log
45 } // namespace rocksdb