Skip to content

Commit 1edba4a

Browse files
wenyihu6tbg
authored andcommitted
asim: remove unused keyspace for rand testing
Previously, we added min/max key with staticOptionSettings, making keyspace unused. This commit finishes the cleanup by removing the unused keyspace field. Epic: none Release note: none
1 parent ac6110e commit 1edba4a

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ const (
1919
defaultStoresPerNode = 1
2020
)
2121

22-
const defaultKeyspace = 200000
23-
2422
const (
2523
defaultRwRatio, defaultRate = 0.0, 0.0
2624
defaultMinBlock, defaultMaxBlock = 1, 1
27-
defaultMinKey, defaultMaxKey = int64(0), int64(defaultKeyspace)
25+
defaultMinKey, defaultMaxKey = int64(0), int64(200000)
2826
defaultSkewedAccess = false
2927
)
3028

@@ -51,7 +49,6 @@ type staticOptionSettings struct {
5149
maxKey int64
5250
skewedAccess bool
5351
ranges int
54-
keySpace int
5552
placementType gen.PlacementType
5653
replicationFactor int
5754
bytes int64
@@ -72,7 +69,6 @@ func getDefaultStaticOptionSettings() staticOptionSettings {
7269
maxKey: defaultMaxKey,
7370
skewedAccess: defaultSkewedAccess,
7471
ranges: defaultRanges,
75-
keySpace: defaultKeyspace,
7672
placementType: defaultPlacementType,
7773
replicationFactor: defaultReplicationFactor,
7874
bytes: defaultBytes,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ func printTestSettings(t testSettings, staticSettings staticOptionSettings, buf
104104
buf.WriteString(fmt.Sprintf("\t%v\n", t.rangeGen))
105105
} else {
106106
buf.WriteString(configStr("ranges", "static"))
107-
buf.WriteString(fmt.Sprintf("\tplacement_type=%v, ranges=%d, key_space=%d, replication_factor=%d, bytes=%d\n",
108-
staticSettings.placementType, staticSettings.ranges, staticSettings.keySpace, staticSettings.replicationFactor, staticSettings.bytes))
107+
buf.WriteString(fmt.Sprintf("\tplacement_type=%v, ranges=%d, min_key=%d, max_key=%d, replication_factor=%d, bytes=%d\n",
108+
staticSettings.placementType, staticSettings.ranges, staticSettings.minKey, staticSettings.maxKey, staticSettings.replicationFactor, staticSettings.bytes))
109109
}
110110

111111
if t.randOptions.load {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ func TestRandomized(t *testing.T) {
194194
scanIfExists(t, d, "max_key", &staticOptionSettings.maxKey)
195195
scanIfExists(t, d, "skewed_access", &staticOptionSettings.skewedAccess)
196196
scanIfExists(t, d, "ranges", &staticOptionSettings.ranges)
197-
scanIfExists(t, d, "key_space", &staticOptionSettings.keySpace)
198197
scanIfExists(t, d, "placement_type", &staticOptionSettings.placementType)
199198
scanIfExists(t, d, "replication_factor", &staticOptionSettings.replicationFactor)
200199
scanIfExists(t, d, "bytes", &staticOptionSettings.bytes)

pkg/kv/kvserver/asim/tests/testdata/rand/default_settings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test settings
4747
generating cluster configurations using static option
4848
nodes=3, stores_per_node=1
4949
generating ranges configurations using static option
50-
placement_type=even, ranges=10, key_space=200000, replication_factor=3, bytes=0
50+
placement_type=even, ranges=10, min_key=0, max_key=200000, replication_factor=3, bytes=0
5151
generating load configurations using static option
5252
rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=0, max_key=200000, skewed_access=false
5353
generating events configurations using static option
@@ -163,7 +163,7 @@ test settings
163163
generating cluster configurations using static option
164164
nodes=3, stores_per_node=1
165165
generating ranges configurations using static option
166-
placement_type=even, ranges=10, key_space=200000, replication_factor=3, bytes=0
166+
placement_type=even, ranges=10, min_key=0, max_key=200000, replication_factor=3, bytes=0
167167
generating load configurations using static option
168168
rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=0, max_key=200000, skewed_access=false
169169
generating events configurations using static option
@@ -213,7 +213,7 @@ test settings
213213
generating cluster configurations using static option
214214
nodes=3, stores_per_node=1
215215
generating ranges configurations using static option
216-
placement_type=even, ranges=10, key_space=200000, replication_factor=3, bytes=0
216+
placement_type=even, ranges=10, min_key=0, max_key=200000, replication_factor=3, bytes=0
217217
generating load configurations using static option
218218
rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=0, max_key=200000, skewed_access=false
219219
generating events configurations using static option
@@ -281,7 +281,7 @@ test settings
281281
generating cluster configurations using static option
282282
nodes=5, stores_per_node=5
283283
generating ranges configurations using static option
284-
placement_type=skewed, ranges=2, key_space=30000, replication_factor=5, bytes=2
284+
placement_type=skewed, ranges=2, min_key=0, max_key=10000, replication_factor=5, bytes=2
285285
generating load configurations using static option
286286
rw_ratio=0.20, rate=0.01, min_block=2, max_block=3, min_key=0, max_key=10000, skewed_access=true
287287
generating events configurations using static option

pkg/kv/kvserver/asim/tests/testdata/rand/rand_cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test settings
5151
generating cluster configurations using randomized option
5252
cluster_gen_type=multi_region
5353
generating ranges configurations using static option
54-
placement_type=even, ranges=10, key_space=200000, replication_factor=3, bytes=0
54+
placement_type=even, ranges=10, min_key=0, max_key=200000, replication_factor=3, bytes=0
5555
generating load configurations using static option
5656
rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=0, max_key=200000, skewed_access=false
5757
generating events configurations using static option

pkg/kv/kvserver/asim/tests/testdata/rand/rand_event

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test settings
1515
generating cluster configurations using randomized option
1616
cluster_gen_type=multi_region
1717
generating ranges configurations using static option
18-
placement_type=even, ranges=1, key_space=200000, replication_factor=3, bytes=0
18+
placement_type=even, ranges=1, min_key=0, max_key=200000, replication_factor=3, bytes=0
1919
generating load configurations using static option
2020
rw_ratio=0.00, rate=0.00, min_block=1, max_block=1, min_key=0, max_key=200000, skewed_access=false
2121
generating events configurations using randomized option

0 commit comments

Comments
 (0)