Class: LogStash::PipelineState
- Inherits:
-
Object
- Object
- LogStash::PipelineState
- Defined in:
- lib/logstash/pipelines_registry.rb
Instance Attribute Summary collapse
-
#pipeline ⇒ Object
readonly
Returns the value of attribute pipeline.
-
#pipeline_id ⇒ Object
readonly
Returns the value of attribute pipeline_id.
Instance Method Summary collapse
-
#initialize(pipeline_id, pipeline) ⇒ PipelineState
constructor
A new instance of PipelineState.
- #set_pipeline(pipeline) ⇒ Object
- #set_reloading(is_reloading) ⇒ Object
- #terminated? ⇒ Boolean
Constructor Details
#initialize(pipeline_id, pipeline) ⇒ PipelineState
Returns a new instance of PipelineState.
7 8 9 10 11 |
# File 'lib/logstash/pipelines_registry.rb', line 7 def initialize(pipeline_id, pipeline) @pipeline_id = pipeline_id @pipeline = pipeline @reloading = Concurrent::AtomicBoolean.new(false) end |
Instance Attribute Details
#pipeline ⇒ Object (readonly)
Returns the value of attribute pipeline.
5 6 7 |
# File 'lib/logstash/pipelines_registry.rb', line 5 def pipeline @pipeline end |
#pipeline_id ⇒ Object (readonly)
Returns the value of attribute pipeline_id.
5 6 7 |
# File 'lib/logstash/pipelines_registry.rb', line 5 def pipeline_id @pipeline_id end |
Instance Method Details
#set_pipeline(pipeline) ⇒ Object
22 23 24 25 |
# File 'lib/logstash/pipelines_registry.rb', line 22 def set_pipeline(pipeline) raise(ArgumentError, "invalid nil pipeline") if pipeline.nil? @pipeline = pipeline end |
#set_reloading(is_reloading) ⇒ Object
18 19 20 |
# File 'lib/logstash/pipelines_registry.rb', line 18 def set_reloading(is_reloading) @reloading.value = is_reloading end |
#terminated? ⇒ Boolean
13 14 15 16 |
# File 'lib/logstash/pipelines_registry.rb', line 13 def terminated? # a reloading pipeline is never considered terminated @reloading.false? && @pipeline.finished_execution? end |