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

Side by Side Diff: impl/memory/datastore_data.go

Issue 1347843002: Make SetTransactionRetryCount actually work. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: 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/memory/datastore.go ('k') | no next file » | 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 memory 5 package memory
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "sync" 10 "sync"
11 "sync/atomic" 11 "sync/atomic"
12 12
13 ds "github.com/luci/gae/service/datastore" 13 ds "github.com/luci/gae/service/datastore"
14 "github.com/luci/gae/service/datastore/dskey" 14 "github.com/luci/gae/service/datastore/dskey"
15 "github.com/luci/gae/service/datastore/serialize" 15 "github.com/luci/gae/service/datastore/serialize"
16 "github.com/luci/luci-go/common/errors" 16 "github.com/luci/luci-go/common/errors"
17 "golang.org/x/net/context" 17 "golang.org/x/net/context"
18 ) 18 )
19 19
20 //////////////////////////////// dataStoreData ///////////////////////////////// 20 //////////////////////////////// dataStoreData /////////////////////////////////
21 21
22 type dataStoreData struct { 22 type dataStoreData struct {
23 rwlock sync.RWMutex 23 rwlock sync.RWMutex
24 // See README.md for head schema. 24 // See README.md for head schema.
25 head *memStore 25 head *memStore
26 snap *memStore 26 snap *memStore
27 // For testing, see SetTransactionRetryCount.
28 txnFakeRetry int
27 } 29 }
28 30
29 var ( 31 var (
30 _ = memContextObj((*dataStoreData)(nil)) 32 _ = memContextObj((*dataStoreData)(nil))
31 _ = sync.Locker((*dataStoreData)(nil)) 33 _ = sync.Locker((*dataStoreData)(nil))
32 ) 34 )
33 35
34 func newDataStoreData() *dataStoreData { 36 func newDataStoreData() *dataStoreData {
35 head := newMemStore() 37 head := newMemStore()
36 return &dataStoreData{ 38 return &dataStoreData{
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 } 432 }
431 433
432 func rpm(data []byte) (ds.PropertyMap, error) { 434 func rpm(data []byte) (ds.PropertyMap, error) {
433 return serialize.ReadPropertyMap(bytes.NewBuffer(data), 435 return serialize.ReadPropertyMap(bytes.NewBuffer(data),
434 serialize.WithContext, "", "") 436 serialize.WithContext, "", "")
435 } 437 }
436 438
437 type keyitem interface { 439 type keyitem interface {
438 Key() ds.Key 440 Key() ds.Key
439 } 441 }
OLDNEW
« no previous file with comments | « impl/memory/datastore.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698