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

Function ValidateConfig

tempodb/encoding/common/config.go:45–65  ·  view source on GitHub ↗

ValidateConfig returns true if the config is valid

(b *BlockConfig)

Source from the content-addressed store, hash-verified

43
44// ValidateConfig returns true if the config is valid
45func ValidateConfig(b *BlockConfig) error {
46 if b.BloomFP <= 0.0 || b.BloomFP >= 1.0 {
47 return fmt.Errorf("invalid bloom filter fp rate %v", b.BloomFP)
48 }
49
50 if b.BloomShardSizeBytes <= 0 {
51 return fmt.Errorf("positive value required for bloom-filter shard size")
52 }
53
54 // Check for deprecated version,
55 // TODO - Cyclic dependency makes this awkward to improve by using the
56 // deprecation information in the encoding itself, in the versioned logic
57 // in the parent folder. So we are checking raw strings here.
58 /*if b.Version == "vParquet2" {
59 return fmt.Errorf(DeprecatedError, "vParquet2", "vParquet3")
60 }*/
61
62 // TODO - log or pass warnings up the chain?
63 _, err := b.DedicatedColumns.Validate()
64 return err
65}

Callers 4

validateConfigFunction · 0.92
TestCompactFunction · 0.92
TestCompactFunction · 0.92
TestCompactFunction · 0.92

Calls 1

ValidateMethod · 0.65

Tested by 3

TestCompactFunction · 0.74
TestCompactFunction · 0.74
TestCompactFunction · 0.74