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

Unified Diff: service/datastore/serialize.go

Issue 1269113005: A transparent cache for datastore, backed by memcache. (Closed) Base URL: https://github.com/luci/gae.git@add_meta
Patch Set: add test for per-model expiration 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: service/datastore/serialize.go
diff --git a/service/datastore/serialize.go b/service/datastore/serialize.go
index f4a0d78a6481190c34ee6b6bea417181ab65e2b6..30480231f7ad6de2060767b3f4a96c590f7321a2 100644
--- a/service/datastore/serialize.go
+++ b/service/datastore/serialize.go
@@ -292,16 +292,21 @@ func (p *Property) Read(buf Buffer, context KeyContext, appid, namespace string)
return
}
-// Write writes an entire PropertyMap to the buffer. `context`
-// behaves the same way that it does for WriteKey. If
-// WritePropertyMapDeterministic is true, then the rows will be sorted by
-// property name before they're serialized to buf (mostly useful for testing,
-// but also potentially useful if you need to make a hash of the property data).
+// Write writes an entire PropertyMap to the buffer. `context` behaves the same
+// way that it does for WriteKey. If WritePropertyMapDeterministic is true, then
+// the rows will be sorted by property name before they're serialized to buf
+// (mostly useful for testing, but also potentially useful if you need to make
+// a hash of the property data).
+//
+// Write skips metadata keys.
func (pm PropertyMap) Write(buf Buffer, context KeyContext) (err error) {
defer recoverTo(&err)
rows := make(sort.StringSlice, 0, len(pm))
tmpBuf := &bytes.Buffer{}
for name, vals := range pm {
+ if isMetaKey(name) {
+ continue
+ }
tmpBuf.Reset()
_, e := cmpbin.WriteString(tmpBuf, name)
panicIf(e)

Powered by Google App Engine
This is Rietveld 408576698