| 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 prod | 5 package prod |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 ds "github.com/luci/gae/service/datastore" | 8 ds "github.com/luci/gae/service/datastore" |
| 9 "github.com/luci/gae/service/info" | 9 "github.com/luci/gae/service/info" |
| 10 "github.com/luci/luci-go/common/errors" | 10 "github.com/luci/luci-go/common/errors" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 return err | 46 return err |
| 47 } | 47 } |
| 48 | 48 |
| 49 func (d rdsImpl) AllocateIDs(incomplete *ds.Key, n int) (start int64, err error)
{ | 49 func (d rdsImpl) AllocateIDs(incomplete *ds.Key, n int) (start int64, err error)
{ |
| 50 par, err := dsF2R(d, incomplete.Parent()) | 50 par, err := dsF2R(d, incomplete.Parent()) |
| 51 if err != nil { | 51 if err != nil { |
| 52 return | 52 return |
| 53 } | 53 } |
| 54 | 54 |
| 55 » start, _, err = datastore.AllocateIDs(d, incomplete.Last().Kind, par, n) | 55 » start, _, err = datastore.AllocateIDs(d, incomplete.Kind(), par, n) |
| 56 return | 56 return |
| 57 } | 57 } |
| 58 | 58 |
| 59 func (d rdsImpl) DeleteMulti(ks []*ds.Key, cb ds.DeleteMultiCB) error { | 59 func (d rdsImpl) DeleteMulti(ks []*ds.Key, cb ds.DeleteMultiCB) error { |
| 60 keys, err := dsMF2R(d, ks) | 60 keys, err := dsMF2R(d, ks) |
| 61 if err == nil { | 61 if err == nil { |
| 62 err = datastore.DeleteMulti(d, keys) | 62 err = datastore.DeleteMulti(d, keys) |
| 63 } | 63 } |
| 64 return idxCallbacker(err, len(ks), func(_ int, err error) { | 64 return idxCallbacker(err, len(ks), func(_ int, err error) { |
| 65 cb(err) | 65 cb(err) |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 | 209 |
| 210 func (d rdsImpl) RunInTransaction(f func(c context.Context) error, opts *ds.Tran
sactionOptions) error { | 210 func (d rdsImpl) RunInTransaction(f func(c context.Context) error, opts *ds.Tran
sactionOptions) error { |
| 211 ropts := (*datastore.TransactionOptions)(opts) | 211 ropts := (*datastore.TransactionOptions)(opts) |
| 212 return datastore.RunInTransaction(d, f, ropts) | 212 return datastore.RunInTransaction(d, f, ropts) |
| 213 } | 213 } |
| 214 | 214 |
| 215 func (d rdsImpl) Testable() ds.Testable { | 215 func (d rdsImpl) Testable() ds.Testable { |
| 216 return nil | 216 return nil |
| 217 } | 217 } |
| OLD | NEW |