add configuration for splitstore and default to a simple compaction algorithm
This commit is contained in:
+4
-4
@@ -610,10 +610,10 @@ func Repo(r repo.Repo) Option {
|
||||
Override(new(dtypes.MetadataDS), modules.Datastore),
|
||||
Override(new(dtypes.UniversalBlockstore), modules.UniversalBlockstore),
|
||||
|
||||
If(cfg.Splitstore,
|
||||
If(cfg.UseLMDBHotstore,
|
||||
If(cfg.EnableSplitstore,
|
||||
If(cfg.Splitstore.UseLMDBHotstore,
|
||||
Override(new(dtypes.HotBlockstore), modules.LMDBHotBlockstore)),
|
||||
If(!cfg.UseLMDBHotstore,
|
||||
If(!cfg.Splitstore.UseLMDBHotstore,
|
||||
Override(new(dtypes.HotBlockstore), modules.BadgerHotBlockstore)),
|
||||
Override(new(dtypes.SplitBlockstore), modules.SplitBlockstore(cfg)),
|
||||
Override(new(dtypes.ChainBlockstore), modules.ChainSplitBlockstore),
|
||||
@@ -621,7 +621,7 @@ func Repo(r repo.Repo) Option {
|
||||
Override(new(dtypes.BaseBlockstore), From(new(dtypes.SplitBlockstore))),
|
||||
Override(new(dtypes.ExposedBlockstore), From(new(dtypes.SplitBlockstore))),
|
||||
),
|
||||
If(!cfg.Splitstore,
|
||||
If(!cfg.EnableSplitstore,
|
||||
Override(new(dtypes.ChainBlockstore), modules.ChainFlatBlockstore),
|
||||
Override(new(dtypes.StateBlockstore), modules.StateFlatBlockstore),
|
||||
Override(new(dtypes.BaseBlockstore), From(new(dtypes.UniversalBlockstore))),
|
||||
|
||||
+10
-3
@@ -121,9 +121,16 @@ type Pubsub struct {
|
||||
}
|
||||
|
||||
type Blockstore struct {
|
||||
Splitstore bool
|
||||
UseLMDBHotstore bool
|
||||
UseLMDBTracking bool
|
||||
EnableSplitstore bool
|
||||
Splitstore Splitstore
|
||||
}
|
||||
|
||||
type Splitstore struct {
|
||||
UseLMDBHotstore bool
|
||||
UseLMDBTracking bool
|
||||
EnableFullCompaction bool
|
||||
EnableGC bool // EXPERIMENTAL
|
||||
Archival bool
|
||||
}
|
||||
|
||||
// // Full Node
|
||||
|
||||
@@ -103,7 +103,13 @@ func SplitBlockstore(cfg *config.Blockstore) func(lc fx.Lifecycle, r repo.Locked
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ss, err := splitstore.NewSplitStore(path, ds, cold, hot, cfg.UseLMDBTracking)
|
||||
ss, err := splitstore.NewSplitStore(path, ds, cold, hot,
|
||||
&splitstore.Config{
|
||||
UseLMDB: cfg.Splitstore.UseLMDBTracking,
|
||||
EnableFullCompaction: cfg.Splitstore.EnableFullCompaction,
|
||||
EnableGC: cfg.Splitstore.EnableGC,
|
||||
Archival: cfg.Splitstore.Archival,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user