1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
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).
9 #include "rocksdb/slice.h"
11 namespace ROCKSDB_NAMESPACE
{
13 // Define all public custom types here.
15 using ColumnFamilyId
= uint32_t;
17 // Represents a sequence number in a WAL file.
18 typedef uint64_t SequenceNumber
;
20 const SequenceNumber kMinUnCommittedSeq
= 1; // 0 is always committed
22 // The types of files RocksDB uses in a DB directory. (Available for
31 kInfoLogFile
, // Either the current one, or an old one
38 // User-oriented representation of internal key types.
39 // Ordering of this enum entries should not change.
47 kEntryDeleteWithTimestamp
,
51 // <user key, sequence number, and entry type> tuple.
54 SequenceNumber sequence
;
57 FullKey() : sequence(0) {} // Intentionally left uninitialized (for speed)
58 FullKey(const Slice
& u
, const SequenceNumber
& seq
, EntryType t
)
59 : user_key(u
), sequence(seq
), type(t
) {}
60 std::string
DebugString(bool hex
= false) const;
65 type
= EntryType::kEntryPut
;
69 // Parse slice representing internal key to FullKey
70 // Parsed FullKey is valid for as long as the memory pointed to by
71 // internal_key is alive.
72 bool ParseFullKey(const Slice
& internal_key
, FullKey
* result
);
74 } // namespace ROCKSDB_NAMESPACE