Class: DruidDB::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/druiddb/configuration.rb

Constant Summary collapse

CLIENT_ID =
'druiddb-ruby'.freeze
DISCOVERY_PATH =
'/druid/discovery'.freeze
INDEX_SERVICE =
'druid/overlord'.freeze
KAFKA_BROKER_PATH =
'/brokers/ids'.freeze
KAFKA_OVERFLOW_WAIT =
0.05
LOG_LEVEL =
:error
ROLLUP_GRANULARITY =
:minute
STRONG_DELETE =
false
TUNING_GRANULARITY =
:day
TUNING_WINDOW =
'PT1H'.freeze
WAIT_TIME =
20
ZOOKEEPER =
'localhost:2181'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Configuration

Returns a new instance of Configuration.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/druiddb/configuration.rb', line 29

def initialize(opts = {})
  @client_id = opts[:client_id] || CLIENT_ID
  @discovery_path = opts[:discovery_path] || DISCOVERY_PATH
  @index_service = opts[:index_service] || INDEX_SERVICE
  @kafka_broker_path = opts[:kafka_broker_path] || KAFKA_BROKER_PATH
  @kafka_overflow_wait = opts[:kafka_overflow_wait] || KAFKA_OVERFLOW_WAIT
  @log_level = opts[:log_level] || LOG_LEVEL
  @rollup_granularity = rollup_granularity_string(opts[:rollup_granularity])
  @strong_delete = opts[:strong_delete] || STRONG_DELETE
  @tuning_granularity = tuning_granularity_string(opts[:tuning_granularity])
  @tuning_window = opts[:tuning_window] || TUNING_WINDOW
  @wait_time = opts[:wait_time] || WAIT_TIME
  @zookeeper = opts[:zookeeper] || ZOOKEEPER
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def client_id
  @client_id
end

#discovery_pathObject (readonly)

Returns the value of attribute discovery_path.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def discovery_path
  @discovery_path
end

#index_serviceObject (readonly)

Returns the value of attribute index_service.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def index_service
  @index_service
end

#kafka_broker_pathObject (readonly)

Returns the value of attribute kafka_broker_path.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def kafka_broker_path
  @kafka_broker_path
end

#kafka_overflow_waitObject (readonly)

Returns the value of attribute kafka_overflow_wait.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def kafka_overflow_wait
  @kafka_overflow_wait
end

#log_levelObject (readonly)

Returns the value of attribute log_level.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def log_level
  @log_level
end

#rollup_granularityObject (readonly)

Returns the value of attribute rollup_granularity.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def rollup_granularity
  @rollup_granularity
end

#strong_deleteObject (readonly)

Returns the value of attribute strong_delete.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def strong_delete
  @strong_delete
end

#tuning_granularityObject (readonly)

Returns the value of attribute tuning_granularity.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def tuning_granularity
  @tuning_granularity
end

#tuning_windowObject (readonly)

Returns the value of attribute tuning_window.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def tuning_window
  @tuning_window
end

#wait_timeObject (readonly)

Returns the value of attribute wait_time.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def wait_time
  @wait_time
end

#zookeeperObject (readonly)

Returns the value of attribute zookeeper.



16
17
18
# File 'lib/druiddb/configuration.rb', line 16

def zookeeper
  @zookeeper
end