Class: Karafka::Pro::Routing::Features::VirtualPartitions::Config
- Inherits:
-
Struct
- Object
- Struct
- Karafka::Pro::Routing::Features::VirtualPartitions::Config
- Defined in:
- lib/karafka/pro/routing/features/virtual_partitions/config.rb
Overview
Configuration for virtual partitions feature
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#distribution ⇒ Object
Returns the value of attribute distribution.
-
#max_partitions ⇒ Object
Returns the value of attribute max_partitions.
-
#offset_metadata_strategy ⇒ Object
Returns the value of attribute offset_metadata_strategy.
-
#partitioner ⇒ Object
Returns the value of attribute partitioner.
-
#reducer ⇒ Object
Returns the value of attribute reducer.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Is this feature active.
-
#distributor ⇒ Object
Distributor instance for the current distribution.
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def active @active end |
#distribution ⇒ Object
Returns the value of attribute distribution
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def distribution @distribution end |
#max_partitions ⇒ Object
Returns the value of attribute max_partitions
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def max_partitions @max_partitions end |
#offset_metadata_strategy ⇒ Object
Returns the value of attribute offset_metadata_strategy
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def @offset_metadata_strategy end |
#partitioner ⇒ Object
Returns the value of attribute partitioner
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def partitioner @partitioner end |
#reducer ⇒ Object
Returns the value of attribute reducer
29 30 31 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 29 def reducer @reducer end |
Instance Method Details
#active? ⇒ Boolean
Returns is this feature active.
39 40 41 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 39 def active? active end |
#distributor ⇒ Object
Returns distributor instance for the current distribution.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 44 def distributor @distributor ||= case distribution when :balanced Processing::VirtualPartitions::Distributors::Balanced.new(self) when :consistent Processing::VirtualPartitions::Distributors::Consistent.new(self) else raise Karafka::Errors::UnsupportedCaseError, distribution end end |