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

Method GetMMapRWManager

file_manager.go:89–101  ·  view source on GitHub ↗

GetMMapRWManager will return a MMapRWManager Object

(path string, capacity int64, segmentSize int64, readOnly bool)

Source from the content-addressed store, hash-verified

87
88// GetMMapRWManager will return a MMapRWManager Object
89func (fm *FileManager) GetMMapRWManager(path string, capacity int64, segmentSize int64, readOnly bool) (*fileio.MMapRWManager, error) {
90 fd, err := fm.fdm.GetFd(path)
91 if err != nil {
92 return nil, err
93 }
94
95 err = fileio.Truncate(path, capacity, fd, readOnly)
96 if err != nil {
97 return nil, err
98 }
99
100 return fileio.GetMMapRWManager(fd, path, fm.fdm, segmentSize), nil
101}
102
103// Close will Close fdm resource
104func (fm *FileManager) Close() error {

Callers 2

getDataFileWithModeMethod · 0.95

Calls 3

TruncateFunction · 0.92
GetMMapRWManagerFunction · 0.92
GetFdMethod · 0.80

Tested by 1