(shardIdx int)
| 132 | } |
| 133 | |
| 134 | func (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 | |
| 146 | func (m *mapper) writeMapEntriesToFile(cbuf *z.Buffer, shardIdx int) { |
| 147 | defer func() { |
no test coverage detected