Class: LogStash::PipelineState

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/pipelines_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pipelineObject (readonly)

Returns the value of attribute pipeline.



5
6
7
# File 'lib/logstash/pipelines_registry.rb', line 5

def pipeline
  @pipeline
end

#pipeline_idObject (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

Raises:

  • (ArgumentError)


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

Returns:

  • (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