MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / newMapFile

Method newMapFile

worker/restore_map.go:156–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156func (m *mapper) newMapFile() (*os.File, error) {
157 fileNum := atomic.AddUint32(&m.nextId, 1)
158 filename := filepath.Join(m.mapDir, fmt.Sprintf("%06d.map", fileNum))
159 x.Check(os.MkdirAll(filepath.Dir(filename), 0750))
160
161 return os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
162}
163
164func (m *mapper) writeToDisk(buf *z.Buffer) error {
165 defer func() {

Callers 1

writeToDiskMethod · 0.95

Calls 2

CheckFunction · 0.92
OpenFileMethod · 0.65

Tested by

no test coverage detected