Skip to content

Commit

Permalink
config: add config option for bloom filter
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Jul 15, 2016
1 parent 6912f47 commit 1fa8597
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
var err error
bs := bstore.NewBlockstore(n.Repo.Datastore())
opts := bstore.DefaultCacheOpts()
opts.HasBloomFilterSize = n.Repo.Config().Datastore.BloomFilterSize
if !cfg.Permament {
opts.HasBloomFilterSize = 0
}
Expand Down
7 changes: 4 additions & 3 deletions repo/config/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ type Datastore struct {
StorageGCWatermark int64 // in percentage to multiply on StorageMax
GCPeriod string // in ns, us, ms, s, m, h

Params *json.RawMessage
NoSync bool
HashOnRead bool
Params *json.RawMessage
NoSync bool
HashOnRead bool
BloomFilterSize int
}

func (d *Datastore) ParamData() []byte {
Expand Down
1 change: 1 addition & 0 deletions repo/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func datastoreConfig() (Datastore, error) {
StorageGCWatermark: 90, // 90%
GCPeriod: "1h",
HashOnRead: false,
BloomFilterSize: 0,
}, nil
}

Expand Down

0 comments on commit 1fa8597

Please sign in to comment.