Class: Racecar::RebalanceListener::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/racecar/rebalance_listener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rdkafka_topic_partition_list:, rdkafka_consumer:) ⇒ Event

Returns a new instance of Event.



37
38
39
40
# File 'lib/racecar/rebalance_listener.rb', line 37

def initialize(rdkafka_topic_partition_list:, rdkafka_consumer:)
  @__rdkafka_topic_partition_list = rdkafka_topic_partition_list
  @__rdkafka_consumer = rdkafka_consumer
end

Instance Attribute Details

#__rdkafka_consumerObject (readonly)

API private and not guaranteed stable



55
56
57
# File 'lib/racecar/rebalance_listener.rb', line 55

def __rdkafka_consumer
  @__rdkafka_consumer
end

#__rdkafka_topic_partition_listObject (readonly)

API private and not guaranteed stable



55
56
57
# File 'lib/racecar/rebalance_listener.rb', line 55

def __rdkafka_topic_partition_list
  @__rdkafka_topic_partition_list
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/racecar/rebalance_listener.rb', line 50

def empty?
  __rdkafka_topic_partition_list.empty?
end

#partition_numbersObject



46
47
48
# File 'lib/racecar/rebalance_listener.rb', line 46

def partition_numbers
  __rdkafka_topic_partition_list.to_h.values.flatten.map(&:partition)
end

#topic_nameObject



42
43
44
# File 'lib/racecar/rebalance_listener.rb', line 42

def topic_name
  __rdkafka_topic_partition_list.to_h.keys.first
end