(p []byte, off int64, role cache.Role)
| 38 | } |
| 39 | |
| 40 | func (b *BackendReaderAt) ReadAtWithCache(p []byte, off int64, role cache.Role) (int, error) { |
| 41 | err := b.r.ReadRange(b.ctx, b.name, (uuid.UUID)(b.meta.BlockID), b.meta.TenantID, uint64(off), p, &backend.CacheInfo{ |
| 42 | Role: role, |
| 43 | Meta: b.meta, |
| 44 | }) |
| 45 | if err != nil { |
| 46 | return 0, err |
| 47 | } |
| 48 | b.bytesRead.Add(uint64(len(p))) |
| 49 | return len(p), nil |
| 50 | } |
| 51 | |
| 52 | func (b *BackendReaderAt) BytesRead() uint64 { |
| 53 | return b.bytesRead.Load() |