MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / newDataFile

Function newDataFile

engine/data/data_file.go:47–58  ·  view source on GitHub ↗
(dirPath string, fileID uint32, fileSize int64, fioType int8)

Source from the content-addressed store, hash-verified

45}
46
47func 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.
61func (df *DataFile) ReadLogRecord(offset int64) (*LogRecord, int64, error) {

Callers 3

OpenDataFileFunction · 0.85
OpenHintFileFunction · 0.85
OpenMergeFinaFileFunction · 0.85

Calls 1

NewIOManagerFunction · 0.92

Tested by

no test coverage detected