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

Function New

tempodb/wal/wal.go:47–76  ·  view source on GitHub ↗
(c *Config)

Source from the content-addressed store, hash-verified

45}
46
47func New(c *Config) (*WAL, error) {
48 if c.Filepath == "" {
49 return nil, fmt.Errorf("please provide a path for the WAL")
50 }
51
52 // make folder
53 err := os.MkdirAll(c.Filepath, 0o700)
54 if err != nil {
55 return nil, err
56 }
57
58 // Setup local backend in /blocks/
59 blocksFolderPath := filepath.Join(c.Filepath, blocksDir)
60 err = os.MkdirAll(blocksFolderPath, 0o700)
61 if err != nil {
62 return nil, err
63 }
64
65 l, err := local.NewBackend(&local.Config{
66 Path: blocksFolderPath,
67 })
68 if err != nil {
69 return nil, err
70 }
71
72 return &WAL{
73 c: c,
74 l: l,
75 }, nil
76}
77
78// RescanBlocks returns a slice of append blocks from the wal folder
79func (w *WAL) RescanBlocks(additionalStartSlack time.Duration, log log.Logger) ([]common.WALBlock, error) {

Callers 13

NewFunction · 0.92
getPartitionWriterFunction · 0.92
getTenantStoreFunction · 0.92
startingMethod · 0.92
setupTestFunction · 0.92
startingMethod · 0.92
TestLiveStoreQueryRangeFunction · 0.92
testAppendBlockStartEndFunction · 0.70
testIngestionSlackFunction · 0.70
runWALTestWithAppendModeFunction · 0.70

Calls 2

NewBackendFunction · 0.92
JoinMethod · 0.65

Tested by 10

getPartitionWriterFunction · 0.74
getTenantStoreFunction · 0.74
setupTestFunction · 0.74
TestLiveStoreQueryRangeFunction · 0.74
testAppendBlockStartEndFunction · 0.56
testIngestionSlackFunction · 0.56
runWALTestWithAppendModeFunction · 0.56