Skip to content

Commit 99513a5

Browse files
committed
update c lib to v2.4.2
1 parent 3dd543e commit 99513a5

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

c/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module wildcat_c
22

33
go 1.25
44

5-
require github.com/wildcatdb/wildcat/v2 v2.4.1
5+
require github.com/wildcatdb/wildcat/v2 v2.4.2
66

77
require (
88
go.mongodb.org/mongo-driver v1.17.3 // indirect

c/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
22
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
44
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5-
github.com/wildcatdb/wildcat/v2 v2.4.1 h1:jYx8jtRuj1/BbVta3VayRneU9wdft4EWZLv1mDJaNMg=
6-
github.com/wildcatdb/wildcat/v2 v2.4.1/go.mod h1:MhT0iAaj4C6cpzKvSA/Pmm5M59jFuSxDi+E0vixOXM4=
5+
github.com/wildcatdb/wildcat/v2 v2.4.2 h1:qTWgX81/b/C7VjCAaR+cViceHJmuYnBffZ6KNP1RYU4=
6+
github.com/wildcatdb/wildcat/v2 v2.4.2/go.mod h1:MN8GlHCJjYD8SQvNC6iEreIpkqT22CN3PfCEjYUrqA4=
77
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
88
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
99
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=

sstable_test.go

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func TestSSTable_ConcurrentAccess(t *testing.T) {
174174
}
175175
}
176176

177-
forceManyWrites(t, db, 100)
177+
testForceManyWrites(t, db, 100)
178178
time.Sleep(500 * time.Millisecond) // Allow background flush to complete
179179

180180
// Number of concurrent readers and operations per reader
@@ -297,9 +297,10 @@ func TestSSTable_ConcurrentAccess(t *testing.T) {
297297
}
298298
}
299299

300-
// Helper function to force a flush to SSTable by writing many keys
301-
func forceManyWrites(t *testing.T, db *DB, count int) {
302-
// Write enough data to trigger memtable flush
300+
// forceManyWrites Helper function to force a flush to SSTable by writing many keys
301+
func testForceManyWrites(t *testing.T, db *DB, count int) {
302+
303+
// Write enough data to trigger memtable flush(es) for testing
303304
for i := 0; i < count; i++ {
304305
key := fmt.Sprintf("flush_key%d", i)
305306
value := fmt.Sprintf("flush_value%d", i)
@@ -313,19 +314,6 @@ func forceManyWrites(t *testing.T, db *DB, count int) {
313314
}
314315
}
315316

316-
// Helper function to check if a byte slice starts with a prefix
317-
func startsWith(data, prefix []byte) bool {
318-
if len(data) < len(prefix) {
319-
return false
320-
}
321-
for i := 0; i < len(prefix); i++ {
322-
if data[i] != prefix[i] {
323-
return false
324-
}
325-
}
326-
return true
327-
}
328-
329317
func TestSSTable_MVCCWithMultipleVersions(t *testing.T) {
330318
dir, err := os.MkdirTemp("", "db_sstable_mvcc_multiple_versions_test")
331319
if err != nil {

utils.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
func extractIDFromFilename(filename string) int64 {
1010
parts := strings.Split(filename, ".")
1111

12-
// WAL file names in wildcat are <id>.<ext>
1312
if len(parts) != 2 {
1413
return 0
1514
}
@@ -21,3 +20,16 @@ func extractIDFromFilename(filename string) int64 {
2120

2221
return ts
2322
}
23+
24+
// startsWith Helper function to check if a byte slice starts with a prefix
25+
func startsWith(data, prefix []byte) bool {
26+
if len(data) < len(prefix) {
27+
return false
28+
}
29+
for i := 0; i < len(prefix); i++ {
30+
if data[i] != prefix[i] {
31+
return false
32+
}
33+
}
34+
return true
35+
}

0 commit comments

Comments
 (0)