@@ -102,28 +102,28 @@ func TestHead_ReadWAL(t *testing.T) {
102102 for _ , compress := range []bool {false , true } {
103103 t .Run (fmt .Sprintf ("compress=%t" , compress ), func (t * testing.T ) {
104104 entries := []interface {}{
105- []RefSeries {
105+ []record. RefSeries {
106106 {Ref : 10 , Labels : labels .FromStrings ("a" , "1" )},
107107 {Ref : 11 , Labels : labels .FromStrings ("a" , "2" )},
108108 {Ref : 100 , Labels : labels .FromStrings ("a" , "3" )},
109109 },
110- []RefSample {
110+ []record. RefSample {
111111 {Ref : 0 , T : 99 , V : 1 },
112112 {Ref : 10 , T : 100 , V : 2 },
113113 {Ref : 100 , T : 100 , V : 3 },
114114 },
115- []RefSeries {
115+ []record. RefSeries {
116116 {Ref : 50 , Labels : labels .FromStrings ("a" , "4" )},
117117 // This series has two refs pointing to it.
118118 {Ref : 101 , Labels : labels .FromStrings ("a" , "3" )},
119119 },
120- []RefSample {
120+ []record. RefSample {
121121 {Ref : 10 , T : 101 , V : 5 },
122122 {Ref : 50 , T : 101 , V : 6 },
123123 {Ref : 101 , T : 101 , V : 7 },
124124 },
125- []Stone {
126- {ref : 0 , intervals : []Interval {{Mint : 99 , Maxt : 101 }}},
125+ []tombstones. Stone {
126+ {Ref : 0 , Intervals : []tombstones. Interval {{Mint : 99 , Maxt : 101 }}},
127127 },
128128 }
129129 dir , err := ioutil .TempDir ("" , "test_read_wal" )
@@ -148,10 +148,10 @@ func TestHead_ReadWAL(t *testing.T) {
148148 s50 := head .series .getByID (50 )
149149 s100 := head .series .getByID (100 )
150150
151- testutil .Equals (t , labels .FromStrings ("a" , "1" ), s10 .lset )
152- testutil .Equals (t , (* memSeries )(nil ), s11 ) // Series without samples should be garbage colected at head.Init().
153- testutil .Equals (t , labels .FromStrings ("a" , "4" ), s50 .lset )
154- testutil .Equals (t , labels .FromStrings ("a" , "3" ), s100 .lset )
151+ testutil .Equals (t , labels .FromStrings ("a" , "1" ), s10 .Lset )
152+ testutil .Equals (t , (* record . MemSeries )(nil ), s11 ) // Series without samples should be garbage colected at head.Init().
153+ testutil .Equals (t , labels .FromStrings ("a" , "4" ), s50 .Lset )
154+ testutil .Equals (t , labels .FromStrings ("a" , "3" ), s100 .Lset )
155155
156156 expandChunk := func (c chunkenc.Iterator ) (x []sample ) {
157157 for c .Next () {
@@ -161,9 +161,9 @@ func TestHead_ReadWAL(t *testing.T) {
161161 testutil .Ok (t , c .Err ())
162162 return x
163163 }
164- testutil .Equals (t , []sample {{100 , 2 }, {101 , 5 }}, expandChunk (s10 .iterator (0 )))
165- testutil .Equals (t , []sample {{101 , 6 }}, expandChunk (s50 .iterator (0 )))
166- testutil .Equals (t , []sample {{100 , 3 }, {101 , 7 }}, expandChunk (s100 .iterator (0 )))
164+ testutil .Equals (t , []sample {{100 , 2 }, {101 , 5 }}, expandChunk (s10 .Iterator (0 )))
165+ testutil .Equals (t , []sample {{101 , 6 }}, expandChunk (s50 .Iterator (0 )))
166+ testutil .Equals (t , []sample {{100 , 3 }, {101 , 7 }}, expandChunk (s100 .Iterator (0 )))
167167 })
168168 }
169169}
@@ -328,14 +328,14 @@ func TestHeadDeleteSeriesWithoutSamples(t *testing.T) {
328328 for _ , compress := range []bool {false , true } {
329329 t .Run (fmt .Sprintf ("compress=%t" , compress ), func (t * testing.T ) {
330330 entries := []interface {}{
331- []RefSeries {
331+ []record. RefSeries {
332332 {Ref : 10 , Labels : labels .FromStrings ("a" , "1" )},
333333 },
334- []RefSample {},
335- []RefSeries {
334+ []record. RefSample {},
335+ []record. RefSeries {
336336 {Ref : 50 , Labels : labels .FromStrings ("a" , "2" )},
337337 },
338- []RefSample {
338+ []record. RefSample {
339339 {Ref : 50 , T : 80 , V : 1 },
340340 {Ref : 50 , T : 90 , V : 1 },
341341 },
@@ -1056,17 +1056,17 @@ func TestHead_LogRollback(t *testing.T) {
10561056
10571057 testutil .Equals (t , 1 , len (recs ))
10581058
1059- series , ok := recs [0 ].([]RefSeries )
1059+ series , ok := recs [0 ].([]record. RefSeries )
10601060 testutil .Assert (t , ok , "expected series record but got %+v" , recs [0 ])
1061- testutil .Equals (t , []RefSeries {{Ref : 1 , Labels : labels .FromStrings ("a" , "b" )}}, series )
1061+ testutil .Equals (t , []record. RefSeries {{Ref : 1 , Labels : labels .FromStrings ("a" , "b" )}}, series )
10621062 })
10631063 }
10641064}
10651065
10661066// TestWalRepair_DecodingError ensures that a repair is run for an error
10671067// when decoding a record.
10681068func TestWalRepair_DecodingError (t * testing.T ) {
1069- var enc RecordEncoder
1069+ var enc record. RecordEncoder
10701070 for name , test := range map [string ]struct {
10711071 corrFunc func (rec []byte ) []byte // Func that applies the corruption to a record.
10721072 rec []byte
@@ -1078,7 +1078,7 @@ func TestWalRepair_DecodingError(t *testing.T) {
10781078 // Do not modify the base record because it is Logged multiple times.
10791079 res := make ([]byte , len (rec ))
10801080 copy (res , rec )
1081- res [0 ] = byte (RecordInvalid )
1081+ res [0 ] = byte (record . RecordInvalid )
10821082 return res
10831083 },
10841084 enc .Series ([]record.RefSeries {{Ref : 1 , Labels : labels .FromStrings ("a" , "b" )}}, []byte {}),
0 commit comments