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