Method
WriteLTXFile
(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader)
Source from the content-addressed store, hash-verified
| 74 | } |
| 75 | |
| 76 | func (c *writeTestReplicaClient) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error) { |
| 77 | data, err := io.ReadAll(r) |
| 78 | if err != nil { |
| 79 | return nil, err |
| 80 | } |
| 81 | |
| 82 | c.mu.Lock() |
| 83 | defer c.mu.Unlock() |
| 84 | |
| 85 | key := ltxKey(level, minTXID, maxTXID) |
| 86 | c.ltxData[key] = data |
| 87 | |
| 88 | info := <x.FileInfo{ |
| 89 | Level: level, |
| 90 | MinTXID: minTXID, |
| 91 | MaxTXID: maxTXID, |
| 92 | CreatedAt: time.Now(), |
| 93 | Size: int64(len(data)), |
| 94 | } |
| 95 | c.ltxFiles[level] = append(c.ltxFiles[level], info) |
| 96 | |
| 97 | return info, nil |
| 98 | } |
| 99 | |
| 100 | func (c *writeTestReplicaClient) DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error { |
| 101 | return nil |
Callers
nothing calls this directly
Tested by
no test coverage detected