add options to BlockstoreGC trait
This commit is contained in:
parent
94509968a0
commit
a843665132
@ -471,7 +471,7 @@ func (b *Blockstore) deleteDB(path string) {
|
||||
|
||||
// CollectGarbage compacts and runs garbage collection on the value log;
|
||||
// implements the BlockstoreGC trait
|
||||
func (b *Blockstore) CollectGarbage() error {
|
||||
func (b *Blockstore) CollectGarbage(options map[interface{}]interface{}) error {
|
||||
if err := b.access(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -37,9 +37,21 @@ type BlockstoreIterator interface {
|
||||
|
||||
// BlockstoreGC is a trait for blockstores that support online garbage collection
|
||||
type BlockstoreGC interface {
|
||||
CollectGarbage() error
|
||||
CollectGarbage(options map[interface{}]interface{}) error
|
||||
}
|
||||
|
||||
// garbage collection options
|
||||
type blockstoreMovingGCKey struct{}
|
||||
type blockstoreMovingGCPath struct{}
|
||||
|
||||
// BlockstoreMovingGC is a garbage collection option that instructs the blockstore
|
||||
// to use moving GC if supported.
|
||||
var BlockstoreMovingGC = blockstoreMovingGCKey{}
|
||||
|
||||
// BlockstoreMovingGCPath is a garbage collection option that specifies an optional
|
||||
// target path for moving GC.
|
||||
var BlockstoreMovingGCPath = blockstoreMovingGCPath{}
|
||||
|
||||
// BlockstoreSize is a trait for on-disk blockstores that can report their size
|
||||
type BlockstoreSize interface {
|
||||
Size() (int64, error)
|
||||
|
Loading…
Reference in New Issue
Block a user