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

Unified Diff: filter/dscache/ds_txn.go

Issue 1269113005: A transparent cache for datastore, backed by memcache. (Closed) Base URL: https://github.com/luci/gae.git@add_meta
Patch Set: 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
Index: filter/dscache/ds_txn.go
diff --git a/filter/dscache/ds_txn.go b/filter/dscache/ds_txn.go
new file mode 100644
index 0000000000000000000000000000000000000000..663fc4fe345579e6768689447eecedcf261f48bb
--- /dev/null
+++ b/filter/dscache/ds_txn.go
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package dscache
+
+import (
+ ds "github.com/luci/gae/service/datastore"
+ "github.com/luci/gae/service/memcache"
+)
+
+type dsTxnCache struct {
+ ds.RawInterface
+
+ state *dsTxnState
+ mc memcache.Interface
+}
+
+var _ ds.RawInterface = (*dsTxnCache)(nil)
+
+func (d *dsTxnCache) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error {
+ d.state.Add(d.mc, keys)
+ return d.RawInterface.DeleteMulti(keys, cb)
+}
+
+func (d *dsTxnCache) PutMulti(keys []ds.Key, metas []ds.PropertyMap, cb ds.PutMultiCB) error {
+ d.state.Add(d.mc, keys)
+ return d.RawInterface.PutMulti(keys, metas, cb)
+}

Powered by Google App Engine
This is Rietveld 408576698