| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) { | 91 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) { |
| 92 d.data.setSnapshot(snap.(*memStore)) | 92 d.data.setSnapshot(snap.(*memStore)) |
| 93 } | 93 } |
| 94 | 94 |
| 95 func (d *dsImpl) CatchupIndexes() { | 95 func (d *dsImpl) CatchupIndexes() { |
| 96 d.data.catchupIndexes() | 96 d.data.catchupIndexes() |
| 97 } | 97 } |
| 98 | 98 |
| 99 func (d *dsImpl) SetTransactionRetryCount(count int) { | 99 func (d *dsImpl) SetTransactionRetryCount(count int) { |
| 100 » d.data.txnFakeRetry = count | 100 » d.data.setTxnRetry(count) |
| 101 } |
| 102 |
| 103 func (d *dsImpl) Consistent(always bool) { |
| 104 » d.data.setConsistent(always) |
| 101 } | 105 } |
| 102 | 106 |
| 103 func (d *dsImpl) Testable() ds.Testable { | 107 func (d *dsImpl) Testable() ds.Testable { |
| 104 return d | 108 return d |
| 105 } | 109 } |
| 106 | 110 |
| 107 ////////////////////////////////// txnDsImpl /////////////////////////////////// | 111 ////////////////////////////////// txnDsImpl /////////////////////////////////// |
| 108 | 112 |
| 109 type txnDsImpl struct { | 113 type txnDsImpl struct { |
| 110 data *txnDataStoreData | 114 data *txnDataStoreData |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return executeQuery(q, d.ns, true, d.data.snap, d.data.snap, cb) | 149 return executeQuery(q, d.ns, true, d.data.snap, d.data.snap, cb) |
| 146 } | 150 } |
| 147 | 151 |
| 148 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { | 152 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { |
| 149 return errors.New("datastore: nested transactions are not supported") | 153 return errors.New("datastore: nested transactions are not supported") |
| 150 } | 154 } |
| 151 | 155 |
| 152 func (*txnDsImpl) Testable() ds.Testable { | 156 func (*txnDsImpl) Testable() ds.Testable { |
| 153 return nil | 157 return nil |
| 154 } | 158 } |
| OLD | NEW |