Class: Karafka::Pro::Processing::ParallelSegments::Filters::Base

Inherits:
Filters::Base
  • Object
show all
Defined in:
lib/karafka/pro/processing/parallel_segments/filters/base.rb

Overview

Base class for filters for parallel segments that deal with different feature scenarios

Direct Known Subclasses

Default, Mom

Instance Attribute Summary

Attributes inherited from Filters::Base

#cursor

Instance Method Summary collapse

Methods inherited from Filters::Base

#action, #applied?, #apply!, #mark_as_consumed?, #marking_cursor, #marking_method, #timeout

Constructor Details

#initialize(segment_id:, partitioner:, reducer:) ⇒ Base

Returns a new instance of Base.

Parameters:

  • segment_id (Integer)

    numeric id of the parallel segment group to use with the partitioner and reducer for segment matching comparison

  • partitioner (Proc)
  • reducer (Proc)


19
20
21
22
23
24
25
# File 'lib/karafka/pro/processing/parallel_segments/filters/base.rb', line 19

def initialize(segment_id:, partitioner:, reducer:)
  super()

  @segment_id = segment_id
  @partitioner = partitioner
  @reducer = reducer
end