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

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: fix comments 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 | « filter/dscache/ds.go ('k') | filter/dscache/ds_txn_state.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6ecceb4f77a56d61092898bac43eb4f6e9e3f897
--- /dev/null
+++ b/filter/dscache/ds_txn.go
@@ -0,0 +1,32 @@
+// 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"
+)
+
+type dsTxnCache struct {
+ ds.RawInterface
+
+ state *dsTxnState
+
+ sc *supportContext
+}
+
+var _ ds.RawInterface = (*dsTxnCache)(nil)
+
+func (d *dsTxnCache) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error {
+ d.state.add(d.sc, 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.sc, keys)
+ return d.RawInterface.PutMulti(keys, metas, cb)
+}
+
+// TODO(riannucci): on GetAll, Load from memcache and invalidate entries if the
+// memcache version doesn't match the datastore version.
« no previous file with comments | « filter/dscache/ds.go ('k') | filter/dscache/ds_txn_state.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698