Merge branch 'master' into boltdb

This commit is contained in:
Barak Michener 2014-08-23 17:23:16 -04:00
commit e2debf5f04
12 changed files with 288 additions and 216 deletions

View file

@ -51,14 +51,16 @@ func (t *Tagger) Fixed() map[string]Value {
}
func (t *Tagger) CopyFrom(src Iterator) {
for _, tag := range src.Tagger().Tags() {
t.Add(tag)
}
st := src.Tagger()
for k, v := range src.Tagger().Fixed() {
t.AddFixed(k, v)
}
t.tags = append(t.tags, st.tags...)
if t.fixedTags == nil {
t.fixedTags = make(map[string]Value, len(st.fixedTags))
}
for k, v := range st.fixedTags {
t.fixedTags[k] = v
}
}
type Iterator interface {

View file

@ -130,9 +130,9 @@ func (it *Iterator) Clone() graph.Iterator {
func (it *Iterator) Next() bool {
var result struct {
Id string "_id"
Added []int64 "Added"
Deleted []int64 "Deleted"
Id string `bson:"_id"`
Added []int64 `bson:"Added"`
Deleted []int64 `bson:"Deleted"`
}
found := it.iter.Next(&result)
if !found {

View file

@ -121,15 +121,15 @@ func (qs *TripleStore) convertStringToByteHash(s string) string {
}
type MongoNode struct {
Id string "_id"
Name string "Name"
Size int "Size"
Id string `bson:"_id"`
Name string `bson:"Name"`
Size int `bson:"Size"`
}
type MongoLogEntry struct {
LogID int64 "LogID"
Action string "Action"
Key string "Key"
LogID int64 `bson:"LogID"`
Action string `bson:"Action"`
Key string `bson:"Key"`
Timestamp int64
}
@ -175,8 +175,8 @@ func (qs *TripleStore) updateQuad(q quad.Quad, id int64, proc graph.Procedure) e
func (qs *TripleStore) checkValid(key string) bool {
var indexEntry struct {
Added []int64 "Added"
Deleted []int64 "Deleted"
Added []int64 `bson:"Added"`
Deleted []int64 `bson:"Deleted"`
}
err := qs.db.C("quads").FindId(key).One(&indexEntry)
if err == mgo.ErrNotFound {