Class: Wukong::Load::LoadRunner
- Inherits:
-
Wukong::Local::LocalRunner
- Object
- Wukong::Local::LocalRunner
- Wukong::Load::LoadRunner
- Includes:
- Logging
- Defined in:
- lib/wukong-load/load_runner.rb
Overview
Runs the wu-load command.
Instance Method Summary collapse
-
#data_store_name ⇒ String
The name of the data store.
-
#processor ⇒ String
The name of the processor that should handle the data store.
-
#validate ⇒ true
Ensure that we were passed a data store name that we know about.
Instance Method Details
#data_store_name ⇒ String
The name of the data store
46 47 48 |
# File 'lib/wukong-load/load_runner.rb', line 46 def data_store_name args.first end |
#processor ⇒ String
The name of the processor that should handle the data store
53 54 55 56 57 58 59 60 |
# File 'lib/wukong-load/load_runner.rb', line 53 def processor case data_store_name when 'elasticsearch' then :elasticsearch_loader when 'kafka' then :kafka_loader when 'mongo','mongodb' then :mongodb_loader when 'sql', 'mysql' then :sql_loader end end |
#validate ⇒ true
Ensure that we were passed a data store name that we know about.
33 34 35 36 37 38 39 40 41 |
# File 'lib/wukong-load/load_runner.rb', line 33 def validate case when data_store_name.nil? raise Error.new("Must provide the name of a data store as the first argument") when processor.nil? raise Error.new("No loader defined for data store <#{data_store_name}>") end true end |