Class: Superset::Dataset::WarmUpCache
- Defined in:
- lib/superset/dataset/warm_up_cache.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#dashboard_id ⇒ Object
readonly
Returns the value of attribute dashboard_id.
-
#db_name ⇒ Object
readonly
Returns the value of attribute db_name.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dashboard_id:, table_name:, db_name:) ⇒ WarmUpCache
constructor
A new instance of WarmUpCache.
- #params(dashboard_id, table_name, db_name) ⇒ Object
- #perform ⇒ Object
- #response ⇒ Object
Methods inherited from Request
call, #query_params, #result, #superset_host
Methods included from Superset::Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(dashboard_id:, table_name:, db_name:) ⇒ WarmUpCache
Returns a new instance of WarmUpCache.
7 8 9 10 11 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 7 def initialize(dashboard_id:, table_name:, db_name:) @dashboard_id = dashboard_id @table_name = table_name @db_name = db_name end |
Instance Attribute Details
#dashboard_id ⇒ Object (readonly)
Returns the value of attribute dashboard_id.
5 6 7 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 5 def dashboard_id @dashboard_id end |
#db_name ⇒ Object (readonly)
Returns the value of attribute db_name.
5 6 7 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 5 def db_name @db_name end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
5 6 7 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 5 def table_name @table_name end |
Instance Method Details
#params(dashboard_id, table_name, db_name) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 22 def params(dashboard_id, table_name, db_name) { "dashboard_id" => dashboard_id, "table_name" => table_name, "db_name" => db_name } end |
#perform ⇒ Object
13 14 15 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 13 def perform response end |
#response ⇒ Object
17 18 19 20 |
# File 'lib/superset/dataset/warm_up_cache.rb', line 17 def response logger.info("Hitting #{route} for warming up the cache for the dashboard #{dashboard_id.to_s} and for the dataset #{table_name}") client.put(route, params(dashboard_id, table_name, db_name)) end |