MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / InitOpt

Function InitOpt

db_test.go:214–236  ·  view source on GitHub ↗
(fileDir string, isRemoveFiles bool)

Source from the content-addressed store, hash-verified

212}
213
214func InitOpt(fileDir string, isRemoveFiles bool) {
215 if fileDir == "" {
216 fileDir = "/tmp/nutsdbtest"
217 }
218 if isRemoveFiles {
219 files, _ := os.ReadDir(fileDir)
220 for _, f := range files {
221 name := f.Name()
222 if name != "" {
223 err := os.RemoveAll(fileDir + "/" + name)
224 if err != nil {
225 panic(err)
226 }
227 }
228 }
229 }
230
231 opt = DefaultOptions
232 opt.Dir = fileDir
233 opt.SegmentSize = 8 * 1024
234 opt.CleanFdsCacheThreshold = 0.5
235 opt.MaxFdNumsInCache = 1024
236}
237
238func TestDB_Basic(t *testing.T) {
239 runNutsDBTest(t, nil, func(t *testing.T, db *DB) {

Callers 6

TestWithNodeNumFunction · 0.85
TestWithMaxBatchCountFunction · 0.85
TestWithMaxBatchSizeFunction · 0.85
TestIsDBClosedFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected