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

Method setActiveFile

db.go:494–504  ·  view source on GitHub ↗

setActiveFile sets the ActiveFile (DataFile object).

()

Source from the content-addressed store, hash-verified

492
493// setActiveFile sets the ActiveFile (DataFile object).
494func (db *DB) setActiveFile() (err error) {
495 activeFilePath := getDataPath(db.MaxFileID, db.opt.Dir)
496 db.ActiveFile, err = db.fm.GetDataFile(activeFilePath, db.opt.SegmentSize)
497 if err != nil {
498 return
499 }
500
501 db.ActiveFile.fileID = db.MaxFileID
502
503 return nil
504}
505
506// getMaxFileIDAndFileIds returns max fileId and fileIds.
507func (db *DB) getMaxFileIDAndFileIDs() (maxFileID int64, dataFileIds []int64) {

Callers 1

buildIndexesMethod · 0.95

Calls 2

getDataPathFunction · 0.85
GetDataFileMethod · 0.80

Tested by

no test coverage detected