Skip to content

Commit

Permalink
Remove leftover from copy&paste
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Navarro Perez <[email protected]>
  • Loading branch information
ajnavarro committed Jan 16, 2025
1 parent 267c467 commit a9345b4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tm2/pkg/db/pebbledb/pebbledb.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,45 +118,44 @@ func (db *PebbleDB) Stats() map[string]string {

// Implements DB.
func (db *PebbleDB) NewBatch() db.Batch {
return &goLevelDBBatch{db, db.db.NewBatch()}
return &pebbleDBBatch{db, db.db.NewBatch()}

Check warning on line 121 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L120-L121

Added lines #L120 - L121 were not covered by tests
}

type goLevelDBBatch struct {
type pebbleDBBatch struct {
db *PebbleDB
batch *pebble.Batch
}

// Implements Batch.
func (mBatch *goLevelDBBatch) Set(key, value []byte) {
func (mBatch *pebbleDBBatch) Set(key, value []byte) {
if err := mBatch.batch.Set(key, value, pebble.NoSync); err != nil {
panic(err)

Check warning on line 132 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L130-L132

Added lines #L130 - L132 were not covered by tests
}
}

// Implements Batch.
func (mBatch *goLevelDBBatch) Delete(key []byte) {
func (mBatch *pebbleDBBatch) Delete(key []byte) {
if err := mBatch.batch.Delete(key, pebble.NoSync); err != nil {
panic(err)

Check warning on line 139 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L137-L139

Added lines #L137 - L139 were not covered by tests
}
}

// Implements Batch.
func (mBatch *goLevelDBBatch) Write() {
func (mBatch *pebbleDBBatch) Write() {
if err := mBatch.batch.Commit(pebble.NoSync); err != nil {
panic(err)

Check warning on line 146 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L144-L146

Added lines #L144 - L146 were not covered by tests
}
}

// Implements Batch.
func (mBatch *goLevelDBBatch) WriteSync() {
func (mBatch *pebbleDBBatch) WriteSync() {
if err := mBatch.batch.Commit(pebble.Sync); err != nil {
panic(err)

Check warning on line 153 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L151-L153

Added lines #L151 - L153 were not covered by tests
}
}

// Implements Batch.
// Close is no-op for goLevelDBBatch.
func (mBatch *goLevelDBBatch) Close() {
func (mBatch *pebbleDBBatch) Close() {
mBatch.batch.Close()

Check warning on line 159 in tm2/pkg/db/pebbledb/pebbledb.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/db/pebbledb/pebbledb.go#L158-L159

Added lines #L158 - L159 were not covered by tests
}

Expand Down

0 comments on commit a9345b4

Please sign in to comment.