(dirPath string, fileID uint32, fileSize int64, fioType int8)
| 45 | } |
| 46 | |
| 47 | func newDataFile(dirPath string, fileID uint32, fileSize int64, fioType int8) (*DataFile, error) { |
| 48 | // Initialize the IOManager interface |
| 49 | ioManager, err := fileio.NewIOManager(dirPath, fileSize, fioType) |
| 50 | if err != nil { |
| 51 | return nil, err |
| 52 | } |
| 53 | return &DataFile{ |
| 54 | FileID: fileID, |
| 55 | WriteOff: 0, |
| 56 | IoManager: ioManager, |
| 57 | }, nil |
| 58 | } |
| 59 | |
| 60 | // ReadLogRecord reads a log record from the data file based on the offset. |
| 61 | func (df *DataFile) ReadLogRecord(offset int64) (*LogRecord, int64, error) { |
no test coverage detected