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 datastore | 5 package datastore |
6 | 6 |
7 type TestingSnapshot interface{} | 7 type TestingSnapshot interface{} |
8 | 8 |
9 // Testable is the testable interface for fake datastore implementations. | 9 // Testable is the testable interface for fake datastore implementations. |
10 type Testable interface { | 10 type Testable interface { |
(...skipping 15 matching lines...) Expand all Loading... |
26 SetIndexSnapshot(TestingSnapshot) | 26 SetIndexSnapshot(TestingSnapshot) |
27 | 27 |
28 // CatchupIndexes catches the index table up to the current state of the | 28 // CatchupIndexes catches the index table up to the current state of the |
29 // datastore. This is equivalent to: | 29 // datastore. This is equivalent to: |
30 // idxSnap := TakeIndexSnapshot() | 30 // idxSnap := TakeIndexSnapshot() |
31 // SetIndexSnapshot(idxSnap) | 31 // SetIndexSnapshot(idxSnap) |
32 // | 32 // |
33 // But depending on the implementation it may implemented with an atomic | 33 // But depending on the implementation it may implemented with an atomic |
34 // operation. | 34 // operation. |
35 CatchupIndexes() | 35 CatchupIndexes() |
| 36 |
| 37 // SetTransactionRetryCount set how many times RunInTransaction will ret
ry |
| 38 // transaction body pretending transaction conflicts happens. 0 (default
) |
| 39 // means commit succeeds on the first attempt (no retries). |
| 40 SetTransactionRetryCount(int) |
36 } | 41 } |
OLD | NEW |