@@ -11,7 +11,6 @@ import (
11
11
"slices"
12
12
"unsafe"
13
13
14
- "github.com/cockroachdb/crlib/crmath"
15
14
"github.com/cockroachdb/pebble/internal/invariants"
16
15
"github.com/cockroachdb/pebble/sstable/colblk"
17
16
"github.com/cockroachdb/pebble/sstable/rowblk"
@@ -25,9 +24,6 @@ const propertiesBlockRestartInterval = math.MaxInt32
25
24
// can be used by code which doesn't care to make the distinction between physical
26
25
// and virtual sstables properties.
27
26
//
28
- // For virtual sstables, fields are constructed through extrapolation upon virtual
29
- // reader construction.
30
- //
31
27
// NB: The values of these properties can affect correctness. For example,
32
28
// if NumRangeKeySets == 0, but the sstable actually contains range keys, then
33
29
// the iterators will behave incorrectly.
@@ -91,47 +87,6 @@ func (c *CommonProperties) NumPointDeletions() uint64 {
91
87
return invariants .SafeSub (c .NumDeletions , c .NumRangeDeletions )
92
88
}
93
89
94
- // GetScaledProperties returns an estimation of the common properties for a
95
- // virtual table that addresses only <size> bytes out of the entire <backingSize>.
96
- func (c * CommonProperties ) GetScaledProperties (backingSize , size uint64 ) CommonProperties {
97
- // Make sure the sizes are sane, just in case.
98
- size = max (size , 1 )
99
- backingSize = max (backingSize , size )
100
-
101
- scale := func (a uint64 ) uint64 {
102
- return crmath .ScaleUint64 (a , size , backingSize )
103
- }
104
- // It's important that no non-zero fields (like NumDeletions, NumRangeKeySets)
105
- // become zero (or vice-versa).
106
- if invariants .Enabled && (scale (1 ) != 1 || scale (0 ) != 0 ) {
107
- panic ("bad scale()" )
108
- }
109
-
110
- scaled := * c
111
- scaled .RawKeySize = scale (c .RawKeySize )
112
- scaled .RawValueSize = scale (c .RawValueSize )
113
- scaled .NumEntries = scale (c .NumEntries )
114
- scaled .NumDataBlocks = scale (c .NumDataBlocks )
115
- scaled .NumTombstoneDenseBlocks = scale (c .NumTombstoneDenseBlocks )
116
-
117
- scaled .NumRangeDeletions = scale (c .NumRangeDeletions )
118
- scaled .NumSizedDeletions = scale (c .NumSizedDeletions )
119
- // We cannot directly scale NumDeletions, because it is supposed to be the sum
120
- // of various types of deletions. See #4670.
121
- numOtherDeletions := scale (invariants .SafeSub (c .NumDeletions , c .NumRangeDeletions ) + c .NumSizedDeletions )
122
- scaled .NumDeletions = numOtherDeletions + scaled .NumRangeDeletions + scaled .NumSizedDeletions
123
-
124
- scaled .NumRangeKeyDels = scale (c .NumRangeKeyDels )
125
- scaled .NumRangeKeySets = scale (c .NumRangeKeySets )
126
-
127
- scaled .ValueBlocksSize = scale (c .ValueBlocksSize )
128
-
129
- scaled .RawPointTombstoneKeySize = scale (c .RawPointTombstoneKeySize )
130
- scaled .RawPointTombstoneValueSize = scale (c .RawPointTombstoneValueSize )
131
-
132
- return scaled
133
- }
134
-
135
90
// Properties holds the sstable property values. The properties are
136
91
// automatically populated during sstable creation and load from the properties
137
92
// meta block when an sstable is opened.
0 commit comments