Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9ea19a1

Browse files
authoredFeb 8, 2022
goleveldb: ForceCompact (#216)
* add force compact * go mod tidy * dont break the interface * bring back remotedb * fix lint
1 parent ce3673b commit 9ea19a1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/cosmos/gorocksdb v1.2.0
77
github.com/dgraph-io/badger/v2 v2.2007.2
88
github.com/gogo/protobuf v1.3.2
9+
github.com/golang/protobuf v1.4.3 // indirect
910
github.com/google/btree v1.0.0
1011
github.com/jmhodges/levigo v1.0.0
1112
github.com/stretchr/testify v1.7.0
@@ -21,7 +22,6 @@ require (
2122
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
2223
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
2324
github.com/dustin/go-humanize v1.0.0 // indirect
24-
github.com/golang/protobuf v1.4.3 // indirect
2525
github.com/golang/snappy v0.0.1 // indirect
2626
github.com/pkg/errors v0.8.1 // indirect
2727
github.com/pmezard/go-difflib v1.0.0 // indirect

‎goleveldb.go

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ func (db *GoLevelDB) Stats() map[string]string {
166166
return stats
167167
}
168168

169+
func (db *GoLevelDB) ForceCompact(start, limit []byte) error {
170+
return db.db.CompactRange(util.Range{Start: start, Limit: limit})
171+
}
172+
169173
// NewBatch implements DB.
170174
func (db *GoLevelDB) NewBatch() Batch {
171175
return newGoLevelDBBatch(db)

0 commit comments

Comments
 (0)
Please sign in to comment.