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

Unified Diff: impl/memory/raw_datastore_data.go

Issue 1259593005: Add 'user friendly' datastore API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: more docs Created 5 years, 4 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/raw_datastore.go ('k') | impl/memory/raw_datastore_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/raw_datastore_data.go
diff --git a/impl/memory/raw_datastore_data.go b/impl/memory/raw_datastore_data.go
index fcda94147a47878ed034d0e1e0481b214fc0d9e8..a37a2abf63392795438f4207e43e487fb0fa8025 100644
--- a/impl/memory/raw_datastore_data.go
+++ b/impl/memory/raw_datastore_data.go
@@ -107,10 +107,10 @@ func (d *dataStoreData) entsKeyLocked(key ds.Key) (*memCollection, ds.Key) {
return ents, key
}
-func (d *dataStoreData) putMulti(keys []ds.Key, vals []ds.PropertyLoadSaver, cb ds.PutMultiCB) {
+func (d *dataStoreData) putMulti(keys []ds.Key, vals []ds.PropertyMap, cb ds.PutMultiCB) {
for i, k := range keys {
buf := &bytes.Buffer{}
- pmap := vals[i].(ds.PropertyMap)
+ pmap, _ := vals[i].Save(false)
pmap.Write(buf, ds.WithoutContext)
dataBytes := buf.Bytes()
@@ -246,7 +246,7 @@ func (d *dataStoreData) applyTxn(c context.Context, obj memContextObj) {
d.delMulti([]ds.Key{k},
func(e error) { err = e })
} else {
- d.putMulti([]ds.Key{m.key}, []ds.PropertyLoadSaver{m.data},
+ d.putMulti([]ds.Key{m.key}, []ds.PropertyMap{m.data},
func(_ ds.Key, e error) { err = e })
}
err = errors.SingleError(err)
@@ -359,14 +359,14 @@ func (td *txnDataStoreData) writeMutation(getOnly bool, key ds.Key, data ds.Prop
return nil
}
-func (td *txnDataStoreData) putMulti(keys []ds.Key, vals []ds.PropertyLoadSaver, cb ds.PutMultiCB) {
+func (td *txnDataStoreData) putMulti(keys []ds.Key, vals []ds.PropertyMap, cb ds.PutMultiCB) {
for i, k := range keys {
func() {
td.parent.Lock()
defer td.parent.Unlock()
_, k = td.parent.entsKeyLocked(k)
}()
- err := td.writeMutation(false, k, vals[i].(ds.PropertyMap))
+ err := td.writeMutation(false, k, vals[i])
if cb != nil {
cb(k, err)
}
« no previous file with comments | « impl/memory/raw_datastore.go ('k') | impl/memory/raw_datastore_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698