OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package txnBuf | 5 package txnBuf |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "fmt" | 9 "fmt" |
10 "math/rand" | 10 "math/rand" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 for i := range hugeData { | 125 for i := range hugeData { |
126 hugeData[i] = &Foo{ID: int64(i + 1), ValueNI: hugeField} | 126 hugeData[i] = &Foo{ID: int64(i + 1), ValueNI: hugeField} |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 func mkds(data []*Foo) (under, over *count.DSCounter, ds datastore.Interface) { | 130 func mkds(data []*Foo) (under, over *count.DSCounter, ds datastore.Interface) { |
131 c := memory.UseWithAppID(context.Background(), "something~else") | 131 c := memory.UseWithAppID(context.Background(), "something~else") |
132 ds = datastore.Get(c) | 132 ds = datastore.Get(c) |
133 » _, err := ds.AllocateIDs(ds.KeyForObj(data[0]), 100) | 133 |
| 134 » dataKey := ds.KeyForObj(data[0]) |
| 135 » _, err := ds.AllocateIDs(ds.NewIncompleteKeys(100, dataKey.Kind(), dataK
ey.Parent())...) |
134 if err != nil { | 136 if err != nil { |
135 panic(err) | 137 panic(err) |
136 } | 138 } |
137 if err := ds.PutMulti(data); err != nil { | 139 if err := ds.PutMulti(data); err != nil { |
138 panic(err) | 140 panic(err) |
139 } | 141 } |
140 | 142 |
141 c, under = count.FilterRDS(c) | 143 c, under = count.FilterRDS(c) |
142 c = FilterRDS(c) | 144 c = FilterRDS(c) |
143 c, over = count.FilterRDS(c) | 145 c, over = count.FilterRDS(c) |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 val := pm["Value"] | 903 val := pm["Value"] |
902 So(val[len(val)-1].Value(), ShouldResemb
le, "wat") | 904 So(val[len(val)-1].Value(), ShouldResemb
le, "wat") |
903 }), ShouldBeNil) | 905 }), ShouldBeNil) |
904 }) | 906 }) |
905 | 907 |
906 }) | 908 }) |
907 | 909 |
908 }) | 910 }) |
909 | 911 |
910 } | 912 } |
OLD | NEW |