MCPcopy Create free account
hub / github.com/uber/aresdb / OpenVectorPartyFileForRead

Method OpenVectorPartyFileForRead

diskstore/local_diskstore.go:302–314  ·  view source on GitHub ↗

OpenVectorPartyFileForRead : Opens the vector party file at the specified batchVersion for read.

(table string, columnID int, shard, batchID int, batchVersion uint32,
	seqNum uint32)

Source from the content-addressed store, hash-verified

300
301// OpenVectorPartyFileForRead : Opens the vector party file at the specified batchVersion for read.
302func (l LocalDiskStore) OpenVectorPartyFileForRead(table string, columnID int, shard, batchID int, batchVersion uint32,
303 seqNum uint32) (io.ReadCloser, error) {
304 batchIDTimeStr := daysSinceEpochToTimeStr(batchID)
305 vectorPartyFilePath := GetPathForTableArchiveBatchColumnFile(l.rootPath, table, shard, batchIDTimeStr, batchVersion,
306 seqNum, columnID)
307 f, err := os.OpenFile(vectorPartyFilePath, os.O_RDONLY, 0644)
308 if os.IsNotExist(err) {
309 return nil, os.ErrNotExist
310 } else if err != nil {
311 return nil, utils.StackError(err, "Failed to open vector party file: %s for read", vectorPartyFilePath)
312 }
313 return f, nil
314}
315
316// OpenVectorPartyFileForWrite : Creates/truncates the vector party file at the specified batchVersion for write.
317func (l LocalDiskStore) OpenVectorPartyFileForWrite(table string, columnID int, shard, batchID int, batchVersion uint32,

Callers

nothing calls this directly

Calls 3

StackErrorFunction · 0.92
daysSinceEpochToTimeStrFunction · 0.85

Tested by

no test coverage detected