Class: LogStash::TestPipeline::EventTrackingQueueReadClientDelegator

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

Instance Method Summary collapse

Constructor Details

#initialize(delegate) ⇒ EventTrackingQueueReadClientDelegator

Returns a new instance of EventTrackingQueueReadClientDelegator.



64
65
66
67
68
# File 'lib/logstash/test_pipeline.rb', line 64

def initialize(delegate)
  # NOTE: can not use LogStash::MemoryReadClient#read_batch due its JavaObject wrapping
  @delegate = delegate.to_java(QueueReadClient)
  @processed_events = Concurrent::Array.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



116
117
118
# File 'lib/logstash/test_pipeline.rb', line 116

def method_missing(method, *args)
  @delegate.public_send(method, *args)
end

Instance Method Details

#addFilteredMetrics(filteredSize) ⇒ Object



101
102
103
# File 'lib/logstash/test_pipeline.rb', line 101

def addFilteredMetrics(filteredSize)
  @delegate.add_filtered_metrics(filteredSize)
end

#addOutputMetrics(filteredSize) ⇒ Object



96
97
98
# File 'lib/logstash/test_pipeline.rb', line 96

def addOutputMetrics(filteredSize)
  @delegate.add_output_metrics(filteredSize)
end

#closeObject



111
112
113
# File 'lib/logstash/test_pipeline.rb', line 111

def close
  @delegate.close
end

#closeBatch(batch) ⇒ Object



76
77
78
# File 'lib/logstash/test_pipeline.rb', line 76

def closeBatch(batch)
  @delegate.close_batch(batch)
end

#filtered_events(events) ⇒ Object



124
125
126
# File 'lib/logstash/test_pipeline.rb', line 124

def filtered_events(events)
  @processed_events.concat(events)
end

#isEmptyObject



81
82
83
# File 'lib/logstash/test_pipeline.rb', line 81

def isEmpty
  @delegate.empty?
end

#newBatchObject



86
87
88
# File 'lib/logstash/test_pipeline.rb', line 86

def newBatch
  @delegate.new_batch
end

#processed_eventsObject



120
121
122
# File 'lib/logstash/test_pipeline.rb', line 120

def processed_events
  @processed_events.to_a
end

#readBatchObject



71
72
73
# File 'lib/logstash/test_pipeline.rb', line 71

def readBatch
  QueueBatchDelegator.new(self, @delegate.read_batch)
end

#reset_events!Object



128
129
130
# File 'lib/logstash/test_pipeline.rb', line 128

def reset_events!
  @processed_events.clear
end

#set_batch_dimensions(batch_size, batch_delay) ⇒ Object



106
107
108
# File 'lib/logstash/test_pipeline.rb', line 106

def set_batch_dimensions(batch_size, batch_delay)
  @delegate.set_batch_dimensions(batch_size, batch_delay)
end

#startMetrics(batch) ⇒ Object



91
92
93
# File 'lib/logstash/test_pipeline.rb', line 91

def startMetrics(batch)
  @delegate.start_metrics(batch)
end