MCPcopy Index your code
hub / github.com/ByteStorage/FlyDB / setActiveDataFile

Method setActiveDataFile

engine/db.go:233–247  ·  view source on GitHub ↗

Set the current active file Hold a mutex before accessing this method

()

Source from the content-addressed store, hash-verified

231// Set the current active file
232// Hold a mutex before accessing this method
233func (db *DB) setActiveDataFile() error {
234 var initialFileID uint32 = 0
235 if db.activeFile != nil {
236 initialFileID = db.activeFile.FileID + 1
237 }
238
239 // Open a new data file
240 dataFile, err := data2.OpenDataFile(db.options.DirPath, initialFileID,
241 db.options.DataFileSize, db.options.FIOType)
242 if err != nil {
243 return err
244 }
245 db.activeFile = dataFile
246 return nil
247}
248
249// Get Read data according to the key
250func (db *DB) Get(key []byte) ([]byte, error) {

Callers 2

MergeMethod · 0.95
appendLogRecordMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected