(blockID uuid.UUID, tenantID string)
| 22 | } |
| 23 | |
| 24 | func (rw *Azure) MarkBlockCompacted(blockID uuid.UUID, tenantID string) error { |
| 25 | if len(tenantID) == 0 { |
| 26 | return backend.ErrEmptyTenantID |
| 27 | } |
| 28 | if blockID == uuid.Nil { |
| 29 | return backend.ErrEmptyBlockID |
| 30 | } |
| 31 | |
| 32 | // move meta file to a new location |
| 33 | metaFilename := backend.MetaFileName(blockID, tenantID, rw.cfg.Prefix) |
| 34 | compactedMetaFilename := backend.CompactedMetaFileName(blockID, tenantID, rw.cfg.Prefix) |
| 35 | ctx := context.TODO() |
| 36 | |
| 37 | src, _, err := rw.readAll(ctx, metaFilename) |
| 38 | if err != nil { |
| 39 | return err |
| 40 | } |
| 41 | |
| 42 | err = rw.writeAll(ctx, compactedMetaFilename, src) |
| 43 | if err != nil { |
| 44 | return err |
| 45 | } |
| 46 | |
| 47 | // delete the old file |
| 48 | return rw.Delete(ctx, metaFilename, []string{}, nil) |
| 49 | } |
| 50 | |
| 51 | func (rw *Azure) ClearBlock(blockID uuid.UUID, tenantID string) error { |
| 52 | var warning error |
nothing calls this directly
no test coverage detected