GetMMapRWManager will return a MMapRWManager Object
(path string, capacity int64, segmentSize int64, readOnly bool)
| 87 | |
| 88 | // GetMMapRWManager will return a MMapRWManager Object |
| 89 | func (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 |
| 104 | func (fm *FileManager) Close() error { |