Rename TSVal

This commit is contained in:
kortschak 2014-07-02 12:13:15 +09:30
parent a1453da84e
commit d87e227ff3
29 changed files with 118 additions and 118 deletions

View file

@ -72,7 +72,7 @@ func (it *AllIterator) Clone() graph.Iterator {
return out
}
func (it *AllIterator) Next() (graph.TSVal, bool) {
func (it *AllIterator) Next() (graph.Value, bool) {
if !it.open {
it.Last = nil
return nil, false
@ -92,7 +92,7 @@ func (it *AllIterator) Next() (graph.TSVal, bool) {
return out, true
}
func (it *AllIterator) Check(v graph.TSVal) bool {
func (it *AllIterator) Check(v graph.Value) bool {
it.Last = v
return true
}

View file

@ -38,7 +38,7 @@ type Iterator struct {
originalPrefix string
}
func NewIterator(prefix string, d graph.Direction, value graph.TSVal, ts *TripleStore) *Iterator {
func NewIterator(prefix string, d graph.Direction, value graph.Value, ts *TripleStore) *Iterator {
var it Iterator
iterator.BaseInit(&it.Base)
it.checkId = value.([]byte)
@ -85,7 +85,7 @@ func (it *Iterator) Close() {
}
}
func (it *Iterator) Next() (graph.TSVal, bool) {
func (it *Iterator) Next() (graph.Value, bool) {
if it.it == nil {
it.Last = nil
return nil, false
@ -166,7 +166,7 @@ func GetPositionFromPrefix(prefix []byte, d graph.Direction, ts *TripleStore) in
panic("unreachable")
}
func (it *Iterator) Check(v graph.TSVal) bool {
func (it *Iterator) Check(v graph.Value) bool {
val := v.([]byte)
if val[0] == 'z' {
return false

View file

@ -420,9 +420,9 @@ func TestOptimize(t *testing.T) {
Convey("With the correct tags", func() {
oldIt.Next()
newIt.Next()
oldResults := make(map[string]graph.TSVal)
oldResults := make(map[string]graph.Value)
oldIt.TagResults(oldResults)
newResults := make(map[string]graph.TSVal)
newResults := make(map[string]graph.Value)
oldIt.TagResults(newResults)
So(newResults, ShouldResemble, oldResults)
})

View file

@ -301,7 +301,7 @@ func (ts *TripleStore) Close() {
ts.open = false
}
func (ts *TripleStore) Triple(k graph.TSVal) *graph.Triple {
func (ts *TripleStore) Triple(k graph.Value) *graph.Triple {
var triple graph.Triple
b, err := ts.db.Get(k.([]byte), ts.readopts)
if err != nil && err != leveldb.ErrNotFound {
@ -328,7 +328,7 @@ func (ts *TripleStore) convertStringToByteHash(s string) []byte {
return key
}
func (ts *TripleStore) ValueOf(s string) graph.TSVal {
func (ts *TripleStore) ValueOf(s string) graph.Value {
return ts.createValueKeyFor(s)
}
@ -352,7 +352,7 @@ func (ts *TripleStore) getValueData(value_key []byte) ValueData {
return out
}
func (ts *TripleStore) NameOf(k graph.TSVal) string {
func (ts *TripleStore) NameOf(k graph.Value) string {
if k == nil {
glog.V(2).Infoln("k was nil")
return ""
@ -360,7 +360,7 @@ func (ts *TripleStore) NameOf(k graph.TSVal) string {
return ts.getValueData(k.([]byte)).Name
}
func (ts *TripleStore) GetSizeFor(k graph.TSVal) int64 {
func (ts *TripleStore) GetSizeFor(k graph.Value) int64 {
if k == nil {
return 0
}
@ -401,7 +401,7 @@ func (ts *TripleStore) GetApproximateSizeForPrefix(pre []byte) (int64, error) {
return 0, nil
}
func (ts *TripleStore) TripleIterator(d graph.Direction, val graph.TSVal) graph.Iterator {
func (ts *TripleStore) TripleIterator(d graph.Direction, val graph.Value) graph.Iterator {
var prefix string
switch d {
case graph.Subject:
@ -426,7 +426,7 @@ func (ts *TripleStore) TriplesAllIterator() graph.Iterator {
return NewAllIterator("po", graph.Predicate, ts)
}
func (ts *TripleStore) TripleDirection(val graph.TSVal, d graph.Direction) graph.TSVal {
func (ts *TripleStore) TripleDirection(val graph.Value, d graph.Direction) graph.Value {
v := val.([]uint8)
offset := GetPositionFromPrefix(v[0:2], d, ts)
if offset != -1 {
@ -436,7 +436,7 @@ func (ts *TripleStore) TripleDirection(val graph.TSVal, d graph.Direction) graph
}
}
func compareBytes(a, b graph.TSVal) bool {
func compareBytes(a, b graph.Value) bool {
return bytes.Equal(a.([]uint8), b.([]uint8))
}