ValidateConfig returns true if the config is valid
(b *BlockConfig)
| 43 | |
| 44 | // ValidateConfig returns true if the config is valid |
| 45 | func 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 | } |