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
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def active @active end |
#distribution ⇒ Object
Returns the value of attribute distribution
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def distribution @distribution end |
#max_partitions ⇒ Object
Returns the value of attribute max_partitions
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def max_partitions @max_partitions end |
#offset_metadata_strategy ⇒ Object
Returns the value of attribute offset_metadata_strategy
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def @offset_metadata_strategy end |
#partitioner ⇒ Object
Returns the value of attribute partitioner
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def partitioner @partitioner end |
#reducer ⇒ Object
Returns the value of attribute reducer
12 13 14 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 12 def reducer @reducer end |
Instance Method Details
#active? ⇒ Boolean
Returns is this feature active.
22 23 24 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 22 def active? active end |
#distributor ⇒ Object
Returns distributor instance for the current distribution.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/karafka/pro/routing/features/virtual_partitions/config.rb', line 27 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 |