Class: Spotlight::Etl::Pipeline
- Inherits:
-
Object
- Object
- Spotlight::Etl::Pipeline
- Includes:
- ActiveSupport::Benchmarkable
- Defined in:
- app/services/spotlight/etl/pipeline.rb
Overview
ETL pipeline definition
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#call(context, data: {}, cache: nil) {|optioanlly..| ... } ⇒ Object
Execute the ETL pipeline.
-
#estimated_size(context) ⇒ Number
Estimate the number of documents that will be produced by the pipeline.
-
#initialize {|_self| ... } ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize {|_self| ... } ⇒ Pipeline
Returns a new instance of Pipeline.
50 51 52 |
# File 'app/services/spotlight/etl/pipeline.rb', line 50 def initialize yield(self) if block_given? end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
9 10 11 |
# File 'app/services/spotlight/etl/pipeline.rb', line 9 def context @context end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'app/services/spotlight/etl/pipeline.rb', line 9 def source @source end |
Instance Method Details
#call(context, data: {}, cache: nil) {|optioanlly..| ... } ⇒ Object
Execute the ETL pipeline
61 62 63 |
# File 'app/services/spotlight/etl/pipeline.rb', line 61 def call(context, data: {}, cache: nil, &block) executor(context, cache: cache).call(data: data, &block) end |
#estimated_size(context) ⇒ Number
Estimate the number of documents that will be produced by the pipeline
70 71 72 |
# File 'app/services/spotlight/etl/pipeline.rb', line 70 def estimated_size(context) executor(context).estimated_size end |