forked from cayleygraph/cayley
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update names per discussion at cayleygraph#38
- Loading branch information
Showing
5 changed files
with
37 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,20 +24,19 @@ import ( | |
"github.com/google/cayley/nquads" | ||
) | ||
|
||
type bulkLoadable interface { | ||
// BulkLoad loads Triples from a channel in bulk to the TripleStore. It | ||
// returns false if bulk loading is not possible (i.e. if you cannot load | ||
// in bulk to a non-empty database, and the current database is non-empty) | ||
BulkLoad(chan *graph.Triple) bool | ||
} | ||
|
||
func Load(ts graph.TripleStore, cfg *config.Config, triplePath string) { | ||
tChan := make(chan *graph.Triple) | ||
go ReadTriplesFromFile(tChan, triplePath) | ||
|
||
bulker, canBulk := ts.(bulkLoadable) | ||
if canBulk && bulker.BulkLoad(tChan) { | ||
return | ||
bulker, canBulk := ts.(graph.BulkLoader) | ||
if canBulk { | ||
err := bulker.BulkLoad(tChan) | ||
if err == nil { | ||
return | ||
} | ||
if err != graph.ErrCannotBulkLoad { | ||
glog.Errorln("Error attempting to bulk load: ", err) | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pbnjay
Author
Owner
|
||
} | ||
|
||
LoadTriplesInto(tChan, ts, cfg.LoadSize) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Follow this with a return and delete the == nil conditional.