OLD | NEW |
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 "errors" | 8 "errors" |
9 "fmt" | 9 "fmt" |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) { | 96 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) { |
97 d.data.setSnapshot(snap.(*memStore)) | 97 d.data.setSnapshot(snap.(*memStore)) |
98 } | 98 } |
99 | 99 |
100 func (d *dsImpl) CatchupIndexes() { | 100 func (d *dsImpl) CatchupIndexes() { |
101 d.data.catchupIndexes() | 101 d.data.catchupIndexes() |
102 } | 102 } |
103 | 103 |
104 func (d *dsImpl) SetTransactionRetryCount(count int) { | 104 func (d *dsImpl) SetTransactionRetryCount(count int) { |
105 » d.data.txnFakeRetry = count | 105 » d.data.setTxnRetry(count) |
| 106 } |
| 107 |
| 108 func (d *dsImpl) Consistent(always bool) { |
| 109 » d.data.setConsistent(always) |
106 } | 110 } |
107 | 111 |
108 func (d *dsImpl) Testable() ds.Testable { | 112 func (d *dsImpl) Testable() ds.Testable { |
109 return d | 113 return d |
110 } | 114 } |
111 | 115 |
112 ////////////////////////////////// txnDsImpl /////////////////////////////////// | 116 ////////////////////////////////// txnDsImpl /////////////////////////////////// |
113 | 117 |
114 type txnDsImpl struct { | 118 type txnDsImpl struct { |
115 data *txnDataStoreData | 119 data *txnDataStoreData |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return countQuery(fq, d.ns, true, d.data.snap, d.data.snap) | 158 return countQuery(fq, d.ns, true, d.data.snap, d.data.snap) |
155 } | 159 } |
156 | 160 |
157 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { | 161 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { |
158 return errors.New("datastore: nested transactions are not supported") | 162 return errors.New("datastore: nested transactions are not supported") |
159 } | 163 } |
160 | 164 |
161 func (*txnDsImpl) Testable() ds.Testable { | 165 func (*txnDsImpl) Testable() ds.Testable { |
162 return nil | 166 return nil |
163 } | 167 } |
OLD | NEW |