Gets the id of the file that did not participate in the merge recently
(dirPath string)
| 244 | |
| 245 | // Gets the id of the file that did not participate in the merge recently |
| 246 | func (db *DB) getRecentlyNonMergeFileId(dirPath string) (uint32, error) { |
| 247 | mergeFinaFile, err := data2.OpenMergeFinaFile(dirPath, db.options.DataFileSize, db.options.FIOType) |
| 248 | if err != nil { |
| 249 | return 0, err |
| 250 | } |
| 251 | |
| 252 | // Read the log record at offset 0 from mergeFinaFile |
| 253 | record, _, err := mergeFinaFile.ReadLogRecord(0) |
| 254 | if err != nil { |
| 255 | return 0, err |
| 256 | } |
| 257 | |
| 258 | // Convert the value of the log record to an integer |
| 259 | nonMergeFileID, err := strconv.Atoi(string(record.Value)) |
| 260 | if err != nil { |
| 261 | return 0, err |
| 262 | } |
| 263 | |
| 264 | return uint32(nonMergeFileID), nil |
| 265 | |
| 266 | } |
| 267 | |
| 268 | // Load the index from the hint file |
| 269 | func (db *DB) loadIndexFromHintFile() error { |
no test coverage detected