Class: LogStash::TestPipeline::EventTrackingQueueReadClientDelegator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delegate) ⇒ EventTrackingQueueReadClientDelegator

Returns a new instance of EventTrackingQueueReadClientDelegator.



67
68
69
70
71
# File 'lib/logstash/test_pipeline.rb', line 67

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



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

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

Instance Attribute Details

#processed_eventsObject (readonly)

Returns the value of attribute processed_events.



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

def processed_events
  @processed_events
end

Instance Method Details

#addFilteredMetrics(filteredSize) ⇒ Object



104
105
106
# File 'lib/logstash/test_pipeline.rb', line 104

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

#addOutputMetrics(filteredSize) ⇒ Object



99
100
101
# File 'lib/logstash/test_pipeline.rb', line 99

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

#closeObject



114
115
116
# File 'lib/logstash/test_pipeline.rb', line 114

def close
  @delegate.close
end

#closeBatch(batch) ⇒ Object



79
80
81
# File 'lib/logstash/test_pipeline.rb', line 79

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

#filtered_events(events) ⇒ Object



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

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

#isEmptyObject



84
85
86
# File 'lib/logstash/test_pipeline.rb', line 84

def isEmpty
  @delegate.empty?
end

#newBatchObject



89
90
91
# File 'lib/logstash/test_pipeline.rb', line 89

def newBatch
  @delegate.new_batch
end

#readBatchObject



74
75
76
# File 'lib/logstash/test_pipeline.rb', line 74

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

#reset_events!Object



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

def reset_events!
  @processed_events = []
end

#set_batch_dimensions(batch_size, batch_delay) ⇒ Object



109
110
111
# File 'lib/logstash/test_pipeline.rb', line 109

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

#startMetrics(batch) ⇒ Object



94
95
96
# File 'lib/logstash/test_pipeline.rb', line 94

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