Class: ElasticGraph::Indexer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/indexer/config.rb

Constant Summary collapse

EXPECTED_KEYS =
members.map(&:to_s)

Class Method Summary collapse

Class Method Details

.from_parsed_yaml(hash) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/elastic_graph/indexer/config.rb', line 27

def self.from_parsed_yaml(hash)
  hash = hash.fetch("indexer")
  extra_keys = hash.keys - EXPECTED_KEYS

  unless extra_keys.empty?
    raise ConfigError, "Unknown `indexer` config settings: #{extra_keys.join(", ")}"
  end

  new(
    latency_slo_thresholds_by_timestamp_in_ms: hash.fetch("latency_slo_thresholds_by_timestamp_in_ms"),
    skip_derived_indexing_type_updates: (hash["skip_derived_indexing_type_updates"] || {}).transform_values(&:to_set)
  )
end