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

Side by Side Diff: impl/prod/memcache.go

Issue 1355783002: Refactor keys and queries in datastore service and implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: appease errcheck Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « impl/prod/doc.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package prod 5 package prod
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 mc "github.com/luci/gae/service/memcache" 10 mc "github.com/luci/gae/service/memcache"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return nil 134 return nil
135 } 135 }
136 136
137 func (m mcImpl) CompareAndSwapMulti(items []mc.Item, cb mc.RawCB) error { 137 func (m mcImpl) CompareAndSwapMulti(items []mc.Item, cb mc.RawCB) error {
138 return doCB(memcache.CompareAndSwapMulti(m.Context, mcMF2R(items)), cb) 138 return doCB(memcache.CompareAndSwapMulti(m.Context, mcMF2R(items)), cb)
139 } 139 }
140 140
141 func (m mcImpl) Increment(key string, delta int64, initialValue *uint64) (uint64 , error) { 141 func (m mcImpl) Increment(key string, delta int64, initialValue *uint64) (uint64 , error) {
142 if initialValue == nil { 142 if initialValue == nil {
143 return memcache.IncrementExisting(m.Context, key, delta) 143 return memcache.IncrementExisting(m.Context, key, delta)
144 } else {
145 return memcache.Increment(m.Context, key, delta, *initialValue)
146 } 144 }
145 return memcache.Increment(m.Context, key, delta, *initialValue)
147 } 146 }
148 147
149 func (m mcImpl) Flush() error { 148 func (m mcImpl) Flush() error {
150 return memcache.Flush(m.Context) 149 return memcache.Flush(m.Context)
151 } 150 }
152 151
153 func (m mcImpl) Stats() (*mc.Statistics, error) { 152 func (m mcImpl) Stats() (*mc.Statistics, error) {
154 stats, err := memcache.Stats(m.Context) 153 stats, err := memcache.Stats(m.Context)
155 if err != nil { 154 if err != nil {
156 return nil, err 155 return nil, err
157 } 156 }
158 return (*mc.Statistics)(stats), nil 157 return (*mc.Statistics)(stats), nil
159 } 158 }
OLDNEW
« no previous file with comments | « impl/prod/doc.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698