]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/db/log_format.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / db / log_format.h
CommitLineData
7c673cae 1// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
11fdf7f2
TL
2// This source code is licensed under both the GPLv2 (found in the
3// COPYING file in the root directory) and Apache 2.0 License
4// (found in the LICENSE.Apache file in the root directory).
7c673cae
FG
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
f67539c2
TL
14
15#include "rocksdb/rocksdb_namespace.h"
16
17namespace ROCKSDB_NAMESPACE {
7c673cae
FG
18namespace log {
19
20enum RecordType {
21 // Zero is reserved for preallocated files
22 kZeroType = 0,
23 kFullType = 1,
24
25 // For fragments
26 kFirstType = 2,
27 kMiddleType = 3,
28 kLastType = 4,
29
30 // For recycled log files
31 kRecyclableFullType = 5,
32 kRecyclableFirstType = 6,
33 kRecyclableMiddleType = 7,
34 kRecyclableLastType = 8,
1e59de90
TL
35
36 // Compression Type
37 kSetCompressionType = 9,
7c673cae 38};
1e59de90 39static const int kMaxRecordType = kSetCompressionType;
7c673cae
FG
40
41static const unsigned int kBlockSize = 32768;
42
43// Header is checksum (4 bytes), length (2 bytes), type (1 byte)
44static const int kHeaderSize = 4 + 2 + 1;
45
11fdf7f2
TL
46// Recyclable header is checksum (4 bytes), length (2 bytes), type (1 byte),
47// log number (4 bytes).
48static const int kRecyclableHeaderSize = 4 + 2 + 1 + 4;
7c673cae
FG
49
50} // namespace log
f67539c2 51} // namespace ROCKSDB_NAMESPACE