@@ -11,7 +11,6 @@ import (
11
11
"slices"
12
12
"unsafe"
13
13
14
- "github.com/cockroachdb/pebble/internal/invariants"
15
14
"github.com/cockroachdb/pebble/sstable/colblk"
16
15
"github.com/cockroachdb/pebble/sstable/rowblk"
17
16
)
@@ -20,14 +19,10 @@ import (
20
19
21
20
const propertiesBlockRestartInterval = math .MaxInt32
22
21
23
- // CommonProperties holds properties for either a virtual or a physical sstable. This
24
- // can be used by code which doesn't care to make the distinction between physical
25
- // and virtual sstables properties.
26
- //
27
- // NB: The values of these properties can affect correctness. For example,
28
- // if NumRangeKeySets == 0, but the sstable actually contains range keys, then
29
- // the iterators will behave incorrectly.
30
- type CommonProperties struct {
22
+ // Properties holds the sstable property values. The properties are
23
+ // automatically populated during sstable creation and load from the properties
24
+ // meta block when an sstable is opened.
25
+ type Properties struct {
31
26
// The number of entries in this table.
32
27
NumEntries uint64 `prop:"rocksdb.num.entries" options:"encodeempty"`
33
28
// Total raw key size.
@@ -71,30 +66,6 @@ type CommonProperties struct {
71
66
// This statistic is used to determine eligibility for a tombstone density
72
67
// compaction.
73
68
NumTombstoneDenseBlocks uint64 `prop:"pebble.num.tombstone-dense-blocks"`
74
- }
75
-
76
- // String is only used for testing purposes.
77
- func (c * CommonProperties ) String () string {
78
- p := Properties {
79
- CommonProperties : * c ,
80
- }
81
- return p .String ()
82
- }
83
-
84
- // NumPointDeletions is the number of point deletions in the sstable. For virtual
85
- // sstables, this is an estimate.
86
- func (c * CommonProperties ) NumPointDeletions () uint64 {
87
- return invariants .SafeSub (c .NumDeletions , c .NumRangeDeletions )
88
- }
89
-
90
- // Properties holds the sstable property values. The properties are
91
- // automatically populated during sstable creation and load from the properties
92
- // meta block when an sstable is opened.
93
- type Properties struct {
94
- // CommonProperties needs to be at the top of the Properties struct so that the
95
- // offsets of the fields in CommonProperties match the offsets of the embedded
96
- // fields of CommonProperties in Properties.
97
- CommonProperties `prop:"pebble.embbeded_common_properties"`
98
69
99
70
// The name of the comparer used in this table.
100
71
ComparerName string `prop:"rocksdb.comparator" options:"encodeempty,intern"`
0 commit comments