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

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: 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
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)
dnj (Google) 2015/09/22 06:36:06 (nit/thought): incomplete.Last().Kind() should pro
iannucci 2015/09/22 16:41:05 Yeah... at the time I thought it was a good idea..
+ return
+}
+
func (d rdsImpl) DeleteMulti(ks []*ds.Key, cb ds.DeleteMultiCB) error {
keys, err := dsMF2R(d, ks)
if err == nil {

Powered by Google App Engine
This is Rietveld 408576698