MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / newOptions

Function newOptions

driver/crdt/db.go:88–113  ·  view source on GitHub ↗
(cfg *config.LevelDBConfig)

Source from the content-addressed store, hash-verified

86}
87
88func newOptions(cfg *config.LevelDBConfig) *opt.Options {
89 opts := &opt.Options{}
90 opts.ErrorIfMissing = false
91
92 opts.BlockCacheCapacity = cfg.CacheSize
93
94 //must use bloomfilter
95 opts.Filter = filter.NewBloomFilter(10)
96
97 if !cfg.Compression {
98 opts.Compression = opt.NoCompression
99 } else {
100 opts.Compression = opt.SnappyCompression
101 }
102
103 opts.BlockSize = cfg.BlockSize
104 opts.WriteBuffer = cfg.WriteBufferSize
105 opts.OpenFilesCacheCapacity = cfg.MaxOpenFiles
106
107 // here we use default value, later add config support
108 opts.CompactionTableSize = 32 * 1024 * 1024
109 opts.WriteL0SlowdownTrigger = 16
110 opts.WriteL0PauseTrigger = 64
111
112 return opts
113}
114
115func (s Store) Repair(path string, cfg *config.Config) error {
116 db, err := s.Open(path, cfg)

Callers 1

OpenMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected