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

Unified Diff: filter/count/rds.go

Issue 1253263002: Make rawdatastore API safer for writing filters. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix comments Created 5 years, 5 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 | « filter/count/gi.go ('k') | filter/featureBreaker/featurebreaker_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/count/rds.go
diff --git a/filter/count/rds.go b/filter/count/rds.go
index b28e49d7ba3106e64ed7d1c10ce4b321d700e26d..cff7b0b6b458c179f1b42fad9c9c9a68c0a86544 100644
--- a/filter/count/rds.go
+++ b/filter/count/rds.go
@@ -15,13 +15,8 @@ type RDSCounter struct {
NewKey Entry
DecodeKey Entry
NewQuery Entry
- Count Entry
RunInTransaction Entry
Run Entry
- GetAll Entry
- Put Entry
- Get Entry
- Delete Entry
DeleteMulti Entry
GetMulti Entry
PutMulti Entry
@@ -50,49 +45,24 @@ func (r *rdsCounter) NewQuery(kind string) rds.Query {
return r.rds.NewQuery(kind)
}
-func (r *rdsCounter) Run(q rds.Query) rds.Iterator {
- r.c.Run.up()
- return r.rds.Run(q)
-}
-
-func (r *rdsCounter) GetAll(q rds.Query, dst *[]rds.PropertyMap) ([]rds.Key, error) {
- ret, err := r.rds.GetAll(q, dst)
- return ret, r.c.GetAll.up(err)
-}
-
-func (r *rdsCounter) Count(q rds.Query) (int, error) {
- ret, err := r.rds.Count(q)
- return ret, r.c.Count.up(err)
+func (r *rdsCounter) Run(q rds.Query, cb rds.RunCB) error {
+ return r.c.Run.up(r.rds.Run(q, cb))
}
func (r *rdsCounter) RunInTransaction(f func(context.Context) error, opts *rds.TransactionOptions) error {
return r.c.RunInTransaction.up(r.rds.RunInTransaction(f, opts))
}
-func (r *rdsCounter) Put(key rds.Key, src rds.PropertyLoadSaver) (rds.Key, error) {
- ret, err := r.rds.Put(key, src)
- return ret, r.c.Put.up(err)
-}
-
-func (r *rdsCounter) Get(key rds.Key, dst rds.PropertyLoadSaver) error {
- return r.c.Get.up(r.rds.Get(key, dst))
-}
-
-func (r *rdsCounter) Delete(key rds.Key) error {
- return r.c.Delete.up(r.rds.Delete(key))
-}
-
-func (r *rdsCounter) DeleteMulti(keys []rds.Key) error {
- return r.c.DeleteMulti.up(r.rds.DeleteMulti(keys))
+func (r *rdsCounter) DeleteMulti(keys []rds.Key, cb rds.DeleteMultiCB) error {
+ return r.c.DeleteMulti.up(r.rds.DeleteMulti(keys, cb))
}
-func (r *rdsCounter) GetMulti(keys []rds.Key, dst []rds.PropertyLoadSaver) error {
- return r.c.GetMulti.up(r.rds.GetMulti(keys, dst))
+func (r *rdsCounter) GetMulti(keys []rds.Key, cb rds.GetMultiCB) error {
+ return r.c.GetMulti.up(r.rds.GetMulti(keys, cb))
}
-func (r *rdsCounter) PutMulti(keys []rds.Key, src []rds.PropertyLoadSaver) ([]rds.Key, error) {
- ret, err := r.rds.PutMulti(keys, src)
- return ret, r.c.PutMulti.up(err)
+func (r *rdsCounter) PutMulti(keys []rds.Key, vals []rds.PropertyLoadSaver, cb rds.PutMultiCB) error {
+ return r.c.PutMulti.up(r.rds.PutMulti(keys, vals, cb))
}
// FilterRDS installs a counter RawDatastore filter in the context.
« no previous file with comments | « filter/count/gi.go ('k') | filter/featureBreaker/featurebreaker_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698