Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: impl/prod/raw_datastore.go

Issue 1357343002: Add missing AllocateIDs API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add panic Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/datastore_test.go ('k') | service/datastore/checkfilter.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/prod/raw_datastore.go
diff --git a/impl/prod/raw_datastore.go b/impl/prod/raw_datastore.go
index ce4f1df6fd90b0ec0d16feeeddeeea8ae646c1cc..3a9b1d96c355155c41ff02eb83bcf4bbb663edc1 100644
--- a/impl/prod/raw_datastore.go
+++ b/impl/prod/raw_datastore.go
@@ -46,6 +46,16 @@ func idxCallbacker(err error, amt int, cb func(idx int, err error)) error {
return err
}
+func (d rdsImpl) AllocateIDs(incomplete *ds.Key, n int) (start int64, err error) {
+ par, err := dsF2R(d, incomplete.Parent())
+ if err != nil {
+ return
+ }
+
+ start, _, err = datastore.AllocateIDs(d, incomplete.Last().Kind, par, n)
+ return
+}
+
func (d rdsImpl) DeleteMulti(ks []*ds.Key, cb ds.DeleteMultiCB) error {
keys, err := dsMF2R(d, ks)
if err == nil {
« no previous file with comments | « impl/memory/datastore_test.go ('k') | service/datastore/checkfilter.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698