(blockID uuid.UUID, tenantID string)
| 15 | ) |
| 16 | |
| 17 | func (rw *readerWriter) MarkBlockCompacted(blockID uuid.UUID, tenantID string) error { |
| 18 | // move meta file to a new location |
| 19 | metaFilename := backend.MetaFileName(blockID, tenantID, rw.cfg.Prefix) |
| 20 | compactedMetaFilename := backend.CompactedMetaFileName(blockID, tenantID, rw.cfg.Prefix) |
| 21 | |
| 22 | src := rw.bucket.Object(metaFilename).Retryer( |
| 23 | storage.WithBackoff(gax.Backoff{}), |
| 24 | storage.WithPolicy(storage.RetryAlways), |
| 25 | storage.WithMaxAttempts(rw.cfg.MaxRetries), |
| 26 | ) |
| 27 | dst := rw.bucket.Object(compactedMetaFilename).Retryer( |
| 28 | storage.WithBackoff(gax.Backoff{}), |
| 29 | storage.WithPolicy(storage.RetryAlways), |
| 30 | storage.WithMaxAttempts(rw.cfg.MaxRetries), |
| 31 | ) |
| 32 | |
| 33 | ctx := context.TODO() |
| 34 | _, err := dst.CopierFrom(src).Run(ctx) |
| 35 | if err != nil { |
| 36 | return err |
| 37 | } |
| 38 | |
| 39 | return src.Delete(ctx) |
| 40 | } |
| 41 | |
| 42 | func (rw *readerWriter) ClearBlock(blockID uuid.UUID, tenantID string) error { |
| 43 | if len(tenantID) == 0 { |
nothing calls this directly
no test coverage detected