Skip to content

Commit 1348296

Browse files
ShivaShiva
authored andcommitted
add support for vector indexing in bulk loader
1 parent 5c15367 commit 1348296

File tree

8 files changed

+1769
-23
lines changed

8 files changed

+1769
-23
lines changed

dgraph/cmd/bulk/loader.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type state struct {
8989
mapFileId uint32 // Used atomically to name the output files of the mappers.
9090
dbs []*badger.DB
9191
tmpDbs []*badger.DB // Temporary DB to write the split lists to avoid ordering issues.
92+
vectorTmpDb *badger.DB // Shared temporary DB for vector data and HNSW index building.
9293
writeTs uint64 // All badger writes use this timestamp
9394
namespaces *sync.Map // To store the encountered namespaces.
9495
}
@@ -531,5 +532,10 @@ func (ld *loader) cleanup() {
531532
x.Check(db.Close())
532533
x.Check(os.RemoveAll(opts.Dir))
533534
}
535+
if ld.vectorTmpDb != nil {
536+
opts := ld.vectorTmpDb.Opts()
537+
x.Check(ld.vectorTmpDb.Close())
538+
x.Check(os.RemoveAll(opts.Dir))
539+
}
534540
ld.prog.endSummary()
535541
}

0 commit comments

Comments
 (0)