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

Method AddToCache

internal/fileio/fd_manager.go:108–117  ·  view source on GitHub ↗

addToCache add fd to cache

(fd *os.File, cleanPath string)

Source from the content-addressed store, hash-verified

106
107// addToCache add fd to cache
108func (fdm *FdManager) AddToCache(fd *os.File, cleanPath string) {
109 fdInfo := &FdInfo{
110 fd: fd,
111 using: 1,
112 path: cleanPath,
113 }
114 fdm.fdList.addNode(fdInfo)
115 fdm.size++
116 fdm.Cache[cleanPath] = fdInfo
117}
118
119// reduceUsing when RWManager object close, it will go through this method let fdm know it return the fd to cache
120func (fdm *FdManager) ReduceUsing(path string) {

Callers 1

GetFdMethod · 0.95

Calls 1

addNodeMethod · 0.80

Tested by

no test coverage detected