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

Side by Side Diff: filter/dscache/ds.go

Issue 2007123002: datastore: Update AllocateIDs to take keys. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Rebase, comments. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « filter/count/rds.go ('k') | filter/dscache/ds_txn.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package dscache 5 package dscache
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 ds "github.com/luci/gae/service/datastore" 10 ds "github.com/luci/gae/service/datastore"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 var _ ds.RawInterface = (*dsCache)(nil) 23 var _ ds.RawInterface = (*dsCache)(nil)
24 24
25 func (d *dsCache) DeleteMulti(keys []*ds.Key, cb ds.DeleteMultiCB) error { 25 func (d *dsCache) DeleteMulti(keys []*ds.Key, cb ds.DeleteMultiCB) error {
26 return d.mutation(keys, func() error { 26 return d.mutation(keys, func() error {
27 return d.RawInterface.DeleteMulti(keys, cb) 27 return d.RawInterface.DeleteMulti(keys, cb)
28 }) 28 })
29 } 29 }
30 30
31 func (d *dsCache) PutMulti(keys []*ds.Key, vals []ds.PropertyMap, cb ds.PutMulti CB) error { 31 func (d *dsCache) PutMulti(keys []*ds.Key, vals []ds.PropertyMap, cb ds.NewKeyCB ) error {
32 return d.mutation(keys, func() error { 32 return d.mutation(keys, func() error {
33 return d.RawInterface.PutMulti(keys, vals, cb) 33 return d.RawInterface.PutMulti(keys, vals, cb)
34 }) 34 })
35 } 35 }
36 36
37 func (d *dsCache) GetMulti(keys []*ds.Key, metas ds.MultiMetaGetter, cb ds.GetMu ltiCB) error { 37 func (d *dsCache) GetMulti(keys []*ds.Key, metas ds.MultiMetaGetter, cb ds.GetMu ltiCB) error {
38 lockItems, nonce := d.mkRandLockItems(keys, metas) 38 lockItems, nonce := d.mkRandLockItems(keys, metas)
39 if len(lockItems) == 0 { 39 if len(lockItems) == 0 {
40 return d.RawInterface.GetMulti(keys, metas, cb) 40 return d.RawInterface.GetMulti(keys, metas, cb)
41 } 41 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if err == nil { 135 if err == nil {
136 err = txnState.apply(d.supportContext) 136 err = txnState.apply(d.supportContext)
137 } 137 }
138 return err 138 return err
139 }, opts) 139 }, opts)
140 if err == nil { 140 if err == nil {
141 txnState.release(d.supportContext) 141 txnState.release(d.supportContext)
142 } 142 }
143 return err 143 return err
144 } 144 }
OLDNEW
« no previous file with comments | « filter/count/rds.go ('k') | filter/dscache/ds_txn.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698