MCPcopy
hub / github.com/grafana/tempo / newMockCompactor

Function newMockCompactor

tempodb/blocklist/poller_test.go:1365–1386  ·  view source on GitHub ↗
(list PerTenantCompacted, expectsError bool)

Source from the content-addressed store, hash-verified

1363}
1364
1365func newMockCompactor(list PerTenantCompacted, expectsError bool) backend.Compactor {
1366 return &backend.MockCompactor{
1367 BlockMetaFn: func(blockID uuid.UUID, tenantID string) (*backend.CompactedBlockMeta, error) {
1368 if expectsError {
1369 return nil, errors.New("err")
1370 }
1371
1372 l, ok := list[tenantID]
1373 if !ok {
1374 return nil, backend.ErrDoesNotExist
1375 }
1376
1377 for _, m := range l {
1378 if (uuid.UUID)(m.BlockID) == blockID {
1379 return m, nil
1380 }
1381 }
1382
1383 return nil, backend.ErrDoesNotExist
1384 },
1385 }
1386}
1387
1388func newMockReader(list PerTenant, compactedList PerTenantCompacted, expectsError bool) backend.Reader {
1389 tenants := []string{}

Callers 5

TestTenantIndexBuilderFunction · 0.85
TestPollBlockFunction · 0.85
BenchmarkPoller10kFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected