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

Unified Diff: go/src/infra/gae/libs/gae/memory/raw_datstore.go

Issue 1227183003: Change RawDatastore to do less reflection. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@move_dummy
Patch Set: fix No/ShouldIndex 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
Index: go/src/infra/gae/libs/gae/memory/raw_datstore.go
diff --git a/go/src/infra/gae/libs/gae/memory/raw_datstore.go b/go/src/infra/gae/libs/gae/memory/raw_datstore.go
index 3df8f2d3e9865a9ac39efa659e12f4badb4da96c..67c3b9dcbfa6ff1318b3a0feecb2ca5983c3b27e 100644
--- a/go/src/infra/gae/libs/gae/memory/raw_datstore.go
+++ b/go/src/infra/gae/libs/gae/memory/raw_datstore.go
@@ -60,17 +60,17 @@ func (d *dsImpl) NewKey(kind, stringID string, intID int64, parent gae.DSKey) ga
return helper.NewDSKey(globalAppID, d.ns, kind, stringID, intID, parent)
}
-func (d *dsImpl) Put(key gae.DSKey, src interface{}) (retKey gae.DSKey, err error) {
+func (d *dsImpl) Put(key gae.DSKey, pls gae.DSPropertyLoadSaver) (retKey gae.DSKey, err error) {
err = d.data.RunIfNotBroken(func() (err error) {
- retKey, err = d.data.put(d.ns, key, src)
+ retKey, err = d.data.put(d.ns, key, pls)
return
})
return
}
-func (d *dsImpl) Get(key gae.DSKey, dst interface{}) error {
+func (d *dsImpl) Get(key gae.DSKey, pls gae.DSPropertyLoadSaver) error {
return d.data.RunIfNotBroken(func() error {
- return d.data.get(d.ns, key, dst)
+ return d.data.get(d.ns, key, pls)
})
}
@@ -98,13 +98,13 @@ func (d *dsImpl) NewQuery(kind string) gae.DSQuery {
return &queryImpl{DSQuery: dummy.QY(), ns: d.ns, kind: kind}
}
-func (d *dsImpl) Run(q gae.DSQuery) gae.DSIterator {
+func (d *dsImpl) Run(q gae.DSQuery) gae.RDSIterator {
rq := q.(*queryImpl)
rq = rq.normalize().checkCorrectness(d.ns, false)
return &queryIterImpl{rq}
}
-func (d *dsImpl) GetAll(q gae.DSQuery, dst interface{}) ([]gae.DSKey, error) {
+func (d *dsImpl) GetAll(q gae.DSQuery, dst *[]gae.DSPropertyMap) ([]gae.DSKey, error) {
// TODO(riannucci): assert that dst is a slice of structs
return nil, nil
}
@@ -131,17 +131,17 @@ func (d *txnDsImpl) NewKey(kind, stringID string, intID int64, parent gae.DSKey)
return helper.NewDSKey(globalAppID, d.ns, kind, stringID, intID, parent)
}
-func (d *txnDsImpl) Put(key gae.DSKey, src interface{}) (retKey gae.DSKey, err error) {
+func (d *txnDsImpl) Put(key gae.DSKey, pls gae.DSPropertyLoadSaver) (retKey gae.DSKey, err error) {
err = d.data.RunIfNotBroken(func() (err error) {
- retKey, err = d.data.put(d.ns, key, src)
+ retKey, err = d.data.put(d.ns, key, pls)
return
})
return
}
-func (d *txnDsImpl) Get(key gae.DSKey, dst interface{}) error {
+func (d *txnDsImpl) Get(key gae.DSKey, pls gae.DSPropertyLoadSaver) error {
return d.data.RunIfNotBroken(func() error {
- return d.data.get(d.ns, key, dst)
+ return d.data.get(d.ns, key, pls)
})
}
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/plist_test.go ('k') | go/src/infra/gae/libs/gae/memory/raw_datstore_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698