MCPcopy
hub / github.com/dgraph-io/dgraph / openOutputFile

Method openOutputFile

dgraph/cmd/bulk/mapper.go:134–144  ·  view source on GitHub ↗
(shardIdx int)

Source from the content-addressed store, hash-verified

132}
133
134func (m *mapper) openOutputFile(shardIdx int) (*os.File, error) {
135 fileNum := atomic.AddUint32(&m.mapFileId, 1)
136 filename := filepath.Join(
137 m.opt.TmpDir,
138 mapShardDir,
139 fmt.Sprintf("%03d", shardIdx),
140 fmt.Sprintf("%06d.map.gz", fileNum),
141 )
142 x.Check(os.MkdirAll(filepath.Dir(filename), 0750))
143 return os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
144}
145
146func (m *mapper) writeMapEntriesToFile(cbuf *z.Buffer, shardIdx int) {
147 defer func() {

Callers 1

writeMapEntriesToFileMethod · 0.95

Calls 2

CheckFunction · 0.92
OpenFileMethod · 0.65

Tested by

no test coverage detected