Line data Source code
1 : // Copyright 2018 The LevelDB-Go and Pebble Authors. All rights reserved. Use
2 : // of this source code is governed by a BSD-style license that can be found in
3 : // the LICENSE file.
4 :
5 : package pebble
6 :
7 : import "github.com/cockroachdb/pebble/internal/base"
8 :
9 : // SeqNum exports the base.SeqNum type.
10 : type SeqNum = base.SeqNum
11 :
12 : // InternalKeyKind exports the base.InternalKeyKind type.
13 : type InternalKeyKind = base.InternalKeyKind
14 :
15 : // These constants are part of the file format, and should not be changed.
16 : const (
17 : InternalKeyKindDelete = base.InternalKeyKindDelete
18 : InternalKeyKindSet = base.InternalKeyKindSet
19 : InternalKeyKindMerge = base.InternalKeyKindMerge
20 : InternalKeyKindLogData = base.InternalKeyKindLogData
21 : InternalKeyKindSingleDelete = base.InternalKeyKindSingleDelete
22 : InternalKeyKindRangeDelete = base.InternalKeyKindRangeDelete
23 : InternalKeyKindMax = base.InternalKeyKindMax
24 : InternalKeyKindSetWithDelete = base.InternalKeyKindSetWithDelete
25 : InternalKeyKindRangeKeySet = base.InternalKeyKindRangeKeySet
26 : InternalKeyKindRangeKeyUnset = base.InternalKeyKindRangeKeyUnset
27 : InternalKeyKindRangeKeyDelete = base.InternalKeyKindRangeKeyDelete
28 : InternalKeyKindRangeKeyMin = base.InternalKeyKindRangeKeyMin
29 : InternalKeyKindRangeKeyMax = base.InternalKeyKindRangeKeyMax
30 : InternalKeyKindIngestSST = base.InternalKeyKindIngestSST
31 : InternalKeyKindDeleteSized = base.InternalKeyKindDeleteSized
32 : InternalKeyKindExcise = base.InternalKeyKindExcise
33 : InternalKeyKindInvalid = base.InternalKeyKindInvalid
34 : )
35 :
36 : // InternalKeyTrailer exports the base.InternalKeyTrailer type.
37 : type InternalKeyTrailer = base.InternalKeyTrailer
38 :
39 : // InternalKey exports the base.InternalKey type.
40 : type InternalKey = base.InternalKey
41 :
42 : // KeyRange exports the base.KeyRange type.
43 : type KeyRange = base.KeyRange
44 :
45 : // MakeInternalKey constructs an internal key from a specified user key,
46 : // sequence number and kind.
47 0 : func MakeInternalKey(userKey []byte, seqNum SeqNum, kind InternalKeyKind) InternalKey {
48 0 : return base.MakeInternalKey(userKey, seqNum, kind)
49 0 : }
50 :
51 : // MakeInternalKeyTrailer constructs a trailer from a specified sequence number
52 : // and kind.
53 0 : func MakeInternalKeyTrailer(seqNum SeqNum, kind InternalKeyKind) InternalKeyTrailer {
54 0 : return base.MakeTrailer(seqNum, kind)
55 0 : }
56 :
57 : type internalIterator = base.InternalIterator
58 :
59 : type topLevelIterator = base.TopLevelIterator
60 :
61 : // IsCorruptionError returns true if the given error indicates database
62 : // corruption.
63 0 : func IsCorruptionError(err error) bool {
64 0 : return base.IsCorruptionError(err)
65 0 : }
66 :
67 : // ErrCorruption is a marker to indicate that data in a file (WAL, MANIFEST,
68 : // sstable) isn't in the expected format.
69 : // DEPRECATED: should use IsCorruptionError() instead.
70 : var ErrCorruption = base.ErrCorruption
71 :
72 : // AttributeAndLen exports the base.AttributeAndLen type.
73 : type AttributeAndLen = base.AttributeAndLen
74 :
75 : // ShortAttribute exports the base.ShortAttribute type.
76 : type ShortAttribute = base.ShortAttribute
77 :
78 : // LazyFetcher exports the base.LazyFetcher type. This export is needed since
79 : // LazyValue.Clone requires a pointer to a LazyFetcher struct to avoid
80 : // allocations. No code outside Pebble needs to peer into a LazyFetcher.
81 : type LazyFetcher = base.LazyFetcher
|