Skip to content

Commit eed01b1

Browse files
craig[bot]wenyihu6
andcommitted
108068: asim: rename uniform placement type to even placement type r=kvoli a=wenyihu6 Previously, we use uniform as a placement type when describing equal and deterministic allocation of ranges among stores. This leads to confusion as the term uniform is associated with probability distribution where all outcomes are equally likely for ranges and key space generators. In our context, the allocation of ranges is deterministic and even, not probabilistic. This patch renames uniform to even to be clearer. Release Note: none Epic: none Co-authored-by: wenyihu6 <[email protected]>
2 parents 2d508b2 + da4ab5c commit eed01b1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/kv/kvserver/asim/gen/generator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (lr LoadedRanges) Generate(
190190
type PlacementType int
191191

192192
const (
193-
Uniform PlacementType = iota
193+
Even PlacementType = iota
194194
Skewed
195195
)
196196

@@ -209,7 +209,7 @@ type BaseRanges struct {
209209
// PlacementType while using other BaseRanges fields for range configuration.
210210
func (b BaseRanges) getRangesInfo(pType PlacementType, numOfStores int) state.RangesInfo {
211211
switch pType {
212-
case Uniform:
212+
case Even:
213213
return state.RangesInfoEvenDistribution(numOfStores, b.Ranges, b.KeySpace, b.ReplicationFactor, b.Bytes)
214214
case Skewed:
215215
return state.RangesInfoSkewedDistribution(numOfStores, b.Ranges, b.KeySpace, b.ReplicationFactor, b.Bytes)
@@ -227,7 +227,7 @@ func (b BaseRanges) loadRangeInfo(s state.State, rangesInfo state.RangesInfo) {
227227
}
228228

229229
// BasicRanges implements the RangeGen interface, supporting basic range info
230-
// distribution, including uniform and skewed distributions.
230+
// distribution, including even and skewed distributions.
231231
type BasicRanges struct {
232232
BaseRanges
233233
PlacementType PlacementType

pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func TestDataDriven(t *testing.T) {
209209
if placementSkew {
210210
placementType = gen.Skewed
211211
} else {
212-
placementType = gen.Uniform
212+
placementType = gen.Even
213213
}
214214
rangeGen = gen.BasicRanges{
215215
BaseRanges: gen.BaseRanges{

pkg/kv/kvserver/asim/tests/default_settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func defaultLoadGen() gen.BasicLoad {
6363

6464
const (
6565
defaultRanges = 1
66-
defaultPlacementType = gen.Uniform
66+
defaultPlacementType = gen.Even
6767
defaultReplicationFactor = 1
6868
defaultBytes = 0
6969
)

0 commit comments

Comments
 (0)