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

Function downloadLDBCFiles

t/t.go:1291–1319  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

1289}
1290
1291func downloadLDBCFiles(dir string) {
1292 if !*downloadResources {
1293 fmt.Print("Skipping downloading of resources\n")
1294 return
1295 }
1296
1297 for _, name := range rdfFileNames {
1298 ldbcDataFiles[name] = baseUrl + name + suffix
1299 }
1300
1301 start := time.Now()
1302 var wg sync.WaitGroup
1303 for fname, link := range ldbcDataFiles {
1304 wg.Add(1)
1305 go func(fname, link string, wg *sync.WaitGroup) {
1306 defer wg.Done()
1307 start := time.Now()
1308 cmd := exec.Command("wget", "-O", fname, link)
1309 cmd.Dir = dir
1310 if out, err := cmd.CombinedOutput(); err != nil {
1311 fmt.Printf("Error %v\n", err)
1312 panic(fmt.Sprintf("error downloading a file: %s", string(out)))
1313 }
1314 fmt.Printf("Downloaded %s to %s in %s \n", fname, dir, time.Since(start))
1315 }(fname, link, &wg)
1316 }
1317 wg.Wait()
1318 fmt.Printf("Downloaded %d files in %s \n", len(ldbcDataFiles), time.Since(start))
1319}
1320
1321func createTestCoverageFile(path string) error {
1322 outFile, err := os.Create(path)

Callers 1

runFunction · 0.85

Calls 4

WaitMethod · 0.80
PrintMethod · 0.45
AddMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…