示例#1
0
func (qs *QuadStore) Horizon() graph.PrimaryKey {
	var horizon int64
	err := qs.db.QueryRow("SELECT horizon FROM quads ORDER BY horizon DESC LIMIT 1;").Scan(&horizon)
	if err != nil {
		glog.Errorf("Couldn't execute horizon: %v", err)
		return graph.NewSequentialKey(0)
	}
	return graph.NewSequentialKey(horizon)
}
示例#2
0
func (qs *QuadStore) Horizon() graph.PrimaryKey {
	var log MongoLogEntry
	err := qs.db.C("log").Find(nil).Sort("-LogID").One(&log)
	if err != nil {
		if err == mgo.ErrNotFound {
			return graph.NewSequentialKey(0)
		}
		glog.Errorf("Could not get Horizon from Mongo: %v", err)
	}
	return graph.NewSequentialKey(log.LogID)
}
示例#3
0
func (qs *store) Horizon() graph.PrimaryKey { return graph.NewSequentialKey(0) }
示例#4
0
文件: quadstore.go 项目: e4x/cayley
func (qs *QuadStore) Horizon() graph.PrimaryKey {
	return graph.NewSequentialKey(qs.log[len(qs.log)-1].ID)
}
示例#5
0
func (qs *QuadStore) Horizon() graph.PrimaryKey {
	return graph.NewSequentialKey(qs.horizon)
}
示例#6
0
func (qs *QuadStore) Horizon() graph.PrimaryKey {
	qs.logmu.RLock()
	id := qs.log[len(qs.log)-1].ID
	qs.logmu.RUnlock()
	return graph.NewSequentialKey(id)
}